HTTP Verb: PUT

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

Object: Task

Location: n/a

Formats: XML, JSON

Update a task.

Params

To update a task, 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 user-task namespace, e.g.:

XML

<?xml version="1.0" encoding="UTF-8"?>
<user-task>
  <space-id>b3gNxoscyr4Q7K5bfBjDYC</space-id>
  <description>Description goes here</description>
  ...
</user-task>

JSON

{"user_task":{"space_id":"b3gNxoscyr4Q7K5bfBjDYC","description":"Description goes here",...}}

Query string

user_task[space_id]=b3gNxoscyr4Q7K5bfBjDYC&user_task[description]=Description goes here...

Check the full list of available params on Task object fields reference

Examples

For example purposes we use a JSON body

{"user_task":{"space_id":"b3gNxoscyr4Q7K5bfBjDYC","contents":"Description goes here"}}

Request XML, using cURL utility:

curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"user_task":{"space_id":"b3gNxoscyr4Q7K5bfBjDYC","contents":"Description goes here"}}' https://api.assembla.com/v1/tasks/_id.xml

Response:

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Fri, 07 Sep 2012 13:08:42 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...

Request JSON, using cURL utility:

curl -i -X PUT -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"user_task":{"space_id":"b3gNxoscyr4Q7K5bfBjDYC","contents":"Description goes here"}}' https://api.assembla.com/v1/tasks/_id.json

Response:

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

{}

JSON is formatted here for readability, in a real response JSON body is inline with no indentation.

Description for each field: Task object fields reference