Get started by requesting an access token from Quantivate Support (support@quantivate.com). We will email you a temporary (48 hour) link to retrieve your permanent JSON Web Token (JWT). The permanent JWT you get will need to be included in all of your requests, either within an Authorization header, or as a query parameter named “jwt”. It is recommended that you use the “Authorization: Bearer” header option:
Authorization: Bearer <token>
Each request will return X-RateLimit headers showing the Limit, Remaining Calls, and the time at which the Remaining Calls will reset to the Limit (Reset).
There are three rate limit categories enforced on each request to the Quantivate API (IP, Token, and License):
The following are example response headers for each category:
When an application exceeds any of the rate limits, the API will return a HTTP 429 “Too Many Requests” response code, and the following errors will be returned in the response body:
{"error":{"message":"Too many requests for this IP","code":429}} {"error":{"message":"Too many requests for this JWT","code":429}} {"error":{"message":"Licensed API calls for the month used up","code":429}}
To make an API call, you will need to supply a valid JWT (for authorization) and a JSON-RPC. The JSON-RPC must include at least these two properties: “method” and “params”.
For any method that requires resourceTypeName as a parameter, that resource type MUST have an attribute that is set to unique, default, and required in the Quantivate platform.
See the following examples for a basic API call. For other methods, you will replace the “method” and “params” properties with the desired method name and respective parameters.
https://api.quantivate.com/
?jwt=<token>&rpc=
{"method":"getResource","params":{"resourceTypeName":"Vendor","resourceName":"AAA"}}
curl --request GET \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-binary "{
\"method\": \"getResource\",
\"params\":
{
\"resourceTypeName\": \"Vendor\",
\"resourceName\": \"AAA\"
}
}" \
'https://api.quantivate.com'
Example Error Response:
{
"error":
{
"message": "No resource of type 'Vendor' exists or resource is in trash bin with name: 'AAA'",
"code": 5
}
}
Each method accepts parameters that are required. Below is a list of all possible parameter types that can be placed in the JSON object nested under the “params” property. A given parameter may be used by more than one method. See section titled “Methods” for a list of parameters required for each specific JSON-RPC method.
Parameter | Description | Errors |
---|---|---|
resourceTypeName | Name of a resource type |
|
resourceName | Name of a resource for a resource type; this must be unique across the resource type |
|
attributes | Key value pairs of attribute names in a resource type and accepted data for the attribute type (see table below) |
|
reportName | Unique name of report |
|
groupName | Unique name of group |
|
employeeName | Unique name of employee formatted like “Last Name, First Name” as it appears in Quantivate |
|
role | A valid group role; either “Group Viewer” or “Group Modifier” |
|
upstreamResourceTypeName | Name of a resource type |
|
upstreamResourceName | Name of a resource for a resource type; this must be unique across the resource type |
|
downstreamResourceTypeName | Name of a resource type |
|
downstreamResourceName | Name of a resource for a resource type; this must be unique across the resource type |
|
tableName | Name of a table attribute within the resource type |
|
tableAttributes | Key value pairs of attribute names in the table and accepted data for the attribute type (see table below) |
|
Key value pairs of attribute names in a resource type and accepted data for the attribute type:
Attribute Type | Accepts |
---|---|
Date | Must be a date formatted as “MM/DD/YYYY” |
Employee | Unique name of employee formatted like “Last Name, First Name” as it appears in Quantivate |
Select | Must be the text of the select option as set in Quantivate |
Select Multiple | Must be the text of the select options as set in Quantivate, in a JSON array. E.g.: [“Yes”,”No”,”Maybe”] |
Checkbox | For non-customized checkboxes, either “on” or blank. For customized checkboxes, either the value for checked or unchecked as set in Quantivate |
Number | Value must be numeric |
Currency | Value must be numeric, or formatted like “1,000.00”. It must also be between these values (-9999999999999.99 and 9999999999999.99) |
The following section includes a description and other details on the various methods that can be called using the Quantivate API to interact with your data.
Use this method to retrieve attribute values for a given resource
{
"method": "getResource",
"params":
{
"resourceTypeName": "Vendor",
"resourceName": "Quantivate"
}
}
JSON object with resource information or failure message.
Success:
{
"result":
{
"Vendor Name": "Quantivate",
"Zip": "98072",
"State": "WA",
...
}
}
Example Error:
{
"error":
{
"message": "No resource of type 'Vendor' exists or resource is in trash bin with name: 'AAA'",
"code": "7"
}
}
Use this method to create a resource with the given attributes. The name of the resource will be set to the value provided for the attribute that is set to default in the Quantivate platform
Request Body:
{
"method": "addResource",
"params":
{
"resourceTypeName": "Vendor",
"attributes": {
"Vendor Name": "Dunk n Donuts",
"State": "WA",
"Zip Code": 98072,
"Associated Employee": "Smith, John A"
}
}
}
Use this method to update a resource and its attributes.
{
"method":"updateResource",
"params": {
"resourceTypeName":"Vendor",
"resourceName":"AAA Washington",
"attributes": {
"Vendor Name": "Donuts",
"State":"WA",
"Zip Code":98072
}
}
}
Use this method to put a resource into the trash bin
Request Body:
{
"method": "trashResource",
"params": {
"resourceName": "Quantivate",
"resourceTypeName": "Vendor"
}
}
Response:
{
"result": "Success"
}
Use this method to retrieve data from a resource report in Quantivate
Request Body:
{
"method": "runResourceReport",
"params": {
"reportName": "All Vendors"
}
}
Response:
{
"columns": ["Vendor Name", "Vendor Description",...],
"data": [
["Quantivate", "The best vendor ever",...],
["Dunk'n Donuts", "The second best vendor",...],
...
]
}
Gives ownership of a resource to the given group
Parameters:
Request Body:
{
"method": "addGroupOwnership",
"params":
{
"groupName": "Accounts Payable",
"resourceTypeName": "Vendor",
"resourceName": "Quantivate"
}
}
Response:
{
"result": "Success"
}
Revokes ownership of a resource from a group
Request Body:
{
"method": "removeGroupOwnership",
"params":
{
"groupName": "Accounts Payable",
"resourceTypeName": "Vendor",
"resourceName": "Quantivate"
}
}
Response:
{
"result": "Success"
}
Assigns an employee to a group with the given role
Request Body:
{
"method": "setGroupMembership",
"params":
{
"groupName": "Accounts Payable",
"employeeName": "Smith, John A",
"role": "Group Viewer"
}
}
Response:
{
"result": "Success"
}
Revokes membership into a group from the given employee
Request Body:
{
"method": "removeGroupMembership",
"params":
{
"groupName": "Accounts Payable",
"employeeName": "Smith, John A",
}
}
Response:
{
"result": "Success"
}
Links an upstream (dependency) resource to a downstream (customer) resource
Request Body:
{
"method": "linkResources",
"params":
{
"upstreamResourceTypeName": "Vendor",
"upstreamResourceName": "Quantivate",
"downstreamResourceTypeName": "Vendor",
"downstreamResourceName": "15 Year Contract"
}
}
Response:
{
"result": "Success"
}
Adds a row to a table in the given resource
Request Body:
{
"method": "addTableRow",
"params": {
"resourceTypeName": "Vendor",
"resourceName": "Quantivate",
"tableName": "Spend items",
"tableAttributes": {
"Recipient": "Donuts R Us",
"Date": "12/31/1999",
"Amount": "98,072.00",
"Purchaser": "Smith, John A"
}
}
}
Response:
{
"result": "Success"
}
The table below provides a list of general errors or exceptions that can be returned by the API.
Error | Description | Code |
---|---|---|
Invalid Method | An unsupported method was given in the JSON-RPC | 1 |
Missing Request Parameter | Missing either the “method” or “params” object in the JSON-RPC | 2 |
Invalid Parameter Value | An invalid parameter was found in the JSON-RPC | 3 |
Missing Method Parameter | A method call was attempted missing a required parameter | 4 |
Unknown Resource Type | An unknown “resourceTypeName” parameter was provided | 5 |
No Unique Default For Resource Type | A resource type is not configured to work with the API (needs a required, unique, default attribute) | 6 |
Unknown Resource | The provided resource name cannot be found in the resource type | 7 |
Duplicate Resource Name | A name provided for the “resourceName” parameter is not unique in the system | 8 |
Invalid Employee | An unknown employee name was provided | 9 |
Duplicate Employee Name | A name provided for an “employee” type attribute, or in the “employeeName” parameter is not unique in the system | 10 |
Missing Required Attribute | An “attributes” parameter is missing a required attribute for the resource type | 11 |
Invalid Attribute Value | An invalid attribute value was provided | 12 |
Malformed Attributes Parameter | An invalid “attributes” parameter was provided | 13 |
Unsupported Attribute Type | An attribute was provided that is not supported | 14 |
Attribute Does Not Exist | An attribute name provided in “attributes” does not exist | 15 |
Invalid Date | Invalidly formatted date was provided | 16 |
Non Numeric Number | A non numeric value was provided for a numeric attribute type | 17 |
Conflicting Unique Value | A table value provided in “attributes” must be unique across the resource type | 18 |
Invalid Checkbox Option | An invalid checkbox value was provided | 19 |
Invalid Select Option | An invalid option was provided for a select attribute type | 20 |
Invalid Select Multiple Option | An invalid option was provided for a select multiple attribute type | 21 |
Invalid Url | An invalid URL was provided for a hyperlink attribute type | 22 |
Erroneous Attribute | A unsupported attribute was provided | 23 |
Table Does Not Exist | An invalid “tableName” parameter was provided | 24 |
Conflicting Unique Table Value | A table value provided in “tableAttributes” must be unique across the table | 25 |
Table Column Does Not Exist | An invalid table column was provided in the “tableAttributes” parameter | 26 |
Invalid Group Role | An invalid group role was provided | 27 |
Unknown Group | An invalid “groupName” parameter was provided | 28 |
Duplicate Group Name | A name provided for the “groupName” parameter is not unique in the system | 29 |
Empty Report Name | You must supply a name for the report to run | 30 |
Unknown Report Name | No report exists with name: ” OR this report is not of type ‘resource’ OR it’s in the trash bin | 31 |
Two Reports One Name | More than one report exists with name: | 32 |
Unsupported Report Type | An unsupported report type was requested | 33 |
Unsupported Report Display Type | An unsupported report display type was requested | 34 |
Invalid Currency | An invalid currency value was provided | 35 |
Unexpected Exception | An unexpected error has occurred | 99 |
Connect With Us