GET /api/apps/versions/{AppVersionID}/contracts

Returns information about API contracts for the specified app version, in the form of a JSON object.

Authorization Roles/Permissions: Must have read permission for the resource.

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/apps/versions/{AppVersionID}/contracts[?][Environment=environment][&][ActivatedOnly]

Back to top

Sample Request

The example below shows a request for the contracts for the specified app version.

Request URL #1

Returns results for all environments.

https://{hostname}/api/apps/versions/2mWn90b8Y4C2vL7qCxDW8f38.acmepaymentscorp/contracts

Request URL #2

With optional parameter, returns results for Sandbox only.

https://{hostname}/api/apps/versions/2mWn90b8Y4C2vL7qCxDW8f38.acmepaymentscorp/contracts?Environment=sandbox

Sample request headers

Accept: application/vnd.soa.v71+json
X-Csrf-Token_{tenant}: {TokenID}

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/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
AppVersionID Path string Required The unique ID for a specific app version.
Environment Query string Optional The environment (implementation) (Sandbox or Production). If not specified, results are returned for all environments.
ActivatedOnly Query boolean Optional Indicates whether only activated contracts should be returned in the response. If not specified, defaults to false.
IncludeAPIEndpoints Query boolean Optional Indicates whether API endpoints currently valid for the resource should be included in the results. Default: true.

Back to top

Response

If successful, this operation returns HTTP status code 200, with information about the contracts applicable to the specified app version.

Back to top

Sample Response

The sample response below shows successful completion of this operation (sample request #1). There is one contract.

Sample response headers: application/vnd.soa.v72+json

Status Code: 200 OK
Content-Type: application/vnd.soa.v72+json
Expires: Tue, 05 Jan 2016 20:53:07 GMT

Sample response body: application/vnd.soa.v72+json


{
  "Contract" : [ {
    "ContractID" : "5f9a9c9d-69e9-4a6e-b854-f83446ea61ef.acmepaymentscorp",
    "APIVersionID" : "7f37e4ac-0e7e-4826-9103-e2deef13f754.acmepaymentscorp",
    "RuntimeID" : "ZgzIfKEG39336phtnW82m3Eo.acmepaymentscorp",
    "Environment" : "Production",
    "State" : "apicontract.status.activated",
    "ContractScope" : {
      "Restricted" : false,
      "LicenseID" : [ ]
    },
    "Updated" : "2016-01-05T12:56:27Z",
    "UpdatedInMillis" : 1451998587000,
    "TargetResources" : {
      "TargetResource" : [ {
        "Name" : "1.0",
        "ID" : "7f37e4ac-0e7e-4826-9103-e2deef13f754.acmepaymentscorp",
        "Type" : "apiversion",
        "Visibility" : "Public",
        "IsResourceLevelPermissionSupported" : true
      }, {
        "Name" : "SwaggerAPI_Both",
        "ID" : "de4b8ee5-e650-4166-a627-becf99f2d282.acmepaymentscorp",
        "Type" : "api",
        "Image" : {
          "Url" : "http://www.acmepaymentscorp.com/api/apis/avatar/_VcqKPPQcM1qfe68Ybr-qIWw",
          "Title" : "api",
          "Link" : "#/api/de4b8ee5-e650-4166-a627-becf99f2d282.acmepaymentscorp/versions/7f37e4ac-0e7e-4826-9103-e2deef13f754.acmepaymentscorp/details"
        }
      }, {
        "Name" : "1.0",
        "ID" : "ZgzIfKEG39336phtnW82m3Eo.acmepaymentscorp",
        "Type" : "app-version"
      }, {
        "Name" : "__SwaggerApp_prod",
        "ID" : "93213f5b-7d6b-486a-b69c-28e0531559bd.acmepaymentscorp",
        "Type" : "app",
        "Image" : {
          "Url" : "http://www.acmepaymentscorp.com/api/apps/avatar/_VcqKPPQcM1qfe68Ybr-qIWw",
          "Title" : "app",
          "Link" : "#/app/93213f5b-7d6b-486a-b69c-28e0531559bd.acmepaymentscorp/versions/ZgzIfKEG39336phtnW82m3Eo.acmepaymentscorp/details"
        }
      }, {
        "ID" : "contract_request10085.acmepaymentscorp",
        "Type" : "board-item"
      } ]
    },
    "Endpoints" : {
      "Endpoint" : [ ]
    },
    "Status" : "com.soa.apicontract.inforce"
  } ]
}

Back to top

Response Headers

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

Header Description
Content-Type

application/vnd.soa.v71+json, application/vnd.soa.v71+xml

application/vnd.soa.v72+json, application/vnd.soa.v72+xml

application/vnd.soa.v80+json, application/vnd.soa.v80+xml

application/vnd.soa.v81+json, application/vnd.soa.v81+xml

Back to top

Response Body

Name Type Description
Contracts Contracts Includes information about one or more app/API contracts.

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.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics