HTTP Verb: POST

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

Object: Milestone

Location: available

Formats: XML, JSON

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

Params

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

XML

<milestone>
  <title>Current</title>
  ...
</milestone>

JSON

{"milestone":{"title":"Current",...}}

Query string

milestone[title]=Current&...

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

Examples

For example purposes we use a JSON body

{"milestone":{"title":"Current"}}

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"milestone":{"title":"Current"}}' https://api.assembla.com/v1/spaces/_space_id/milestones.xml

Response

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Thu, 19 Jul 2012 13:27:13 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: http://api.assembla.com/v1/spaces/_space_id/milestones/_id
...

<?xml version="1.0" encoding="UTF-8"?>
<milestone>
  <planner-type type="integer">0</planner-type>
  <description nil="true"></description>
  <release-notes nil="true"></release-notes>
  <pretty-relese-level>None</pretty-relese-level>
  <release-level nil="true"></release-level>
  <created-by>bgnP_qA1Gr2QjIaaaHk9wZ</created-by>
  <completed-date nil="true"></completed-date>
  <due-date nil="true"></due-date>
  <is-completed type="boolean">false</is-completed>
  <title>Current</title>
  <created-at type="datetime">2012-07-19T13:27:12Z</created-at>
  <updated-at type="datetime">2012-07-19T13:27:12Z</updated-at>
  <updated-by>bgnP_qA1Gr2QjIaaaHk9wZ</updated-by>
  <id type="integer">13</id>
  <user-id nil="true"></user-id>
  <space-id>b89TL8MYWr4id7adbNA33N</space-id>
</milestone>

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"milestone":{"title":"Current"}}' https://api.assembla.com/v1/spaces/_space_id/milestones.json

Response

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Thu, 19 Jul 2012 13:38:12 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: http://api.assembla.com/v1/spaces/_space_id/milestones/_id
...

{
  "planner_type":0,
  "description":null,
  "release_notes":null,
  "pretty_relese_level":"None",
  "release_level":null,
  "created_by":"bgnP_qA1Gr2QjIaaaHk9wZ",
  "completed_date":null,
  "due_date":null,
  "is_completed":false,
  "title":"Current",
  "created_at":"2012-07-19T13:38:12Z",
  "updated_at":"2012-07-19T13:38:12Z",
  "updated_by":"bgnP_qA1Gr2QjIaaaHk9wZ",
  "id":14,
  "user_id":null,
  "space_id":"b89TL8MYWr4id7adbNA33N"
}

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: milestone object fields reference