We are currently developing a “cloud build” service utilizing the PlayCanvas RES API, which creates builds, puts in some custom meta tags in the index.html, auto-increments the version number and uploads it to a fileserver. But we ran into a problem:
When trying to fetch the project data via REST API, we get the following error:
404 {“error”: “Project does not have a primary app”}
Are you sure your project has a primary app set? You need to click on the flag on the left of a build to make that the primary app of the project. See example screenshot below:
thank you for your response. We do not have any ‘published’ builds of the apps, since they should not be publicly available on the Playcanvas website. Therefore we cannot mark a build as ‘primary app’.
But your input is quite insightful. We looked on the API documentation again and it seems that there is no endpoint for getting app information (like name, description, thumbnail, etc) for apps without a public build.
There are only 4 endpoints regarding the app:
Apps - Download app
[…] The request will start an export job […]
Apps - Get primary app
Gets the Primary App of a Project.
Apps - Get project apps
Lists all the published Apps of a Project.
Apps - Get app
Gets a published App by id.
So it seems there is no way to get information about an unpublished app.
Not 100% sure what you are looking for when you get the primary app? If the idea is to keep the builds all off public access from PlayCanvas, Download App endpoint seems to be more appropriate to use to build the app and use your own description.
It sounds you are best keeping your own local/cloud copy of the details you are looking to get via Primary App.
@yaustar We have our internal “cloudbuild” solution now set up, but we also want do display infos like the project thumbnail, description etc. there, without having the projects to be public.
So we’d like to get those infos, without having a “primary app” -> since this is only applicable for public projects afaik…
Sure, what I was trying to say was that you could store the thumbnail and other meta data elsewhere (eg on the build server or internal network server) rather than part of the PlayCanvas project. It’s not the ideal solution as it would be nice to have everything in one place (PlayCanvas services) but it be workable?