Approve a handoff and issue its receipt
curl --request POST \
--url https://api.example.com/v1/handoffs/{handoffId}/approve \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/handoffs/{handoffId}/approve"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/handoffs/{handoffId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/handoffs/{handoffId}/approve"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"approvedAt": "2023-11-07T05:31:56Z",
"handoff": {
"createdAt": "2023-11-07T05:31:56Z",
"evidence": [
{
"label": "STR operation abc",
"path": "/str/operations/abc"
}
],
"id": "<string>",
"note": "<string>",
"owner": {
"sub": "<string>",
"owner": "<string>"
},
"status": "draft",
"updatedAt": "2023-11-07T05:31:56Z",
"approvedBy": {
"sub": "<string>",
"owner": "<string>"
},
"receiptId": "<string>",
"submittedBy": {
"sub": "<string>",
"owner": "<string>"
}
},
"receiptId": "<string>"
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Approve a handoff and issue its receipt
Requires a normal-user principal: an application token is refused with 403, and any other token type is refused with 401 at the gate. The approver must differ from both draft owner and submitter. The approval event id is the immutable receipt id.
POST
/
v1
/
handoffs
/
{handoffId}
/
approve
Approve a handoff and issue its receipt
curl --request POST \
--url https://api.example.com/v1/handoffs/{handoffId}/approve \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/handoffs/{handoffId}/approve"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/handoffs/{handoffId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/handoffs/{handoffId}/approve"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"approvedAt": "2023-11-07T05:31:56Z",
"handoff": {
"createdAt": "2023-11-07T05:31:56Z",
"evidence": [
{
"label": "STR operation abc",
"path": "/str/operations/abc"
}
],
"id": "<string>",
"note": "<string>",
"owner": {
"sub": "<string>",
"owner": "<string>"
},
"status": "draft",
"updatedAt": "2023-11-07T05:31:56Z",
"approvedBy": {
"sub": "<string>",
"owner": "<string>"
},
"receiptId": "<string>",
"submittedBy": {
"sub": "<string>",
"owner": "<string>"
}
},
"receiptId": "<string>"
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Esta página foi útil?

