Accept a handoff
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"handoff_id": "<string>",
"status": "created",
"expected_by": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"package": {
"context": {
"text": "<string>",
"etag": "<string>",
"policy_version": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"from_agent": "<string>",
"handoff_id": "<string>",
"level": "V0",
"target": "<string>",
"commitments_active": [
{
"id": "<string>",
"type": "<string>",
"valid_until": "2023-11-07T05:31:56Z"
}
],
"effects": [
{
"effect_id": "<string>",
"kind": "delivery",
"state": "reserved"
}
],
"open_objects": [
{
"ref": {
"id": "<string>",
"namespace": "<string>",
"type": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"state": "<string>"
}
],
"outcome": {
"expected_by": "2023-11-07T05:31:56Z",
"vocabulary": [
"<string>"
]
},
"owner": {
"epoch": 123,
"holder": "<string>",
"kind": "owner",
"level": "<string>",
"since": "2023-11-07T05:31:56Z",
"source": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"via": "declaration"
},
"promises_open": [
{
"id": "<string>",
"owner": "<string>",
"due": "2023-11-07T05:31:56Z"
}
],
"reason": "<string>",
"spec": "handoff-package.v0",
"subject": {
"type": "phone_e164",
"value": "<string>",
"scope": "<string>",
"subject_kind": "person"
},
"suppressions": [
"<string>"
]
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Coordination
Accept a handoff
The receiving side accepts; a closed or expired handoff answers 409.
POST
/
v1
/
handoffs
/
{handoff_id}
/
accept
Accept a handoff
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"handoff_id": "<string>",
"status": "created",
"expected_by": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"package": {
"context": {
"text": "<string>",
"etag": "<string>",
"policy_version": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"from_agent": "<string>",
"handoff_id": "<string>",
"level": "V0",
"target": "<string>",
"commitments_active": [
{
"id": "<string>",
"type": "<string>",
"valid_until": "2023-11-07T05:31:56Z"
}
],
"effects": [
{
"effect_id": "<string>",
"kind": "delivery",
"state": "reserved"
}
],
"open_objects": [
{
"ref": {
"id": "<string>",
"namespace": "<string>",
"type": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"state": "<string>"
}
],
"outcome": {
"expected_by": "2023-11-07T05:31:56Z",
"vocabulary": [
"<string>"
]
},
"owner": {
"epoch": 123,
"holder": "<string>",
"kind": "owner",
"level": "<string>",
"since": "2023-11-07T05:31:56Z",
"source": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"via": "declaration"
},
"promises_open": [
{
"id": "<string>",
"owner": "<string>",
"due": "2023-11-07T05:31:56Z"
}
],
"reason": "<string>",
"spec": "handoff-package.v0",
"subject": {
"type": "phone_e164",
"value": "<string>",
"scope": "<string>",
"subject_kind": "person"
},
"suppressions": [
"<string>"
]
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
nia_sk_...
Headers
Required. Kept 24 hours with the hash of the body: a retry with the same key returns the first answer, and the same key with a different body returns 409 conflict.
Required string length:
1 - 256Path Parameters
Response
The handoff, accepted.
Required string length:
1 - 512Available options:
created, accepted, closed, expired Required string length:
1 - 256What a handoff carries to whoever receives it (the coordination spec, 7).
Show child attributes
Show child attributes

