Registrar o desfecho de uma transferência
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"outcome": "<string>",
"detail": {}
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome"
payload = {
"outcome": "<string>",
"detail": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({outcome: '<string>', detail: {}})
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome', 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}/outcome",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => '<string>',
'detail' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome"
payload := strings.NewReader("{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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}/outcome")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}"
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"
}Coordenação
Registrar o desfecho de uma transferência
O desfecho, no vocabulário do espaço: encerra a retenção e alimenta a memória e as supressões que o espaço mapeia.
POST
/
v1
/
handoffs
/
{handoff_id}
/
outcome
Registrar o desfecho de uma transferência
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"outcome": "<string>",
"detail": {}
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome"
payload = {
"outcome": "<string>",
"detail": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({outcome: '<string>', detail: {}})
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome', 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}/outcome",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => '<string>',
'detail' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome"
payload := strings.NewReader("{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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}/outcome")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs/{handoff_id}/outcome")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"<string>\",\n \"detail\": {}\n}"
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"
}Autorizações
nia_sk_...
Cabeçalhos
Fica guardada 24 horas com o hash do corpo; a mesma chave com outro corpo devolve 409.
Required string length:
1 - 256Parâmetros de caminho
Resposta
A transferência encerrada.
Required string length:
1 - 512Opções disponíveis:
created, accepted, closed, expired Required string length:
1 - 256O que uma transferência leva a quem a recebe (a especificação de coordenação, 7).
Show child attributes
Show child attributes

