Codemagic API - GET /builds -> workflowId always null #1941
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduceI have several workflows in my company. Every workflow represents an individualized variant of the app. Sometimes, I want to start the workflow for let's say only 6 variants. I don't want to start the same process 6 times via the Codemagic UI. Also I might want to set individual release notes for every build. Because this is not possible via Codemagic UI, I wanted to start developing my own custom client that triggers the builds via API. For this, I need a list of available workflows. According to the docs, the list of workflows is part of the However, whenever I send the specified request to the API, my response is missing the field Reproduction: Like it's described in the docs, send a request to https://api.codemagic.io/builds with your personal API token in the header: curl -H "Content-Type: application/json" \
-H "x-auth-token: <API Token>" \
--request GET "https://api.codemagic.io/builds" Expected resultsThe response contains a body like this: {
…
"workflowId": "something-useful,
…
} Actual resultsThe response contains a body like this: {
"_id": "…",
"index": 8,
"appId": "…",
"status": "canceled",
"version": null,
"branch": "master",
"startedAt": null,
"startedBy": "Gitlab webhook",
"createdAt": "2023-07-05T09:03:31.657000+00:00",
"finishedAt": "2023-07-05T09:03:42.093000+00:00",
"workflowId": null,
"fileWorkflowId": "this-is-set",
"instanceType": "mac_mini_m1",
"commit": {
"authorAvatarUrl": "…",
"authorEmail": "…",
"authorName": "…",
"branch": null,
"tag": "2.2.0+111",
"commitMessage": "…",
"hash": "…",
"url": "…"
},
"config": {
"name": "…",
"buildSettings": {
"flutterVersion": "stable",
"platforms": [],
"url": null,
"xcodeVersion": "14.3.1",
"workingDirectory": null
}
},
"dynamicConfig": {},
"artefacts": [],
"buildActions": [
…
],
"message": null,
"feedback": null,
"screenshots": null,
"pullRequest": null,
"tag": "2.2.0+111",
"sshAccessEnabled": false,
"sshAccess": null,
"vncAccess": null,
"scheduledBuildId": null,
"appStoreConnectTasks": [],
"labels": []
} Build id (optional)64a531e34cff37cffb483b7a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @gerken-tss The reason you are not able to retrieve the workflowId-s are the workflow names declared inside your YAML, which the API does not read. It is possible to get the ID-s when using WFE, but as for YAML, you have to find an alternative way. Maybe read your YAML locally and get the workflow id-s from there. The workflow id-s are the workflow names, e.g
|
Beta Was this translation helpful? Give feedback.
Hello @gerken-tss
The reason you are not able to retrieve the workflowId-s are the workflow names declared inside your YAML, which the API does not read. It is possible to get the ID-s when using WFE, but as for YAML, you have to find an alternative way. Maybe read your YAML locally and get the workflow id-s from there. The workflow id-s are the workflow names, e.g
ios-workflow
andtest-workflow2
in this example: