You can pass a single JSON object to create a single element, or a JSON array of application JSON objects to create multiple elements. If you create a single element, the response includes the URI of the new element in the Location response header, and the response body includes one application JSON object with the format specified by the format parameter. If you create multiple elements, the response includes a JSON array of application JSON objects with the specified format in an order that corresponds to the order of the input data. If no format is specified, the "detail" format will be used by default. If creating a large number of elements in a single request, it is recommended to use the "list" or "name" formats for better performance, when the use case allows it.
Request
POST http://{hostname}:{port}
/applications/?{parameters}
Accept: application/json
Content-Type: application/json
Table 1. Request parameters| Parameter |
Type |
Required |
Description |
| format |
string |
false |
One of the format options; this parameter determines what information is included in the JSON response. If not specified, or if an unrecognized value is specified, the default format of "detail" will be used. |
For the
format parameter, use one of the following format options:
- list
- Primary properties and teams, children and release environments
- detail
- Primary properties and teams, children, release environments, application targets, tasks and integration provider
- teams
- Primary properties and teams - used for only collections
- externalIntegrationDetails
- Primary properties and integration provider
For details about the full JSON that the server returns when you select one of these formats, see the related resource:
application resource.
Content types
This command accepts the following content types. Specify the content type that you are providing in the header of the request.
This command returns the following content types. Specify the content type that you are accepting in the header of the request.
curl -k -u jsmith:passwd
"http://myserver.example.com:8080/applications/" -X POST
-H "Accept: application/json"
-H "Content-Type: application/json"
-d @newApplication.json
Example JSON request
{
"name": "Example Application",
"description": "An example application created with ID references to sample data",
"teams": [
"00000000-0000-0000-0000-000000000206"
],
"releaseEnvironments": [
"00000000-0000-0000-0000-000000000016",
"00000000-0000-0000-0000-000000000017",
"00000000-0000-0000-0000-000000000018",
"00000000-0000-0000-0000-000000000019",
"00000000-0000-0000-0000-000000000020"
]
}
Example JSON request
{
"name": "Example Application 2",
"description": "An example application created with a team name reference",
"teams": [
"Team for Sample Release"
]
}