Update token
Description
Update an existing token
Url
|
1 |
PUT /api/v0/token/UUID/ |
Parameters optional
- uuid: item's unique identifier
- tags: list of resource URIs like ["/api/v0/tag/UUID1/", "/api/v0/tag/UUID2/"]
Example
Add tags to the token identified by a1d81asdaddd7488d
Request
|
1 2 3 4 |
curl -X PUT \ -H "Content-Type: application/json" \ 'https://my.craftar.net/api/v0/token/a1d81asdaddd7488d/?api_key=123456789abcdefghijk123456789abcdefghijk' \ -d '{"tags": ["/api/v0/tag/1ca6bbfe7582470d8e26e840bc6fbfac", "/api/v0/tag/f5865cb2175d4b929af138e2de86d738"] }' |
Response
HTTP Status code: 200 OK
|
1 2 3 4 5 6 7 8 9 |
{ "collection": "/api/v0/collection/9beee701e626450faaaf3295b3e796d8/", "resource_uri": "/api/v0/token/a1d81asdaddd7488d/", "tags": [ "/api/v0/tag/f5865cb2175d4b929af138e2de86d738/", "/api/v0/tag/1ca6bbfe7582470d8e26e840bc6fbfac" ], "token": "a1d81asdaddd7488d" } |
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" } } |