HTTP Verb: PUT

Available statuses: 200 OK, 404 Not Found, 422 Unprocessable Entity

Object: CustomField

Location: available

Formats: XML, JSON

Update a custom field by id.

Params

To update a custom field, 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 custom_field namespace, e.g.:

XML

<custom-field>
  <title>OS</title>
  ...
</custom-field>

JSON

{"custom_field":{"title":"OS",...}}

Query string

custom_field[title]=OS&...

Check the full list of available params on custom field object fields reference

Examples

For example purposes we use a JSON body

{"custom_field":{"title":"OS"}}

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -X PUT -d '{"custom_field":{"title":"OS"}}' https://api.assembla.com/v1/spaces/_space_id/tickets/custom_fields/_id.xml

Response

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Mon, 24 Sep 2012 12:56:31 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -X PUT -d '{"custom_field":{"title":"OS"}}' https://api.assembla.com/v1/spaces/_space_id/tickets/custom_fields/_id.json

Response

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Mon, 24 Sep 2012 12:55:28 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...

{}

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/tickets/custom_fields/_id.(xml|json)