SDK reference · Node SDK
prov.mandate.intents.get
prov.mandate.intents.get in Node SDK. The issuer's view of one token: revoked, with the scope and reason.
Signature
prov.mandate.intents.get(jti: string): Promise<IntentStatus>Parameters
jtistringRequired
Request fields
idstringpathRequired- The intent token's ID.
Returns
Promise<IntentStatus> Whether the token is revoked.
HTTP operation
GET /v1/mandate/intents/{id}: Check a token's revocation status
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_status",
"device_id": "dev_00000000000000000000000000000001"
}),
})).json();
const jti = step1.attestation_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents/${jti}`, {
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_status",
"device_id": "dev_00000000000000000000000000000001"
}).json()
jti = step1["attestation_id"]
data = httpx.get(f"{api}/v1/mandate/intents/{jti}", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}).json()