Add an AI ticket link
import requests
url = "https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links"
payload = {
"target_kind": "<string>",
"target_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_kind: '<string>', target_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_kind": "<string>",
"target_id": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_kind": "<string>",
"target_id": "<string>",
"relation": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "outgoing",
"linked_ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_number": 123,
"title": "<string>",
"status": "<string>",
"resolution": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_kind": "<string>",
"target_id": "<string>",
"relation": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "outgoing",
"linked_ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_number": 123,
"title": "<string>",
"status": "<string>",
"resolution": "<string>"
}
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}AI Tickets
Add an AI ticket link
Links a record to a ticket by target_kind and target_id, with a relation that defaults to relates_to, and answers 201 with the link it created (200 with the existing link when it was already there). A ticket target is the ticket’s id or its number (T-42), must be another ticket of the organisation, and is stored by id: the ticket itself answers 400, an unknown ticket or one of another organisation 404. A session cannot be linked as spawned or evidence: the platform records those relations itself.
POST
/
api
/
v1
/
org
/
ai-tickets
/
{ticket_id}
/
links
Add an AI ticket link
import requests
url = "https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links"
payload = {
"target_kind": "<string>",
"target_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_kind: '<string>', target_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/ai-tickets/{ticket_id}/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_kind": "<string>",
"target_id": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_kind": "<string>",
"target_id": "<string>",
"relation": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "outgoing",
"linked_ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_number": 123,
"title": "<string>",
"status": "<string>",
"resolution": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_kind": "<string>",
"target_id": "<string>",
"relation": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "outgoing",
"linked_ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ticket_number": 123,
"title": "<string>",
"status": "<string>",
"resolution": "<string>"
}
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
The link already existed; nothing was written