Priotice REST API
Priotice REST API provides programmatic access to read and write the Priotice data. Organization data, prioritization process and all its components can be read, modified or deleted using the REST API.
Process
- Create a new prioritization POST create prioritization
- List criteria and sub-criteria. POST create criteria
- List alternatives. POST create alternative
- List groups. POST create group
- List users to groups. POST create user
- Invite participants. POST invite participants
- Check collect data status. GET prioritization collect status
- Stop collection and save data. POST save collected data
- Analyze GET prioritization analysis or get final prioritization result. GET final prioritization result
Overview
- Authentication - your application will authenticate each request by sending an auth code. Connection to our API is stateless, no cookies are being used, therefore a valid auth code must be sent along with each request.
- Requests - you can make GET and POST requests. When making a GET request (list or delete data) all data is being sent as part of the request string. When making a POST request (create or update data) your application will send both a query string and the POST data.
- Response - our API will return a JSON formatted response. Response will always return the status which can be "error" or "success" and, when data was requested (GET), it will return "Data", an array containg the requested data.
Requests and parameters
The request URL is comprised of:
- The absolute URL of our API -
https://api.priotice.se/rest/
- always required. - The auth code -
{auth}
- always required.
You can find the API auth code after you login to your Priotice account, on the Dashboard page, under the Summary tab. - The resource that is being addressed - that can be
/organization
,/prioritization
,/criteria
,/alternative
,/group
,/user
- always required. - The action performed on the specified resource:
/list
,/create
,/delete
,/update
,/collect
,/analyze
- always required. - The identifier of a particular resource -
/{identifier}
- that is an integer value, that represents the identifier of a prioritization, criteria, alternative, group and so on - sometimes required.
Errors
While executing a request if anything goes wrong, an "error" status is being returned, along with an error code and an error message.
No data is being returned on errors.
Data is being returned only on the "success" status which indicates that the request has been executed as expected.
Errors that can be returned are defined as:
Error code | Error message |
---|---|
101 | No authentication code |
102 | Bad authentication code |
103 | Database error |
104 | Resource not requested |
105 | Resource inexistent |
106 | No action |
107 | Undefined action |
108 | Resource not found |
109 | No POST parameters |
110 | Required POST parameter missing |
111 | Forbidden |
112 | Invalid POST parameter |
113 | POST parameter duplicates existing values |
114 | Resource identifier required |
115 | No data |