SDK reference · Python SDK
prov.mandate.approvals.get
prov.mandate.approvals.get in Python SDK.
Signature
prov.mandate.approvals.get(approval_id: str) -> AnyParameters
approval_idstrRequired
Request fields
idstringpathRequired- The object's ID.
Returns
Any The approval.
HTTP operation
GET /v1/mandate/approvals/{id}: Retrieve an approval
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/policies`, {
method: "PUT",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"note": "wires need a person",
"document": {
"rules": [
{
"id": "wire-needs-approval",
"when": [
{
"fact": "action_type",
"op": "eq",
"value": "wire"
}
],
"require": {
"approval": true
}
}
]
}
}),
})).json();
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"action_description": "Wire $12,000 to Acme Corp for PO-7781",
"agent_session_id": "sess_treasury_1",
"device_id": "dev_00000000000000000000000000000001"
}),
})).json();
const intentToken = step2.intent_token;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"intent_token": intentToken,
"action_description": "Wire $12,000 to Acme Corp for PO-7781",
"context": {
"action_type": "wire"
}
}),
})).json();
const approvalId = step3.approval_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approvals/${approvalId}`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.put(f"{api}/v1/mandate/policies", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"note": "wires need a person",
"document": {
"rules": [
{
"id": "wire-needs-approval",
"when": [
{
"fact": "action_type",
"op": "eq",
"value": "wire"
}
],
"require": {
"approval": True
}
}
]
}
}).json()
step2 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"action_description": "Wire $12,000 to Acme Corp for PO-7781",
"agent_session_id": "sess_treasury_1",
"device_id": "dev_00000000000000000000000000000001"
}).json()
intent_token = step2["intent_token"]
step3 = httpx.post(f"{api}/v1/mandate/assessments", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"intent_token": intent_token,
"action_description": "Wire $12,000 to Acme Corp for PO-7781",
"context": {
"action_type": "wire"
}
}).json()
approval_id = step3["approval_id"]
data = httpx.get(f"{api}/v1/mandate/approvals/{approval_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()