Download glb via rest api

Hello,
I found a small difference between downloading glb via rest api and downloading the glb directly from studio.

If I download the glb file from the studio, it downloads along with the glb’s mapping material information as a json format.

However, it just download a single glb file if I download it via rest api.

Is there any way I can get or refer the mapping material json data for the glb file?

@vaios Any ideas on this one?

Maybe you are using a different URL to download in Editor vs REST API - can you share an example of the REST API code you are using?

At first time, I tried api from https://developer.playcanvas.com/en/user-manual/api/asset-file/

However, it wasn’t working so I tried with the following url which is from asset json data.
id)

file: {
    hash: '3652e5391da1c3eeb498df2fb919aa0f',
    size: 7726396,
    filename: '86650M7FA0_POS1.glb',
    url: '/api/assets/49115155/file/86650M7FA0_POS1.glb?branchId=b8003eb1-0b4f-4ec7-a283-e0695b93791b'
  },
https://playcanvas.com/api/assets/49115155/file/86650M7FA0_POS1.glb?branchId=b8003eb1-0b4f-4ec7-a283-e0695b93791b

Try /api/assets/(id)/download instead

I tried with https://playcanvas.com/api/assets/49077774/download?branchId=b8003eb1-0b4f-4ec7-a283-e0695b93791b

but it doesn’t work.
The response was ‘Not Allowed’

Ah yes indeed that is not exposed yet. I think there is no way to do that via the REST API at the moment I’m afraid.

Do you have plan to expose the url?

Also, just wonder…
Is there any alternative way to maintain the actual material name instead of “Default Material” for each individual meshes?

Can I download just the config.json file from the project?

@will It will be great is the download api is opened to public :slight_smile:

Is there a reason not to just use the Editor rather than trying to use Engine only with Editor assets?

Or rather than the Editor converted GLBs, use a Blender GLB exporter/FBX to GLB tool that will have all the textures and materials embedded in the GLB and can be loaded directly with the Engine only and not have to deal with mapping JSON etc

Either option would seem to make the process a lot easier?