WARNING: This section is intended for advanced users and "Super users" of PRIM Logix.
The configuration items presented in this section may indeed have an impact on your operations.
If in doubt, consult your system administrator.
Please note that only users in the appropriate security groups can access the software configuration windows. |
The response returned by Web services is a JSON, generally in the following format:
{
"status": "<status>",
"data": "<returned data>"
}
Here is what each item returned corresponds:
string
Indicates the status of the request
Possible values: success or error
json
Returns the data of the request
If there is no value for the request, the Web service will return the following JSON:
{
"status" : "success",
"data": null
}
The form the response will take depends on which version of the API you're using:
The server will always respond with either an HTTP Status Code "200" or "500", and you'll have to rely on the status and message properties of the response body to identify genuine errors.
Very important This version is marked as deprecated. It is preferable to use V2 for all new developments or updates to existing integrations.
The server will respond with HTTP Status Code "200" only if no error has occurred. If necessary, an appropriate Status Code will be used depending on the nature of the error.
If you don't use application/json in the Content Type header, you'll get the following response:
HTTP Status Code: 422
{
"message": "The given data was invalid.",
"errors": {
"actionParameters": [
"Action parameters are required"
]
}
}
HTTP Status Code: 500
{
"status": "error",
"data": null,
"message": "Les paramètres passés à la procédure sont incomplets."
}
If you don't use application/json in the Accept header, you'll get the following response:
HTTP Status Code: 406 Since this header is missing, the server responds with the complete error page (HTML)
HTTP Status Code: 200
{
"status": "error",
"message": "Wrong content type in Accept header
}
If identification fields are missing from the header, you'll get the following response:
HTTP Status Code: 403
{
"status": "error",
"message": "Authentication parameters missing or malformed."
}
HTTP Status Code: 200
{
"status": "error",
"message": "Authentication parameters missing or malformed."
}
If you call a web service and the login information is incorrect, or if you haven't enabled access rights to a web service in PRIM, you'll get the following response:
Example with the web service newJobCount:
HTTP Status Code: 500
{
"status": "error",
"data": null,
"message": "Acces denied::newJobCount:<My username>:<Web service ID>:<Web service name>:<My IP address>:<My key>:[{\"ParamName\":\"JobType\",\"ParamValue\":\"B\"},{\"ParamName\":\"JobFilled\",\"ParamValue\":\"N\"}]"
}
If you call a web service (action) that does not exist, you will receive the following response:
HTTP Status Code: 500
{
"status": "error",
"data": null,
"message": "Web service call. Wrong action call: <name of web service>"
}
If an error occurs in the names of the JSON fields passed by the request, or if you pass a field that doesn't exist for a web service, you'll get the following response:
HTTP Status Code: 500
{
"status": "error",
"data": null,
"message": "Les paramètres passés à la procédure sont incomplets."
}
If the JSON sent to the web service is malformed, you'll get the following response:
HTTP Status Code: 422
{
"message": "The given data was invalid.",
"errors": {
"actionParameters": [
"Action parameters are required"
]
}
}
HTTP Status Code: 500
{
"status": "error",
"data": null,
"message": "Les paramètres passés à la procédure sont incomplets."
}