Get the Ankra Cloud account of a credential
import requests
url = "https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account \
--header 'Authorization: Bearer <token>'{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"id": "<string>",
"name": "<string>",
"organisation": {
"id": "<string>",
"name": "<string>"
}
},
"account_error": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Credentials
Get the Ankra Cloud account of a credential
For an Ankra Cloud credential, names the Ankra Cloud account its stored API token acts in and the Ankra organisation that account is linked to, read live from Ankra Cloud with that token, or says why it could not be read. Never returns the token. Any other credential answers 404. Requires credentials.read, not credentials.reveal.
GET
/
api
/
v1
/
org
/
credentials
/
{credential_id}
/
ankra-cloud-account
Get the Ankra Cloud account of a credential
import requests
url = "https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/credentials/{credential_id}/ankra-cloud-account \
--header 'Authorization: Bearer <token>'{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"id": "<string>",
"name": "<string>",
"organisation": {
"id": "<string>",
"name": "<string>"
}
},
"account_error": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Response
The account, or why it could not be read
The Ankra Cloud account an Ankra Cloud credential is connected to. Exactly one of account and account_error is set: account_error means the account is unknown, not that the credential has none.