(Quick Reference) Service: List

Description: This web service return the list of customers categories in JSON format

URL:

https://BASE_URL/api/VERSION/customerCategories

Method: GET

Parameters:

Pagination parameters:

NameDescriptionTypeRequiredPossible values
offsetTells where to start returning records from the entire set of resultsIntegerNo 
maxlimits the number of resources requested to returnIntegerNo 
sortOrders the results by the specified fieldStringNo 
orderOrders ascending (ASC) or descending DESCIntegerNoasc, desc

Filters parameters:

NameDescriptionTypeRequiredExample values
dateCreated_gtFilters by the resource's creation date time and operator greater thanDateno2016-08-15T14:52:48Z
dateCreated_gteFilters by the resource's creation date time and operator greater than or equalDateno 
dateCreated_ltFilters by the resource's creation date time and operator less thanDateno 
dateCreated_lteFilters by the resource's creation date time and operator less than or equalDateno 
lastUpdated_gtFilters by the resource's last-modified date time and operator greater thanDateno 
lastUpdated_gteFilters by the resource's last-modified date time and operator greater than or equalDateno 
lastUpdated_ltFilters by the resource's last-modified date time and operator less thanDateno 
lastUpdated_lteFilters by the resource's last-modified date time and operator less than or equalDateno 
referenceWildcard search by the resource's referenceStringnoreference=Ref-6* , reference=*ef-6 , reference=*ef-6*
nameWildcard search by the resource's nameStringno 

Success Output

Success case: response.status=200

{
    "paging": {
        "total": 7,
        "max": 100,
        "offset": 0,
        "previous": null,
        "next": null
    },
    "data": [
        {
            "id": 2,
            "name": "Home",
            "isRoot": true,
            "parentId": null,
            "parentCategory": null,
            "reference": "Ref-01",
            "description": "Home",
            "image": "BASE_URL/Nice-1444810602520/photoCustomerCategory/1455207900621_users_crowd.png",
            "organization": "Lyon",
            "dateCreated": "2015-10-13T10:12:40Z",
            "lastUpdated": "2016-02-11T16:25:00Z"
        },
        {
            "id": 9,
            "name": "TPE",
            "isRoot": false,
            "parentId": 2,
            "parentCategory": {
                "id": 2,
                "reference": "Ref-01",
                "name": "Home",
                "href": "/api/v1.0/customerCategories/2"
            },
            "reference": "Ref-02",
            "description": "Trés petites entreprises ",
            "image": "BASE_URL/Nice-1444810602520/photoCustomerCategory/1455207886452_users_crowd.png",
            "organization": "Lyon",
            "dateCreated": "2015-10-30T10:19:40Z",
            "lastUpdated": "2016-02-11T16:24:46Z"
        },
        {
            "id": 10,
            "name": "PME",
            "isRoot": false,
            "parentId": 2,
            "parentCategory": {
                "id": 2,
                "reference": "Ref-01",
                "name": "Home",
                "href": "/api/v1.0/customerCategories/2"
            },
            "reference": "Ref-03",
            "description": "Petites et moyennes entreprises",
            "image": "BASE_URL/Nice-1444810602520/photoCustomerCategory/1455176799278_88c0f2f7d904fecacecaf4e585abcc45.png",
            "organization": "Lyon",
            "dateCreated": "2015-10-30T10:20:24Z",
            "lastUpdated": "2016-02-11T07:46:40Z"
        },
        {
            "id": 11,
            "name": "TGE",
            "isRoot": false,
            "parentId": 2,
            "parentCategory": {
                "id": 2,
                "reference": "Ref-01",
                "name": "Home",
                "href": "/api/v1.0/customerCategories/2"
            },
            "reference": "Ref-04",
            "description": "Trés grande entreprise",
            "image": "BASE_URL/Nice-1444810602520/photoCustomerCategory/1455207868614_users_crowd.png",
            "organization": "Lyon",
            "dateCreated": "2015-10-30T10:21:38Z",
            "lastUpdated": "2016-02-11T16:24:29Z"
        },…
    ]
}

To get resized images, add prefix small_ or medium_ to the link url before the image's name, for example:
<BASE_URL>/Nice-1444810602520/photoCustomerCategory/small_1455207868614_users_crowd.png

Failure Output

Failure case:response.status = 400
{
   "error": "invalid_param",
   "error_description": "The parameters [dateCreated_gta] you provided are not valid for this request."
}
{
    "error": "invalid_datetime_format",
    "error_description": "Invalid datetime filter (not ISO-8601 formatted): [2016-08-1Z]"
}

Failure case:response.status = 500
{
   "error": "server_error",
   "error_description": "Oops! Something went wrong..."
}