API Contract Management
{ http://soa.com/wsdl/contract/1.0 } APIContractAPI
The Contracts service provides operations for managing API access contracts in the Akana API Platform.
POST/contractsrequestContract
Requests a new contract between a specific version of an app and a specific version of an API. Also used to revise a contract.
Revising an existing, active contract creates a new contract. However, there can only be one original contract and one revised
contract. An attempt to create a second revision will fail.
Authorization Roles/Permissions: App team member
Workflow: When a completely new contract is created (the first contract between a specific app version and a specific API
version in a specific environment), the @Create initial action is used to start the workflow for the new contract. When a contract
is revised, a new contract is created that is a revision of the existing contract, and the existing contract remains in place.
In this scenario, the @Revise initial action is used to start the workflow for the revised contract. When there is a revised
contract in place, any subsequent requests to create a contract for the app/API/environment combination will fail, since only
one revised contract is allowed at one time.
Sample Request
POST /api/contracts HTTP/1.1
Host: {hostname}
Accept: application/json
Content-Type: application/json
X-Csrf-Token_{tenant}: {TokenID}
{
"APIVersionID":"b49ef94a-3a4b-4cc4-b894-ef067d9a0de9.acmepaymentscorp",
"RuntimeID":"7J0w4Dy2BGN2QPUi6sFGlR6w.acmepaymentscorp",
"Environment":"Production",
"Policies":{
"Policy":[
{
"PolicyKey":"urn:uuid:a28e7b76-499c-11e4-bfe5-b1a96aa04935"
}
]
},
"ContractScope":{
"Restricted":true,
"LicenseID":[
"15d5d812-81e1-4d26-9597-e595b81b102f.acmepaymentscorp",
"e18cd5b6-93a6-4f30-b089-5ea374d2818d.acmepaymentscorp",
"104d523d-5d49-4bc3-b523-7de6725fcaae.acmepaymentscorp"
]
}
}
Sample Response
HTTP/1.1 200 OK
Date: Wed, 01 Oct 2014 00:00:00 GMT
Content-Type: application/json
{
"ContractID" : "3f548ac7-86ac-4881-8aec-bfa5b5e9f60d.acmepaymentscorp",
"APIVersionID" : "b49ef94a-3a4b-4cc4-b894-ef067d9a0de9.acmepaymentscorp",
"RuntimeID" : "2mWn90b8Y4C2vL7qCxDW8f38.acmepaymentscorp",
"Environment" : "Sandbox",
"State" : "apicontract.status.activated",
"ContractScope" : {
"Restricted" : false
},
"Updated" : "2014-10-01T19:38:20Z",
"UpdatedInMillis" : 1412192300000,
"Status" : "com.soa.apicontract.inforce"
}
Parameters
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
Reponse
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
GET/contracts/reserveIDgetNewReserveContractDN
Reponse
POST/contracts/{ContractID}requestAutoConnectContract
Parameters
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
Reponse
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
PUT/contracts/{ContractID}updateContract
Updates information about an app/API contract.
Authorization Roles/Permissions: To complete this operation successfully, a user must be a member of the applicable team (App
team member or API Admin).
Sample Request
Accept: application/json
Content-Type: application/json
X-Csrf-Token_{tenant}: {TokenID}
{
"ContractID" : "6e56a1d4-308d-4269-a4d7-b47781664921.acmepaymentscorp",
"APIVersionID" : "b9ef39d6-5eb4-45dd-9a53-d126c83935d7.acmepaymentscorp",
"RuntimeID" : "5GeZHyOZUlk8ISehxqO2swA6.acmepaymentscorp",
"Environment" : "Production",
"State" : "apicontract.status.suspended",
"ContractScope" : {
"Restricted" : true,
"LicenseID" : [ "0876cfb9-a308-4f24-a8b2-fc20493f0afb.acmepaymentscorp" ]
},
"Status" : "com.soa.apicontract.inforce"
}
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 30 Sep 2014 00:00:00 GMT
{
"ContractID" : "6e56a1d4-308d-4269-a4d7-b47781664921.acmepaymentscorp",
"APIVersionID" : "b9ef39d6-5eb4-45dd-9a53-d126c83935d7.acmepaymentscorp",
"RuntimeID" : "5GeZHyOZUlk8ISehxqO2swA6.acmepaymentscorp",
"Environment" : "Production",
"State" : "apicontract.status.suspended",
"ContractScope" : {
"Restricted" : true,
"LicenseID" : [ "0876cfb9-a308-4f24-a8b2-fc20493f0afb.acmepaymentscorp" ]
}
}
Parameters
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
Reponse
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
DELETE/contracts/{ContractID}deleteContract
Parameters
Reponse
GET/contracts/{ContractID}getContract
Retrieves information about the specified contract.
Note: To get a list of contracts for a specific app or API you can use GET /api/apps/versions/{AppVersionID}/contracts or
GET /api/apis/versions/{APIVersionID}/contracts. This operation returns a specific contract. If you have the ContractID,
you can use this operation to get information about the contract.
Authorization Roles/Permissions: 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.
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 30 Sep 2014 00:00:00 GMT
{
"ContractID" : "6e56a1d4-308d-4269-a4d7-b47781664921.acmepaymentscorp",
"APIVersionID" : "b9ef39d6-5eb4-45dd-9a53-d126c83935d7.acmepaymentscorp",
"RuntimeID" : "5GeZHyOZUlk8ISehxqO2swA6.acmepaymentscorp",
"Environment" : "Production",
"State" : "apicontract.status.activated",
"ContractScope" : {
"Restricted" : true,
"LicenseID" : [ "0876cfb9-a308-4f24-a8b2-fc20493f0afb.acmepaymentscorp" ]
},
"Updated" : "2014-09-30T18:19:59Z",
"UpdatedInMillis" : 1412101199000,
"Status" : "com.soa.apicontract.inforce"
}
Parameters
Reponse
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
GET/contracts/{ContractDN}/packageexport
Exports a specific app/API contract.
Authorization Roles/Permissions: 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.
The response content is sent as the export file named in the Content-Disposition header.
Sample Request
GET /api/contracts/{contract}/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
X-Csrf-Token_{tenant}: {TokenID}
Additional Query Parameters
The following query parameters are optional.
download (string) 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 (boolean) If specified with a true value, apps are included in the export file
migration.export.include.apis (boolean) If specified with a true value, APIs are included in the export file
migration.export.include.licenses (boolean) If specified with a true value, Licenses are included in the export file
migration.qospolicy.export (boolean) If specified with a true value, Quality of Service policies are included in the export file
Sample Response
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment;filename=apicontract-export.zip
Parameters
Reponse
GET/contracts/{ContractID}/appdetailsgetContractAppDetails
Parameters
Reponse
ApplicationVersion {
RatingSummary {
AppVersionSettings {
TargetResource {
Image {
entry {
Application {
AppSettings {
POST/contracts/{ContractDN}/actionsexecuteWorkflowAction
Executes workflow actions associated with a specific change of contract status.
Authorization Roles/Permissions: To complete this operation successfully, a user must be a member of the applicable team
(App team member or API Admin). However, the workflow itself might enforce additional requirements:
- The specific workflow action to be executed must be valid for the specific contract the action will be performed on.
- In addition, each action might require its own conditions. Some workflow actions can only be performed by an API Admin, some by an app admin, and so forth. Depending on the combination of action name and ContractID, this operation might require different roles. For example, Activate can only be done by an API admin or business admin; Resubmit can be done by app team members or API admins. Custom workflow definitions could require different roles for different actions.
Sample Request
POST /api/contracts/contract25519.acmepaymentscorp/actions HTTP/1.1
Host: {hostname}
Accept: */*
Content-Type: application/json; charset=UTF-8
X-Csrf-Token_{tenant}: {TokenID}
{
"ActionName":"apicontract.action.activate",
"Comments":"Granting production access (activating)."
}
Sample Response
HTTP/1.1 200 OK
Content-Type: text/plain
Date: Wed, 10 Jul 2013 19:57:49 GMT
apicontract.status.activated
Parameters
ActionParameter {
Reponse
PUT/contracts/{ContractDN}/scopesaveContractScope
Parameters
Reponse
Policy {
ContractScope {
TargetResource {
Image {
Endpoint {
EndpointImplementationDetails {
GTMEndpoint {
DeploymentZoneEndpoint {
ConnectionProperty {
Scope {
GET/contracts/{ContractID}/apidetailsgetContractAPIDetails
Parameters
Reponse
APIVersion {
APIVersionResourceDetails {
Resource {
OperationResourceDetails {
EndpointOAuthDetails {
OAuthTokenResourceURISettings {
OAuth20Settings {
OAuth10aSettings {
APIImplementation {
DeploymentZonesHostingInfo {
DeploymentZoneEndpoint {
APIBinding {
BindingOperation {
HttpOperation {
Input {
Policy {
ServiceReference {
Endpoint {
ConnectionProperty {
APIInterface {
InterfaceOperation {
OperationOAuthDetails {
Operation {
entry {
stringArray {
RatingSummary {
APIDesign {
TargetResource {
Image {
Descriptor {
Links {
TargetAPI {
APIVersionSettings {
API {
APISettings {