(Quick Reference)

21 Item translations - Reference Documentation

Version: 2.1

21 Item translations

21.1 List

Service: List item translations

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

URL:

http://BASE_URL/api/VERSION/itemTranslations

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 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/itemTranslations?max=5&order=asc&offset=5&sort=dateCreated"
  },
  "data": [
    {
      "id": 519,
      "itemReference": "bracelet-GRP09062",
      "item": {
        "id": 1,
        "reference": "bracelet-GRP09062",
        "href": "/valomniav2/api/v2.1/items/1"
      },
      "name": "Knot Band Bracelet",
      "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."
}

21.2 Show

Service: Show an item translation

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

URL:

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

Method: GET

Parameters:

NameDescriptionTypeRequiredExample values
idThe numerical ID of the desired translationLongyes123

Success Output

Success case: response.status=200

{
  "id": 519,
  "itemReference": "bracelet-GRP09062",
  "item": {
    "id": 1,
    "reference": "bracelet-GRP09062",
    "href": "/valomniav2/api/v2.1/items/1"
  },
  "name": "Knot Band Bracelet",
  "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 translation with the id 7065 doesn't exist."
}

21.3 Delete

Service: Delete an item translation

Description: Returns a json response.

URL:

https://BASE_URL/api/VERSION/itemTranslations/{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 translation with the id 706 doesn't exist."
}

21.4 Save

Service: Create an item translation

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

URL:

https://BASE_URL/api/VERSION/itemTranslations

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
name Stringyes 
description Stringno 
itemId 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,
  "itemReference": "bracelet-GRP09062",
  "item": {
    "id": 1,
    "reference": "bracelet-GRP09062",
    "href": "/valomniav2/api/v2.1/items/1"
  },
  "name": "Knot Band Bracelet",
  "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": "itemId parameter is missing"
}
{
  "error":"invalid_param_type",
  "error_description": "The type of parameter itemId you provided is not valid for this request."
}
{
  "error": "language_error",
  "error_description": "Failed to "+operation+" the item translation : incorrect language code"
}

Failure case:response.status = 404

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

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

21.5 Update

Service: Update an item translation

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

URL:

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

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
name Stringyes 
description Stringno 
itemId 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,
  "itemReference": "bracelet-GRP09062",
  "item": {
    "id": 1,
    "reference": "bracelet-GRP09062",
    "href": "/valomniav2/api/v2.1/items/1"
  },
  "name": "Knot Band Bracelet",
  "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": "itemId parameter is missing"
}
{
  "error":"invalid_param_type",
  "error_description": "The type of parameter itemId you provided is not valid for this request."
}
{
  "error": "language_error",
  "error_description": "Failed to "+operation+" the item translation : incorrect language code"
}

Failure case:response.status = 404

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

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

21.6 Upsert

Service: Upsert

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

URL with external_id:

https://BASE_URL/api/VERSION/itemTranslations/reference/{itemId}/{languageId}

Method: POST

Request content type: application/json

Parameters:

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

Success Output

Success case: response.status=201
{
  "id": 519,
  "itemReference": "bracelet-GRP09062",
  "item": {
    "id": 1,
    "reference": "bracelet-GRP09062",
    "href": "/valomniav2/api/v2.1/items/1"
  },
  "name": "Knot Band Bracelet",
  "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..."
}