SDK reference · Python SDK
prov.mandate.network.get_grant_request
prov.mandate.network.get_grant_request in Python SDK.
Signature
prov.mandate.network.get_grant_request(request_id: str) -> AnyParameters
request_idstrRequired
Request fields
idstringpathRequired- The request's ID (
nmr_…).
Returns
Any The request.
HTTP operation
GET /v1/mandate/grant_requests/{id}: Get a network mandate request
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": "cartwise", "category": "shopping_agent" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/agents/${agentId}/signing_keys`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"jwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "G_STrQBvTD7Bi8OjlNnLcKPPiPp03Vh0sJKTMG7QzFY"
}
}),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grant_requests`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"agent_id": agentId,
"proposed": {
"max_amount": 50,
"currency": "USD",
"expires_at": "2027-06-30T00:00:00Z"
}
}),
})).json();
const requestId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grant_requests/${requestId}`, {
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": "cartwise",
"category": "shopping_agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/identify/agents/{agent_id}/signing_keys", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"jwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "G_STrQBvTD7Bi8OjlNnLcKPPiPp03Vh0sJKTMG7QzFY"
}
}).json()
step3 = httpx.post(f"{api}/v1/mandate/grant_requests", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"agent_id": agent_id,
"proposed": {
"max_amount": 50,
"currency": "USD",
"expires_at": "2027-06-30T00:00:00Z"
}
}).json()
request_id = step3["id"]
data = httpx.get(f"{api}/v1/mandate/grant_requests/{request_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()