POST /api/apis/{APIID}/versions

Deprecated. Adds an additional API version to an existing API. As of version 8.1, this operation is replaced by POST /api/apis/{APIID}/versions (extended functionality, different headers). Use the newer operation.

Note: Deprecated.

From version 8.1 onwards, use POST /api/apis/{APIID}/versions with custom headers.

Note: The initial API version is added as part of the POST apis operation when adding the API.

Authorization Roles/Permissions: Must be logged in. Must have Modify permission for the resource. An API Admin or Business Admin.

Workflow: There is no default workflow for new API versions. However, a custom workflow might be in place. There is only one initial action valid for Akana API Platform workflows relating to API versions, the @Create initial action. For more information on workflow, see Executing Workflow Actions.

Authorization token renewal: This operation changes information that is reflected in the authorization token; therefore, when invoking this operation, you must also renew the token.

This topic includes the following sections:

HTTP Method

POST

URL

https://{hostname}/api/apis/{APIID}/versions

Sample Request

The example below adds a version for the acmepaymentscorp API.

Sample Request URL

https://{hostname}/api/apis/4e015aec-8224-4a43-a8d8-7ae969312307.acmepaymentscorp/versions

Sample request headers: application/json

Content-Type: application/json
Accept: application/json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body: application/json

{ 
  "APIID":"7df17f3f-8ee2-4749-9719-52f5090c51da.acmepaymentscorp",
  "Name":"Version 2",
  "Description":"Major update.",
  "Type":"shttp",
  "DefaultProfile":"Any in and out",
  "Tag":[ 
    "payments",
    "ACME"
  ],
  "ProductionEndpoint":"http://acme-payments-api.10.1.20.137:9901/",
  "SandboxEndpoint":"http://acme-payments-api.10.1.20.137:9901/",
  "Operations":{ 
    "Operation":[ 
      { 
        "Method":"GET",
        "Path":"/payments/{paymentid}",
        "Input":[ 
          { 
            "Name":"paymentid",
            "Type":"path"
          }
        ],
        "InputContentType":"*/*",
        "OutputContentType":"*/*",
        "FaultContentType":"*/*",
        "Name":"getPayment"
      },
      { 
        "Method":"GET",
        "Path":"/payments/payments",
        "Input":[ 
         ],
        "InputContentType":"*/*",
        "OutputContentType":"*/*",
        "FaultContentType":"*/*",
        "Name":"listPayments"
      },
      { 
        "Method":"POST",
        "Path":"/payments",
        "Input":[ 
         ],
        "InputContentType":"*/*",
        "OutputContentType":"*/*",
        "FaultContentType":"*/*",
        "Name":"addPayment"
      },
      { 
        "Method":"DELETE",
        "Path":"/{path:.+|}",
        "Input":[ 
          { 
            "Name":"path",
            "Type":"path"
          }
        ],
        "InputContentType":"*/*",
        "OutputContentType":"*/*",
        "FaultContentType":"*/*",
        "Name":"deletePayment"
      }
    ]
  },
  "Endpoints":{ 
    "Endpoint":[ 
      { 
        "Uri":"http://acme-payments-api.10.1.20.137:9901/",
        "Category":"Production",
        "CName":"acme-payments-api.10.1.20.137",
        "DeploymentZoneRule":"1b16623b-1609-4664-9900-06f8441bdefault-http0"
      },
      { 
        "Uri":"http://acme-payments-api.10.1.20.137:9901/",
        "Category":"Sandbox",
        "CName":"acme-payments-api.10.1.20.137",
        "DeploymentZoneRule":"1b16623b-1609-4664-9900-06f8441bdefault-http0"
      }
    ]
  },
  "TargetAPI":{ 
    "Endpoints":{ 
      "Endpoint":[ 
        { 
          "Uri":"http://www.acmepayments.com/api",
          "Category":"Production"
        },
        { 
          "Uri":"http://www.acmepayments.com/apisb",
          "Category":"Sandbox"
        }
      ]
    },
    "Type":"shttp",
    "Operations":{ 
      "Operation":[ 
        { 
          "Method":"GET",
          "Path":"/payments/{paymentid}",
          "Input":[ 
            { 
              "Name":"paymentid",
              "Type":"path"
            }
          ],
          "InputContentType":"*/*",
          "OutputContentType":"*/*",
          "FaultContentType":"*/*",
          "Name":"getPayment"
        },
        { 
          "Method":"GET",
          "Path":"/payments/payments",
          "Input":[ 
           ],
          "InputContentType":"*/*",
          "OutputContentType":"*/*",
          "FaultContentType":"*/*",
          "Name":"listPayments"
        },
        { 
          "Method":"POST",
          "Path":"/payments",
          "Input":[ 
           ],
          "InputContentType":"*/*",
          "OutputContentType":"*/*",
          "FaultContentType":"*/*",
          "Name":"addPayment"
        },
        { 
          "Method":"DELETE",
          "Path":"/payments/{paymentid}",
          "Input":[ 
            { 
              "Name":"paymentid",
              "Type":"path"
            }
          ],
          "InputContentType":"*/*",
          "OutputContentType":"*/*",
          "FaultContentType":"*/*",
          "Name":"deletePayment"
        }
      ]
    },
    "Policies":{ 
      "Policy":[ 
       ]
    },
    "DefaultProfile":"Any in and out"
  },
  "Visibility":"Public",
  "State":"com.soa.api.state.open",
  "ProductionEndpointAccessAutoApproved":false,
  "SandboxEndpointAccessAutoApproved":true,
  "SandboxAnonymousAccessAllowed":false,
  "ProductionAnonymousAccessAllowed":false,
  "ResourceLevelPermissionsSupported":true,
  "Policies":{ 
    "Policy":[ 
     ]
  }
}

