List approvals
GET
/approvals
const url = 'http://127.0.0.1:7700/api/approvals?state=pending';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' \ --header 'Authorization: Bearer <token>'Every approval, or only those in one state. state=pending is the inbox.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”state
string
Only approvals in this state.
Responses
Section titled “Responses”The approvals.
Media typeapplication/json
Array<object>
object
id
required
<task id>.<key>. The same key asked twice is the same approval.
string
task
required
string
question
required
The question shown to people.
string
costCents
required
The spending being asked about
number
payee
Who gets paid
string
purpose
What the spend or action is for.
string
state
required
string
by
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.
string
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" }]GurtOS is open source under the Apache License 2.0.Source code on GitHub.