API v3 Migration Question – Looking for alternative endpoints for POST /builds and getting artifact download link #3311
Replies: 2 comments 4 replies
-
|
Hello @appfast-codev To answer your questions, There is currently no equivalent of POST /builds in the new v3 api and there is no ETA on when it will be available bit we will update the docs as soon as it is ready. If you could share your build ID with me, I can investigate why your code stopped working. I checked the the endpoints and they work perfectly for me |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Hello @appfast-codev, I am going to go ahead and close this, since I didn't hear back from you. You can reopen this if you are still experiencing the same issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?
Flutter (Dart)
Steps to reproduce
Hello Codemagic Community,
I am in the process of upgrading my system from the old Codemagic API (referenced at docs.codemagic.io/rest-api/codemagic-rest-api/) to the new v3 API (as per the schema at codemagic.io/api/v3/schema and the
document.jsonfile).My custom PHP library (
CodeMagic.php) is failing because it relies on old endpoints (likePOST /buildsandGET /builds/{build_id}) that no longer appear to exist in v3.I need help finding replacement v3 endpoints for 3 core functions:
Create a new build.
Check the status of that particular build.
Get the download URL of the artifact when the build is complete.
Steps to reproduce (Current Workflow is broken)
Here is my old logic flow and where it broke:
A controller (
CreateBuild.php) calls thecreate_build()function in my library, which used toPOSTto/builds.A background task (cron job) then calls the
check_status()function toGETfrom/builds/{build_id}to check the status and get the artifact URL.Since the endpoint in step 2 no longer exists, the
staticfield (which stores the artifact URL) in my database is never updated and remains empty.When the user attempts to download, the
DownloadArtefact.phpcontroller is called.It fetches the build from the database (with the
staticfield empty) and calls thesigning_download_link('')function.This function attempts to do a
POSTto$link."/public-url", (i.e.POST '/public-url'), which causes a fatal error.Expected results
Expected Result
I'd like to find explicit alternative endpoints in the v3 API documentation (
document.json) so I can update myCodeMagic.phplibrary:To create the build: An explicit
POSTendpoint, e.g./api/v3/apps/{app_id}/builds, where I can pass theworkflowIdandbranch(or equivalent parameters).To check the status: An explicit
GETendpoint, e.g./api/v3/builds/{build_id}, so I can query the status of a single build.To get the download link: An explicit field in the status endpoint's response (like
short_lived_download_urlmentioned inArtifactSchema) that I can use directly, instead of the oldPOST .../public-urlprocess.Actual results
Actual results
No Build endpoint found: I can't find any
POSTendpoint in thedocument.jsonthat is used to start a new build. The only build-related endpoint isPOST /api/v3/builds/{build_id}/preview, but that is for "App Previews".Specific Build Status Endpoint Not Found: I can't find
GET /api/v3/builds/{build_id}. The closest endpoint isGET /api/v3/dashboards/{uuid}/builds, but it requiresdashboard_uuidand returns a list of all builds, not a specific build.CRITICAL Error: My system now crashes with the error:
This is caused by step 5 in "Steps to reproduce" - the system is trying to POST to an invalid URL because the old v1 API no longer returns artifact data.
My questions are:
What is the correct v3 endpoint to start a new build (equivalent to the old
POST /builds)?What is the best practice in v3 to query the status of a single build? Do I have to call
GET /api/v3/dashboards/{uuid}/buildsand then filter the results myself in my app?Can I confirm that the
short_lived_download_urlfield inArtifactSchemais a replacement for the old.../public-urlendpoint and does not require any additionalPOSTcalls to trigger?Thanks for any help!
Build id (optional)
No response
Beta Was this translation helpful? Give feedback.
All reactions