This section provides important information about the common structure of each endpoint response that you will get by invoking Fabrick Platform APIs.
Please remember that in the technical documentation of each endpoint you will find only the specific information related to the structure of the response payload element; the general response structure is implicitly assumed as documented in this section.
The reference to the response structure distinguishes among the API version to document each version response structure: please be sure to refer to the correct version number.
API Version 4.0
General Response Structure
{ "status": "", "errors": [], "payload": {} }The
status
field contains one of the following status codes:
OK
If the response contains payload.KO
If the response contains one or more errors.PENDING
If the response requires further interaction.
errors
array may contain info related to error handling (see below for details).The
payload
object typically contains the response data.{ "status": "", "errors": [], "payload": { "list": [...], "pagination": {The
"pageCount": 50,
"resultCount": 495,
"offset": 0,
"limit": 10
},
"segmentation": {
"segmentLength": 200,
"segmentId": "263687770H...1",
"nextSegmentId": "263687770H...2"
},
"sorting": {
"fieldName": "key1",
"type": "DESCENDING"
} } }
payload.list
array typically contains one or more result elements.The
payload.pagination
object is optional and contains the following fields:pageCount
The total number of pages, assuming each page contains "limit" number of results.resultCount
The total number of results.offset
The positional index of the first element provided in the response.limit
The number of elements provided in the response.
The payload.segmentation
object is optional and contains the following fields:
segmentLength
The number of elements of the current segment.segmentId
The ID of the current segment.nextSegmentId
The ID of the next response segment to be retrieved. Ifnull
there are no more segments to be retrieved.
payload.sorting
object is optional and contains the following fields:fieldName
The name of the response field to be used as sorting key.type
The type of sorting for the sorting key:ASC
is ascending;DESC
is descending.
"errors": [{ "code" : "", "description": "", "params": "" }]The
code
field contains an error code; please refer to the section Error Handling for further details.The
description
field contains a textual description of the response code.The
params
field is a string optionally containing the name of the input parameter affected by the reported error.API Version 3.0
General Response Structure
{ "status": "", "errors": [], "payload": {} }The
status
field contains one of the following status codes:
OK
If the response contains payload.KO
If the response contains one or more errors.PENDING
If the response requires further interaction.
The
errors
array may contain info related to error handling (see last column of this row).The
payload
object typically contains the response data."errors": [{ "code" : "", "description": "", "params": [] }]The
code
field contains an error code; please refer to the section Error Handling for further details.The
description
field contains a textual description of the response code.The
params
field is an array of strings eventually containing the name(s) of the input parameters affected by the reported errors.API Version 2.1
General Response Structure
{ "status": { "code": "", "description": "" }, "errors": [], "payload": [] }The
status.code
field contains one of the following status codes:
OK
If the response contains payload.KO
If the response contains one or more errors.PENDING
If the response requires further interaction.
status.description
field contains a textual description of the response code.The
errors
array may contain info related to error handling (see last column of this row).The
payload
array typically contains the response data.Not supported
Error Handling
"errors": [{ "code" : "", "description": "", "params": [] }]The
code
field contains an error code; please refer to the section Error Handling for further details.The
description
field contains a textual description of the response code.The
params
field is an array of strings eventually containing the name(s) of the input parameters affected by the reported errors.API Version 2.0
General Response Structure
{ "status": { "code": "", "description": "" }, "errors": [], "payload": [] }The
status.code
field contains one of the following status codes:
OK
If the response contains payload.KO
If the response contains one or more errors.PENDING
If the response requires further interaction.
status.description
field contains a textual description of the response code.The
errors
array may contain info related to error handling (see last column of this row).The
payload
array typically contains the response data.Error Handling
"errors": [{ "code" : "", "description": "", "params": [] }]The
code
field contains an error code; please refer to the section Error Handling for further details.The
description
field contains a textual description of the response code.The
params
field is an array of strings eventually containing the name(s) of the input parameters affected by the reported errors.API Version 1.0
General Response Structure
{The
"status": { "code": "", "description": "" }, "error": {}, "payload": [] }
status.code
field contains one of the following status codes:
OK
If the response contains payload.KO
If the response contains an error.
status.description
field contains a textual description of the response code.The
error
object may contain info related to error handling (see last column of this row).The
payload
array typically contains the response data.Lists, pagination, segmentation & sorting
Not supported
"error": { "description": "" }The
error.description
field contains a textual description of the error.