import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id}"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id} \
--cookie ankra_session={
"id": "<string>",
"component": "<string>",
"head_sha": "<string>",
"ref": "<string>",
"reason": "<string>",
"recipe": "<string>",
"status": "<string>",
"image_ref": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>",
"created_at": "<string>"
}{
"detail": "<string>"
}Read a platform build (browser session)
One platform build: its recipe, the image it pushed, or the error class that routes its failure. Answers 404 for every organisation without the platform_builds flag.
import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id}"
headers = {"cookie": "ankra_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.platform.ankra.app/org/applications/{application_id}/builds/{build_id} \
--cookie ankra_session={
"id": "<string>",
"component": "<string>",
"head_sha": "<string>",
"ref": "<string>",
"reason": "<string>",
"recipe": "<string>",
"status": "<string>",
"image_ref": "<string>",
"error_class": "<string>",
"error_message": "<string>",
"started_at": "<string>",
"finished_at": "<string>",
"created_at": "<string>"
}{
"detail": "<string>"
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Response
Successful Response
How the builder turned source into image (dockerfile, generated, buildpacks); null until resolved.
pending, running, succeeded or failed.
The image a succeeded build pushed.
Routes a failure: build_failed is the user's code; clone_auth, recipe_missing, push_failed, timeout, capacity and build_unknown are the platform's. capacity means no builder could take the build; build_unknown means a builder ran it and it failed in a way Ankra could not classify, and the error_message then carries the end of the build's own output.