List approvals
const url = 'http://127.0.0.1:7700/api/approvals?state=pending&for=me';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://127.0.0.1:7700/api/approvals?state=pending&for=me' \ --header 'Authorization: Bearer <token>'Every approval, or only those in one state. state=pending is the inbox. With for=me on a GurtOS Business box, only the pending approvals the calling person may answer now (an empty list when no person is calling).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only approvals in this state.
me: the Business “waiting for me” list.
Responses
Section titled “Responses”The approvals.
object
<task id>.budget.<action> for the box’s own spend question, <task id>.task.<key> for a question the task asked, <task id>.tool.<call>.ask.<hash> for one a tool asked, <task id>.shadow.<action> for a Business shadow request. The same key asked twice is the same approval. A task can only name keys under task., so it cannot pre-answer the box’s own questions.
The question shown to people.
The spending being asked about
Who gets paid
What the spend or action is for.
Who answered: a paired device’s name, what the box’s own screen sent (such as box screen), jira:<name>, asi1, undo, or task ended. On Business, the person’s name.
Business: the id of the person who answered.
Business: the phone or screen the answer came from. A native app’s auth is kept here as reported.
Business: the id of the person who asked for the task. They may not answer it.
Business: where the policy sent a request, and why.
object
The policy line that matched, such as Over $10,000 goes to the Controller.
Who it goes to as the policy says it: the Controller, IT, any approver.
The amount the rules and limits were checked against
The people who could approve it when it was asked.
object
One sentence for people.
Business shadow mode: the seat this is a suggestion from.
Example
[ { "id": "t3k9x2a1b2.budget.example.spend:9f2c41d07a6be315", "task": "t3k9x2a1b2", "question": "Spend $8.00 to Test Vendor on example.spend (test spend on a GPU hour)? Budget $5.00, spent $0.00.", "costCents": 800, "payee": "Test Vendor", "purpose": "test spend on a GPU hour", "state": "pending" }]