(Quick Reference)

24 Item category translations - Reference Documentation

Version: 2.1

24 Item category translations

24.1 List

Service: List item category translations

Description: This web service returns a json list of item category translations.

URL:

http://BASE_URL/api/VERSION/itemCategoryTranslations

Method: GET

Parameters:

Pagination parameters:

NameDescriptionTypeRequiredPossible values
maxLimits the number of resources requested to return.Integerno 
offsetTells where to start returning records from the entire set of results.Integerno 
orderOrders ascending or descending.Integernoasc,desc
sortOrders the results by the specified field.Stringno 

The max parameter is set to 100 by default.

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 
languageFilters by languageStringno'en', 'fr' , etc ..
referenceWildcard search by the item category referenceStringnoreference=Ref-6* , reference=*ef-6 , reference=*ef-6*

Success Output

Status: HTTP/1.1 200 OK

{
  "paging": {
    "total": 526,
    "max": 5,
    "offset": 0,
    "previous": null,
    "next": "/api/v2.1/itemCategoryTranslations?max=5&order=asc&offset=5&sort=dateCreated"
  },
  "data": [
    {
      "id": 519,
      "itemCategoryReference": "R100",
      "itemCategory": {
        "id": 1,
        "reference": "R100",
        "href": "/valomniav2/api/v2.1/itemCategories/1"
      },
      "name": "new Cate",
      "description": "",
      "language": {
        "id": 3,
        "code": "en"
      },
      "organization": "entity1",
      "dateCreated": "2015-12-16T16:38:44Z",
      "lastUpdated": "2015-12-16T16:38:44Z"
    },
   …
  ]
}

Failure Output

Status: HTTP/1.1 400 Bad Request

{
  "error": "invalid_param",
  "error_description": "The parameters [dateCreated_gta] you provided are not valid for this request."
}

24.2 Show

Service: Show an item category translation

Description: Returns the requested item category translation in json format when successful. Returns a json response, describing the failure condition when unsuccessful.

URL:

https://BASE_URL/api/VERSION/itemCategoryTranslations/{id}

Method: GET

Parameters:

NameDescriptionTypeRequiredExample values
idThe numerical ID of the desired translationLongyes123

Success Output

Success case: response.status=200

{
  "id": 519,
  "itemCategoryReference": "R100",
  "itemCategory": {
    "id": 1,
    "reference": "R100",
    "href": "/valomniav2/api/v2.1/itemCategories/1"
  },
  "name": "new Cate",
  "description": "",
  "language": {
    "id": 3,
    "code": "en"
  },
  "organization": "entity1",
  "dateCreated": "2015-12-16T16:38:44Z",
  "lastUpdated": "2015-12-16T16:38:44Z"
}

Failure Output

Failure case:response.status = 400

{
  "error": "invalid_param_type",
  "error_description": "The type of parameter id you provided is not valid for this request."
}

Failure case:response.status = 404

{
  "error": "not_found",
  "error_description": "The item category translation with the id 7065 doesn't exist."
}

24.3 Delete

Service: Delete an item category translation

Description: Returns a json response.

URL:

https://BASE_URL/api/VERSION/itemCategoryTranslations/{id}

Method: DELETE

Parameters:

NameDescriptionTypeRequiredExample values
idThe numerical ID of the desired translationLongyes123

Success Output

Success case: response.status=200

{
  "success": "true",
  "success_description": "Instance deleted successfully"
}

Failure Output

Failure case:response.status = 400

{
  "error": "delete_failed",
  "error_description": "Failed to delete instance."
}

Failure case:response.status = 404

{
  "error": "not_found",
  "error_description": "The item category translation with the id 706 doesn't exist."
}

24.4 Save

Service: Create an item category translation

Description: Returns the created item category translation in json format when successful. Returns a json response, describing the failure condition when unsuccessful.

URL:

https://BASE_URL/api/VERSION/itemCategoryTranslations

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
name Stringyes 
description Stringno 
itemCategoryId Long/Stringyes 
languageISO language codeStringyesfr
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false

Success Output

Success case: response.status=201

{
  "id": 519,
  "itemCategoryReference": "R100",
  "itemCategory": {
    "id": 1,
    "reference": "R100",
    "href": "/valomniav2/api/v2.1/itemCategories/1"
  },
  "name": "new Cate",
  "description": "",
  "language": {
    "id": 3,
    "code": "en"
  },
  "organization": "entity1",
  "dateCreated": "2015-12-16T16:38:44Z",
  "lastUpdated": "2015-12-16T16:38:44Z"
}

Failure Output

Failure case:response.status = 400

{
  "error": "save_failed",
  "error_description": "Failed to save instance."
}

{
  "error": "missing_param",
  "error_description": "itemCategoryId parameter is missing"
}
{
  "error":"invalid_param_type",
  "error_description": "The type of parameter itemCategoryId you provided is not valid for this request."
}
{
  "error": "language_error",
  "error_description": "Failed to "+operation+" the item category translation : incorrect language code"
}

Failure case:response.status = 404

{
  "error": "not_found",
  "error_description": "The item category with the id 31888 doesn't exist."
}

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

24.5 Update

Service: Update an item category translation

Description: Returns the updated item category translation in json format when successful. Returns a json response, describing the failure condition when unsuccessful.

URL:

https://BASE_URL/api/VERSION/itemCategoryTranslations/{id}

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
name Stringyes 
description Stringno 
itemCategoryId Long/Stringyes 
languageISO language codeStringyesfr
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false

Success Output

Success case: response.status=200

{
  "id": 519,
  "itemCategoryReference": "R100",
  "itemCategory": {
    "id": 1,
    "reference": "R100",
    "href": "/valomniav2/api/v2.1/itemCategories/1"
  },
  "name": "new Cate",
  "description": "",
  "language": {
    "id": 3,
    "code": "en"
  },
  "organization": "entity1",
  "dateCreated": "2015-12-16T16:38:44Z",
  "lastUpdated": "2015-12-16T16:38:44Z"
}

Failure Output

Failure case:response.status = 400

{
  "error": "save_failed",
  "error_description": "Failed to save instance."
}

{
  "error": "missing_param",
  "error_description": "itemCategoryId parameter is missing"
}
{
  "error":"invalid_param_type",
  "error_description": "The type of parameter itemCategoryId you provided is not valid for this request."
}
{
  "error": "language_error",
  "error_description": "Failed to "+operation+" the item category translation : incorrect language code"
}

Failure case:response.status = 404

{
  "error": "not_found",
  "error_description": "The item category with the id 31888 doesn't exist."
}

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

24.6 Upsert

Service: Upsert

Description: This web service is used to insert an item category translation object to the database if it does not already exist, or update it.

URL with external_id:

https://BASE_URL/api/VERSION/itemCategoryTranslations/reference/{itemCategoryId}/{languageId}

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
namethe name of the item category translatedStringYes 
descriptiondescription of the item category translatedStringNo 

Success Output

Success case: response.status=201
{
  "id": 519,
  "itemCategoryReference": "R100",
  "itemCategory": {
    "id": 1,
    "reference": "R100",
    "href": "/valomniav2/api/v2.1/itemCategories/1"
  },
  "name": "new Cate",
  "description": "",
  "language": {
    "id": 3,
    "code": "en"
  },
  "organization": "entity1",
  "dateCreated": "2015-12-16T16:38:44Z",
  "lastUpdated": "2015-12-16T16:38:44Z"
}

Failure Output

Failure case:response.status = 400
{
     "error": "save_failed",
     "error_description": "Failed to save instance"
}

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