Register a push device
import requests
url = "https://platform.ankra.app/api/v1/org/notifications/push-devices"
payload = { "device_token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_token: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/push-devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/notifications/push-devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_token": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "ios",
"apns_environment": "<string>",
"device_name": "<string>",
"app_version": "<string>",
"os_version": "<string>",
"token_suffix": "<string>",
"enabled": true,
"disabled_reason": "<string>",
"last_seen_at": "2023-11-07T05:31:56Z",
"last_delivered_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Notifications
Register a push device
Registers (or refreshes) a mobile device token for the caller’s push notifications. The token itself is never returned.
PUT
/
api
/
v1
/
org
/
notifications
/
push-devices
Register a push device
import requests
url = "https://platform.ankra.app/api/v1/org/notifications/push-devices"
payload = { "device_token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_token: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/notifications/push-devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/notifications/push-devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_token": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"platform": "ios",
"apns_environment": "<string>",
"device_name": "<string>",
"app_version": "<string>",
"os_version": "<string>",
"token_suffix": "<string>",
"enabled": true,
"disabled_reason": "<string>",
"last_seen_at": "2023-11-07T05:31:56Z",
"last_delivered_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
The registered device
A mobile device registered for the caller's push notifications.
Available options:
ios, android The end of the device token, enough to tell devices apart.