POST /v1/spaces/:space_id/space_tools/:space_tool_id/merge_requests
HTTP Verb: POST
Available statuses: 201 Created, 404 Not Found, 422 Unprocessable Entity
Object: MergeRequest
Location: available
Formats: XML, JSON
Create a new merge request
Params
All params should be sent in the merge_request namespace, e.g.:
XML
<merge_request>
<source_symbol>test_branch</source_symbol>
<target_symbol>master</target_symbol>
...
</merge_request>
JSON
{"merge_request":{"source_symbol":"test_branch","target_symbol":"master",...}}
Query string
merge_request[source_symbol]=test_branch&merge_request[target_symbol]=master&...
Check the full list of fields on merge request object fields reference page
Examples
Request XML, using cURL utility:
curl -i -H "Authorization: Bearer _token" -d '<merge_request><source_symbol>test_branch</source_symbol><target_symbol>master</target_symbol>...</merge_request>' https://api.assembla.com/v1/spaces/_space_id/spaces_tools/_space_tool_id/merge_requests.xml
Response
HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Fri, 20 Jul 2012 12:55:38 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: https://api.assembla.com/v1/spaces/_space_id/spaces_tools/_space_tool_id/merge_requests/_id
...
<?xml version="1.0" encoding="UTF-8"?>
<merge-request>
<processed-by-user-id nil="true"></processed-by-user-id>
<status type="integer">0</status>
<apply-status nil="true"></apply-status>
<description></description>
<target-space-tool-id>bgfq4qA1Gr2QjIaaaHk9wZ</target-space-tool-id>
<target-space-id>bBEAVq-5Gr4yhAimNqr_pR</target-space-id>
<applied-at nil="true"></applied-at>
<target-symbol>master</target-symbol>
<source-symbol-type type="integer">0</source-symbol-type>
<source-symbol>test_branch</source-symbol>
<space-tool-id>a5BqzgFVSr4zLpab_q0pIh</space-tool-id>
<updated-at type="datetime">2012-07-26T07:59:40Z</updated-at>
<commit nil="true"></commit>
<id type="integer">2</id>
<created-at type="datetime">2012-06-27T12:41:17Z</created-at>
<user-id>aeF1CInHCr4ybVab_q0pIh</user-id>
</merge-request>
Request JSON, using cURL utility:
curl -i -H "Authorization: Bearer _token" -d '{"merge_request":{"source_symbol":"test_branch","target_symbol":"master",...}}' https://api.assembla.com/v1/spaces/_space_id/spaces_tools/_space_tool_id/merge_requests.json
Response
HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Fri, 20 Jul 2012 14:03:49 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: https://api.assembla.com/v1/spaces/_space_id/spaces_tools/_space_tool_id/merge_requests/_id
...
{
"processed_by_user_id":null,
"status":0,
"apply_status":null,
"description":"",
"target_space_tool_id":"bgfq4qA1Gr2QjIaaaHk9wZ",
"target_space_id":"bBEAVq-5Gr4yhAimNqr_pR",
"applied_at":null,
"target_symbol":"master",
"source_symbol_type":0,
"source_symbol":"test_branch",
"space_tool_id":"a5BqzgFVSr4zLpab_q0pIh",
"updated_at":"2012-07-26T07:59:40Z",
"commit":null,
"id":2,
"created_at":"2012-06-27T12:41:17Z",
"user_id":"aeF1CInHCr4ybVab_q0pIh"
}
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: merge request object fields reference