SDK reference · Python SDK
prov.mandate.grants.get_proposal
prov.mandate.grants.get_proposal in Python SDK. A proposal, with the approved structure, the person's edits and the minted children (their tokens to an API key), and approval_context: how the person decided, None while pending.
Signature
prov.mandate.grants.get_proposal(proposal_id: str) -> AnyParameters
proposal_idstrRequired
Request fields
idstringpathRequired- The proposal's ID.
tokenstringquery- The hosted page's link token, in place of a key or session.
Returns
Any The proposal and its edit view.
HTTP operation
GET /v1/mandate/delegation_proposals/{id}: Retrieve a delegation proposal
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({ "name": "Scout Flights", "category": "shopping_agent" }),
})).json();
const flightsId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"device_id": "dev_00000000000000000000000000000001",
"purpose": "Book Maya's Lisbon trip",
"constraints": {
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}),
})).json();
const mandateId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegation_proposals`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"notify": false,
"children": [
{
"agent_id": flightsId,
"purpose": "Book the flights",
"constraints": {
"budget_amount": 900
}
}
]
}),
})).json();
const proposalId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/delegation_proposals/${proposalId}`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"name": "Scout Flights",
"category": "shopping_agent"
}).json()
flights_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"device_id": "dev_00000000000000000000000000000001",
"purpose": "Book Maya's Lisbon trip",
"constraints": {
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}).json()
mandate_id = step2["id"]
step3 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegation_proposals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"notify": False,
"children": [
{
"agent_id": flights_id,
"purpose": "Book the flights",
"constraints": {
"budget_amount": 900
}
}
]
}).json()
proposal_id = step3["id"]
data = httpx.get(f"{api}/v1/mandate/delegation_proposals/{proposal_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()