Update item
Description
Update an existing item
Url
1 |
PUT /api/v0/item/UUID/ |
Parameters
optional
- uuid: item's unique identifier
- tags: list of resource URIs like ["/api/v0/tag/UUID1/", "/api/v0/tag/UUID2/"]
- url: URL related to the item's content
- content: a valid JSON object
- custom: any type of custom data attached to the item.
- trackable: true for creating an AR item (default: false)
Example
Change the name and url on the item identified by c37fbdaf74bd46aa9f6b4ca60444d45b
Request
1 2 3 4 5 |
curl -X PUT \ -H "Content-Type: application/json" \ 'https://my.craftar.net/api/v0/item/c37fbdaf74bd46aa9f6b4ca60444d45b/?api_key=123456789abcdefghijk123456789abcdefghijk' \ -d '{"name": "Nascita di Venere", "url": "http://it.wikipedia.org/wiki/Nascita_di_Venere" }' |
Response
HTTP Status code: 200 OK
1 2 3 4 5 6 7 8 |
{ "uuid": "c37fbdaf74bd46aa9f6b4ca60444d45b", "url": "http://it.wikipedia.org/wiki/Nascita_di_Venere", "resource_uri": "/api/v0/item/c37fbdaf74bd46aa9f6b4ca60444d45b/", "name": "Nascita di Venere", "content": null, "collection": "/api/v0/collection/806e54535ffd464f83545c902e664aca/" } |
Errors
HTTP Status code: 400 Bad Request
Invalid JSON
1 2 3 4 5 6 |
{ "error": { "message": "The content is not a valid JSON document.", "code": "INVALID_JSON" } } |
Content not in JSON
1 2 3 4 5 6 |
{ "error": { "message": "Expected application/json content but got application/xml.", "code": "WRONG_CONTENT_TYPE" } } |
Empty item name
1 2 3 4 5 6 7 8 9 |
{ "error": { "code": "VALIDATION_ERROR", "message": "Some of the provided fields couldn't be validated. See the 'details' key for more information.", "details": { "name": ["This field is required."] } } } |