So for some reason, recently I havent been able to download sims through the rest api? The object that gets returned does not contain a download url for the app as it did previously. Is this a bug or an intentional deprecation?
EDIT: according to this I would expect there to be a download url to be present
AFAIK, that API endpoint never gave a download URL as it takes some time for the build to be ready. As mentioned on that page, that endpoint gives a âjobâ id and you would use that to poll this endpoint to see when it is ready and returns a URL
So youâre technically correct, what Im trying to say is that a completed job isnt including a download url anymore? Is this a paid feature?
Odd that your output doesnât have the status property from the screenshot
I just did a test with a free account and it looks fine on my end
{
status: 'complete',
messages: [],
created_at: '2024-04-05T15:29:32.812000',
modified_at: '2024-04-05T15:29:32.812000',
data: {
concatenate: true,
branch_id: 'bcbf6e59-4db6-4c4c-97b7-f8527fbb7694',
optimize_scene_format: false,
minify: true,
name: 'Model Viewer',
sourcemaps: false,
scenes: [ '1978551' ],
download_url: 'someurl',
engineVersion: '',
project_id: 1206193,
owner_id: 399703
},
id: 1813775
Are you checking the status property of the data when you poll the job endpoint?
From the docs: Jobs - Get job | PlayCanvas Developer Site
It looks like you are showing the data
field json.
Are you checking the status
property? If itâs still running, you need to poll again some time later and keep doing it till itâs complete. This repo does a lot of this work for you GitHub - playcanvas/playcanvas-rest-api-tools: A set of tools to use with the PlayCanvas REST API for common jobs such as downloading a build and archiving a project
So my status is error and the messages only includes âCould not exportâ. Anything else I can do to troubleshoot? Is my key just invalid?
Hmm, that is odd. I would try to see if you can download a build directly from the Editor.
In either case, I would reach out to the PlayCanvas team (@yak32 or support@playcanvas.com) as they would have more detailed logs
Hm, Iâm getting this issue now. Seems fine if itâs a project that my username owns but not on a project where itâs on the PlayCanvas ORG and Iâm a team member
ie This project I get an error like @Nicholas_Taylor2 https://playcanvas.com/project/785157/overview/flappy-bird-for-playable-fb-ad
But my fork is fine? https://playcanvas.com/project/1207041/overview/flappy-bird-for-playable-fb-ad
CC @Mark_Lundin
Weird, now it works
@Nicholas_Taylor2 Iâd try and download this manually via the editor to see if it works. Let me know if thatâs still happening and I can take a look.
@yaustar is it still causing issues for you? Was it a export via the editor or the API download?
API download, I had errors to start with, tried a new API key, same issue.
Then forked the project and tried that, which was fine
Tried the original project 30 mins later and had no issue
I was able to successfully manually download from the editor. I am still unable to download via the API.
Are you using the playcanvas-rest-api tools? If so there was an update recently, so youâll want to update your version
Nope, Im using the python requests library to hit the web endpoint.
Are you able to share the project @Nicholas_Taylor2 or add me to it, so I can take a look?
Can you add me MARK-SNAP to the project?
1 Like
Hey @Nicholas_Taylor2, I just tried downloading your project from the terminal and it seemed to work fine.
Can you verify this works for you?
curl -H "Authorization: Bearer {ACCESS_TOKEN}" -H "Content-Type: application/json" -X POST -d '{"project_id": 883802, "scenes": [1338349], "name": "My App"}' "https://playcanvas.com/api/apps/download"
and then poll the job with the ID
curl -H "Authorization: Bearer {ACCESS_TOKEN}" "https://playcanvas.com/api/jobs/{JOB_ID}"
How often are you polling API to see if the job is done?
1 Like
Yep thatâs a valid point, the download_url
isnât immediately available, although that wouldnât explain the Could not export message