About ListUserApprovals
This returns a Bill or VendCredit list that the specified user is assigned to review and approve/deny.
Note: A user with permission to pay unapproved Bills can directly pay the Bill, regardless of the Bill's Approval Status.
Example
Request
<API_URL_EndPoint>/ListUserApprovals.json
data={
"usersId" : "00601TUPMWVLJHJUR1mg",
"entity" : "Bill",
"approvalType" : "0",
"marker" : "",
"max" : 999,
"nested" : true,
"sort" : [ {
"field" : "dueDate",
"asc" : "true"
}, {
"field" : "id",
"asc" : "true"
} ],
"filters" : [ {
"field" : "createdTime",
"op" : "<",
"value" : "2016-11-25T00:21:45.795+0000"
}, {
"field" : "dueDate",
"op" : "<",
"value" : "2016-11-25"
} ]
}
Response
{
"response_status" : 0,
"response_message" : "Success",
"response_data" : {
"marker" : "00n01XRYOPLHPLIyjc61|1478021015000",
"approvals" : [ {
"entity" : "Bill",
"id" : "00n01XRYOPLHPLIyjc61",
"isActive" : "1",
"vendorId" : "00901OURXFJIDTB7cvc8",
"invoiceNumber" : "11-15-2016",
"approvalStatus" : "0",
"invoiceDate" : "2016-11-01",
"dueDate" : "2016-11-14",
"glPostingDate" : "2016-11-01",
"amount" : 80.33,
"scheduledAmount" : 0.00,
"paidAmount" : 0.00,
"dueAmount" : 80.33,
"paymentStatus" : "1",
"description" : null,
"poNumber" : null,
"createdTime" : "2016-11-01T17:23:35.000+0000",
"updatedTime" : "2016-11-28T17:53:01.000+0000",
"payFromBankAccountId" : "00000000000000000000",
"payFromChartOfAccountId" : "00000000000000000000",
"related" : {
"vendorId" : {
"name" : "PG&E"
}
},
"billLineItems" : [ {
"entity" : "BillLineItem",
"id" : "bli01CXDRMYVXA1ntdiq",
"billId" : "00n01XRYOPLHPLIyjc61",
"amount" : 80.33,
"chartOfAccountId" : "0ca01SYVMUSPEHN74dbb",
"departmentId" : "00000000000000000000",
"locationId" : "00000000000000000000",
"jobId" : "00000000000000000000",
"customerId" : "00000000000000000000",
"jobBillable" : false,
"description" : null,
"createdTime" : "2016-11-01T17:23:35.000+0000",
"updatedTime" : "2016-11-28T17:53:01.000+0000",
"lineType" : "1",
"itemId" : "00000000000000000000",
"quantity" : null,
"unitPrice" : null,
"employeeId" : "00000000000000000000",
"actgClassId" : "00000000000000000000",
"related" : {
}
} ]
} ]
}
}
Parameters
Field Name | Description | Required? |
---|---|---|
userId | The system generated ID of the user who is the approver. | Yes |
entity | The entity type of the object to retrieve approvals (Bill, VendCredit). | Yes |
approvalType | The type of the approvals to retrieve. [0: NotYetApproved - Not yet approved] [1: Approved] [2: Denied] [3: Coming] |
Yes |
marker | A unique value returned in the response of the previous call or null if this is the first call to this API to retrieve the first set of objects. | Yes |
max | Maximum number of objects to retrieve. The limit is 999. | Yes |
nested | Include nested related data, i.e. billLineItems in a Bill. | No |
sort | Sort based on a specific field. | No |
filters | Filter based on a specific field. | No |
related | Get information of related objects. | No |
Pagination
Use "marker" and "max" is for pagination. The max number of records returned for each query is 999.
On the first return of 999 records, to ask for next "page", set "marker" : 999, "max" : 999. Repeat as needed.
Generally, smaller batches are more easily managed. For example, retrieve "start": 0, "max": 100, then "start": 100, "max": 100.
Sorting
Any field can be used as the sort field.
- To sort ascending, pass the field name and "asc": 1
- To sort descending, pass the field name and "asc": 0
Filter
To narrow results, you can filter by one or more expressions. If more than one expression is specified, the result includes objects that match all the expressions. Each filter is composed of three elements: field, operator, and value.
You can filter on any field within an object, with one of these date types:
- ID (Nested object's IDs are not filtered)
- Enum
- Date format (yyyy-mm-dd)
- DateTime formats (createdTime, updatedTime) are
YYYY-MM-DDThh:mm:ssZ
. (UTC time zone). - Name (only = operation supported, can filter by exact match). Available for most objects (vendor, customer, department, etc) and it is case insensitive.
Filter can use the following operators:
Operator | Operation |
---|---|
= | equals |
< (<) | less than |
> (>) | greater than |
!= | not equal to |
<= | less than or equal to |
>= | greater than or equal to |
in | value is in enum list (only for enum fields, like status) |
nin | value is not in enum list (only for enum fields, like status) |
Resources