Request Headers

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

Header Description
Accept

application/json, application/xml

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

Content-Type

Any one of the following media types is valid for the request Content-Type:

application/json or application/xml

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

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

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

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
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.

Request Parameters

Parameter Parm Type Data Type Required Description
APIID Path string Required The unique ID for a specific API.
apiVersion Body APIVersion Required Includes information about an API version.

Response

If successful, this operation returns HTTP status code 200, with the complete API version object including APIVersionID.

Sample Response

The sample response below shows that the API version in the request example was added. The API version information is returned along with the APIVersionID.

Sample response headers

Status Code: 200 OK
Atmo-Renew-Token: renew
Content-Type: application/json
Date: Thu, 12 Feb 2015 20:29:19 GMT

Sample response body: application/json

{
  "APIVersionID" : "53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp",
  "APIID" : "7df17f3f-8ee2-4749-9719-52f5090c51da.acmepaymentscorp",
  "Name" : "Version 2",
  "Description" : "Major update.",
  "Type" : "shttp",
  "DefaultProfile" : "Any in and out",
  "Tag" : [ "payments", "ACME" ],
  "ProductionEndpoint" : "http://acme-payments-api.10.1.20.137:9901/",
  "SandboxEndpoint" : "http://acme-payments-api.10.1.20.137:9901/",
  "Operations" : {
    "Operation" : [ {
      "Name" : "getPayment",
      "Method" : "GET",
      "Path" : "/payments/{paymentid}",
      "InputContentType" : "*/*",
      "OutputContentType" : "*/*",
      "FaultContentType" : "*/*",
      "Input" : [ {
        "Name" : "paymentid",
        "Type" : "path"
      } ],
      "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
      "WsdlOperationName" : "getPayment"
    }, {
      "Name" : "listPayments",
      "Method" : "GET",
      "Path" : "/payments/payments",
      "InputContentType" : "*/*",
      "OutputContentType" : "*/*",
      "FaultContentType" : "*/*",
      "Input" : [ ],
      "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
      "WsdlOperationName" : "listPayments"
    }, {
      "Name" : "addPayment",
      "Method" : "POST",
      "Path" : "/payments",
      "InputContentType" : "*/*",
      "OutputContentType" : "*/*",
      "FaultContentType" : "*/*",
      "Input" : [ ],
      "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
      "WsdlOperationName" : "addPayment"
    }, {
      "Name" : "deletePayment",
      "Method" : "DELETE",
      "Path" : "/{path:.+|}",
      "InputContentType" : "*/*",
      "OutputContentType" : "*/*",
      "FaultContentType" : "*/*",
      "Input" : [ {
        "Name" : "path",
        "Type" : "path"
      } ],
      "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
      "WsdlOperationName" : "deletePayment"
    } ]
  },
  "Endpoints" : {
    "Endpoint" : [ {
      "CName" : "acme-payments-api.10.1.20.137",
      "Category" : "Production",
      "Uri" : "http://acme-payments-api.10.1.20.137:9901/",
      "DeploymentZoneRule" : "1b16623b-1609-4664-9900-06f8441bdefault-http0",
      "ConnectionProperties" : [ ]
    }, {
      "CName" : "acme-payments-api.10.1.20.137",
      "Category" : "Sandbox",
      "Uri" : "http://acme-payments-api.10.1.20.137:9901/",
      "DeploymentZoneRule" : "1b16623b-1609-4664-9900-06f8441bdefault-http0",
      "ConnectionProperties" : [ ]
    } ]
  },
  "Policies" : {
    "Policy" : [ ]
  },
  "TargetAPI" : {
    "Type" : "shttp",
    "DefaultProfile" : "Any in and out",
    "Endpoints" : {
      "Endpoint" : [ {
        "Category" : "Production",
        "Uri" : "http://www.acmepayments.com/api",
        "ConnectionProperties" : [ ]
      }, {
        "Category" : "Sandbox",
        "Uri" : "http://www.acmepayments.com/apisc",
        "ConnectionProperties" : [ ]
      } ]
    },
    "Operations" : {
      "Operation" : [ {
        "Name" : "getPayment",
        "Method" : "GET",
        "Path" : "/payments/{paymentid}",
        "InputContentType" : "*/*",
        "OutputContentType" : "*/*",
        "FaultContentType" : "*/*",
        "Input" : [ {
          "Name" : "paymentid",
          "Type" : "path"
        } ],
        "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
        "WsdlOperationName" : "getPayment"
      }, {
        "Name" : "listPayments",
        "Method" : "GET",
        "Path" : "/payments/payments",
        "InputContentType" : "*/*",
        "OutputContentType" : "*/*",
        "FaultContentType" : "*/*",
        "Input" : [ ],
        "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
        "WsdlOperationName" : "listPayments"
      }, {
        "Name" : "addPayment",
        "Method" : "POST",
        "Path" : "/payments",
        "InputContentType" : "*/*",
        "OutputContentType" : "*/*",
        "FaultContentType" : "*/*",
        "Input" : [ ],
        "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
        "WsdlOperationName" : "addPayment"
      }, {
        "Name" : "deletePayment",
        "Method" : "DELETE",
        "Path" : "/payments/{paymentid}",
        "InputContentType" : "*/*",
        "OutputContentType" : "*/*",
        "FaultContentType" : "*/*",
        "Input" : [ {
          "Name" : "paymentid",
          "Type" : "path"
        } ],
        "InterfaceQName" : "{uri:acmepaymentscorp}PortType_svc_53c1ef5a-3043-449f-be6f-8c2dd9da2393.acmepaymentscorp.sandbox",
        "WsdlOperationName" : "deletePayment"
      } ]
    },
    "Policies" : {
      "Policy" : [ ]
    }
  },
  "Visibility" : "Public",
  "State" : "com.soa.api.state.open",
  "ProductionEndpointAccessAutoApproved" : false,
  "SandboxEndpointAccessAutoApproved" : true,
  "SandboxAnonymousAccessAllowed" : false,
  "ProductionAnonymousAccessAllowed" : false,
  "ResourceLevelPermissionsSupported" : true
}

Response Headers

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

Header Description
Content-Type

application/json, application/xml

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

Atmo-Renew-Token renew

Response Body

Name Type Description
ApiVersion ApiVersion Includes information about an API version. The response includes the unique APIVersionID assigned to the API version that was added.

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
400 Bad request: Returned if the client sends a malformed request; for example, invalid parameters or body content.For example, you might get this response if you send malformed XML in your request, or if there is a typo in the URL.
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.
404 The resource could not be found. For example, you might get this if you include an invalid APIID in the request.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.