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) -> Any

Parameters

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();

Was this page helpful? Send us feedback

LLM? Read llms.txt.