GET /api/contracts/{ContractID}/package

Exports a specific app/API contract.

Authorization Roles/Permissions: Must be logged in. To complete this operation successfully, a user must be a member of the applicable team (App team member or API Admin) or a Site Admin or Business Admin.

This topic includes the following sections:

HTTP Method


Back to top



Back to top

Sample Request

The example below shows a request to export the contract, with all options included..

Request URL#1: no options


Request URL #2: all options


Sample request headers

GET /api/contracts/{hostname}/package?migration.export.include.apis=true&migration.export.include.apps=true
&migration.export.include.licenses=true&migration.qospolicy.export=true&download=true&wrapInHTML=true HTTP/1.1
Host: {hostname}
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Sample request body

Not applicable.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/octet-stream
Content-Disposition attachment;filename=""
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
ContractID Path string Required The unique ID for a specific contract between an app version and an API version.
download Query string Optional If set to true (the default), the content is downloaded. If set to false, the user is prompted for content disposition.
migration.export.include.apps Query boolean Optional

If specified with value true, include in export file:

  • Apps
migration.export.include.apis Query boolean Optional

If specified with value true, include in export file:

  • APIs
migration.export.include.licenses Query boolean Optional

If specified with value true, include in export file:

  • Licenses
migration.qospolicy.export Query boolean Optional

If specified with value true, include in export file:

  • Quality of Service policies

Note:For information about the wrapInHTML parameter shown in the sample request above, see File Upload with Ajax. This is only used if you are running the API in a browser context.

Back to top


If successful, this operation returns HTTP status code 200, with the contract information in JSON format.

Back to top

Sample Response

The sample response below shows successful completion of this operation. The export file is downloaded as specified in the request parameters.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment;

Sample response body

The response content is sent as the export file named in the Content-Disposition header.

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/octet-stream

Back to top

Response Body

The response body is a download file that includes information about the contract. The export file is a standard format that can be imported into another instance of the platform for the same tenant. It includes the following folders and files:

  • objectdata.xml
  • objectgraph.xml

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics