POST /v1/spaces/:space_id/ticket_components
Ticket components API is deprecated. Please use custom fields.
HTTP Verb: POST
Available statuses: 201 Created, 404 Not Found, 422 Unprocessable Entity
Object: TicketComponent
Location: available
Formats: XML, JSON
Create a component and return newly created component body and location.
Params
To create a component, 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.
Send a component
parameter with the name of new component, e.g.:
XML
<component>
Component name
</component>
JSON
{"component":"Component name"}
Query string
component=Component name
In case of success you will receive the body of newly created component and its location, in case of failure a validation error will be trown with a description of error.
Check the full list of fields on ticket components object fields reference page
Examples
Request XML, using cURL utility:
curl -i -H "Authorization: Bearer _token" -d "component=mycomponent" https://api.assembla.com/v1/spaces/_space_id/ticket_components.xml
Response
HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Tue, 17 Jul 2012 12:07:02 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/ticket_components/_id
...
<?xml version="1.0" encoding="UTF-8"?>
<component>
<name>mycomponent</name>
<id type="integer">32</id>
</component>
Request JSON, using cURL utility:
curl -i -H "Authorization: Bearer _token" -d "component=mycomponent" https://api.assembla.com/v1/spaces/_space_id/ticket_components.json
Response
HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Tue, 17 Jul 2012 12:10:18 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/ticket_components/_id
{
"id":33,
"name":"mycomponent"
}
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 components object fields reference page