Tags Update
HTTP Verb: PUT
Available statuses: 204 No Content, 404 Not Found, 422 Unprocessable Entity
Object: Tag
Location: n/a
Formats: XML, JSON
Update a tag
Params
To update a tag, a data body must be provided. Data can be provided in three formats: XML, JSON and query string. To specify data type of XML or JSON add the Content-type: application/(json|xml) header to request headers, if you want to provide query string simply skip the Content-type header.
All params should be sent in the tag namespace, e.g.:
XML
<tag>
<name>newname</name>
<state>1</state>
</tag>
JSON
{"tag":{"name":"newname", "state":1}}
Query string
tag[name]=newname&tag[state]=1
Check the full list of available params on tag object fields reference
Examples
For example purposes we use a JSON body
{"tag":{"name":"newname", "state":"1"}}
Request XML, using cURL utility:
curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"tag":{"name":"newname"}}' https://api.assembla.com/v1/spaces/_space_id/tags/_id.xml
Response
HTTP/1.1 204 No Content
Server: nginx/0.8.55
Date: Wed, 20 Jun 2012 12:13:01 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 204
Request JSON, using cURL utility:
curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"tag":{"name":"newname"}}' https://api.assembla.com/v1/spaces/_space_id/tags/_id.json
Response
HTTP/1.1 204 No Content
Server: nginx/0.8.55
Date: Wed, 20 Jun 2012 12:13:01 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 204
For update operations no response body is available, to get the data of updated resource send a GET request to the same URL, i.e.:
curl -i -H "Authorization: Bearer _token" https://api.assembla.com/v1/spaces/_space_id/tags/_id.(xml|json)