HTTP Verb: POST

Available statuses: 201 Created, 404 Not Found, 422 Unprocessable Entity

Object: TicketStatus

Location: available

Formats: XML, JSON

Create a ticket status and return the body of newly created object in requested format among with its location in a Location: \_location header.

Params

To create a ticket status, 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 status namespace, e.g.:

XML

<status>
  <name>Wait for response</name>
  <state>1</state>
  ...
</status>

JSON

{"status":{"name":"Wait for response","state":1...}}

Query string

status[name]=Wait for response&status[state]=1...

Check the full list of available params on ticket status object fields reference

Examples

For example purposes we use a JSON body

{"status":{"name":"Wait for response","state":1...}}

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"status":{"name":"Wait for response","state":1...}}' https://api.assembla.com/v1/spaces/_space_id/tickets/statuses.xml

Response

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Thu, 20 Sep 2012 14:15:12 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: http://api.assembla.com/v1/spaces/test-1/tickets/statuses/8
...

<?xml version="1.0" encoding="UTF-8"?>
<status>
  <id type="integer">8</id>
  <space-tool-id>dP3FZG_ber4B8UadbNA33N</space-tool-id>
  <name>Wait for response</name>
  <state type="integer">1</state>
  <list-order type="integer">7</list-order>
  <created-at type="datetime">2012-09-20T14:15:12Z</created-at>
  <updated-at type="datetime">2012-09-20T14:15:12Z</updated-at>
</status>

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"status":{"name":"Wait for response","state":1...}}' https://api.assembla.com/v1/spaces/_space_id/tickets/statuses.json

Response

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Thu, 20 Sep 2012 14:17:06 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: http://api.assembla.com/v1/spaces/test-1/tickets/statuses/8
...

{
  "id":9,
  "space_tool_id":"dP3FZG_ber4B8UadbNA33N",
  "name":"Wait for response",
  "state":1,
  "list_order":8,
  "created_at":"2012-09-20T14:17:06Z",
  "updated_at":"2012-09-20T14:17:06Z"
}

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

Note: pay attention to Location header, this is the URL where newly created resource is located, you can GET on this URL to access this resource.

Description for each field: ticket status object fields reference