POST /api/apis/{APIID}/versions

Adds a new API version on the platform; from scratch, based on an existing service, or based on an API description document.

You can add a new API version by:

  • Cloning the current version
  • Designing from scratch (REST APIs only)
  • Importing an API description document (Swagger, RAML, WSDL, or WADL)

The request format depends on the approach you choose. See examples below.

New in API Platform Version: 8.1

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

This topic includes the following sections:

HTTP Method

POST

Back to top

URL

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

Back to top

Sample Request

The examples below show adding a new API version.

Request URL

https://{hostname}/api/apis/b1d965dc-d560-416f-84af-0e60f1cbd199.acmepaymentscorp/versions

Sample request headers

POST /api/apis/b1d965dc-d560-416f-84af-0e60f1cbd199.acmepaymentscorp/versions HTTP/1.1
Host: acmepaymentscorp.com
Accept: application/vnd.soa.v81+json
Content-Type: application/vnd.soa.v81+json
X-Csrf-Token_acmepaymentscorp":"TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body #1: Cloning an existing API version

Creates a new API version by cloning the current version. If you're adding a new version by cloning, you must provide a request such as the below, with the new version name and the existing APIVersionID.

{
  "APIVersionInfo":{
    "Name":"Version 2"
  },
  "CloneAPIVersionRequest":{
    "SourceAPIVersionID":"3fe57310-5d69-4b50-ad77-dda703f20ff3.acmepaymentscorp",
    "CloneDesign":true,
    "CloneImplementations":true
  }
}

Sample request body #2: Designing from scratch

Creates a new API version by designing from scratch. You must provide a request such as the below, with the new version name. Then, update the API design using the PUT /api/apis/versions/{APIVersionID}/design operation.

{
  "APIVersionInfo":{
    "Name":"Version 2"
  },
  "AddAPIImplementationRequest":{
    "CreateMechanism":"PROXY"
  }
}

Sample request body #3: Importing an API description document

Creates a new API version by importing a new API description document. You must first upload the document using the POST /api/dropbox/readfiledetails operation, in the same way as when creating an API by uploading an API description document. Then, provide a request such as the below, with the new version name and the correct ServiceName, FileName, and DropboxFileId for the uploaded file.

{
  "DLDescriptor":{
    "ServiceDescriptorReference":{
      "ServiceName":"Account_Data_v1_Live",
      "FileName":"Account_Data_live.json",
      "DropboxFileId":1008
    }
  },
  "AddAPIImplementationRequest":{
    "CreateMechanism":"PROXY"
  },
  "APIVersionInfo":{
    "Name":"Version 2"
  }
}

Back to top

Request Headers

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

Header Description
Accept application/vnd.soa.v81+json, application/vnd.soa.v81+xml
Content-Type

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

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

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
APIID Path string Required The unique ID for a specific API.
AddAPIRequest Body AddAPIRequest Required

Contains information about a request to add an API or API version.

Required values vary according to the method being used to create the API version:

  • By cloning the current version
  • From scratch
  • By importing an API description document

Properties supported in the AddAPIImplementRequest (part of this object) when creating an API version are:

  • ImplementationCode
  • CreateMechanism (see CreateMechanism values)
  • ProxyImplementationRequest (if CreateMechanism is PROXY)

The DropboxFileId is returned by the POST /api/dropbox/readfiledetails operation which is run first to upload an individual or ZIP file, if the API version is being created by importing an API description document.

For examples showing the required fields for each scenario, see above.

Back to top

Response

If successful, this operation returns HTTP status code 200, with information about the new API version.

Back to top

Sample Response

The sample response below shows successful completion of this operation.

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

HTTP/1.1 200 OK
Date: Thu, 28 Apr 2016 15:40:00 GMT
Content-Type: application/vnd.soa.v81+json
Atmo-Renew-Token: renew

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

{
  "APIVersionID" : "e9bf5bd1-0e9a-4c7a-bbcb-de91c4cf57d2.acmepaymentscorp",
  "APIID" : "b1d965dc-d560-416f-84af-0e60f1cbd199.acmepaymentscorp",
  "Name" : "Version 2",
  "Environment" : "Production",
  "Visibility" : "Public",
  "Created" : "2016-04-28T15:40:01Z",
  "Updated" : "2016-04-28T15:40:03Z",
  "State" : "com.soa.api.state.open",
  "ProductionEndpointAccessAutoApproved" : true,
  "SandboxEndpointAccessAutoApproved" : false,
  "RatingSummary" : {
    "Five" : 0,
    "Four" : 0,
    "Three" : 0,
    "Two" : 0,
    "One" : 0
  },
  "SandboxAnonymousAccessAllowed" : false,
  "ProductionAnonymousAccessAllowed" : true,
  "ResourceLevelPermissionsSupported" : false,
  "APIOwnedImplementations" : true,
  "ProductionServiceKey" : "uddi:78ff6d0c-0d57-11e6-9fe3-c2371d568f6f",
  "APIDesign" : {
    "CommonDesign" : true,
    "DesignServiceKey" : "uddi:78169380-0d57-11e6-9fe3-c2371d568f6f"
  }
}

Back to top

Sample response headers: application/vnd.soa.v81+xml

HTTP/1.1 200 OK
Date: Thu, 28 Apr 2016 16:00:52 GMT
Content-Type: application/vnd.soa.v81+xml
Atmo-Renew-Token: renew
Set-Cookie: AtmoAuthToken_acmepaymentscorp=TokenID...

Sample response body: application/vnd.soa.v81+xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<APIVersion xmlns="http://soa.com/xsd/api/1.0" xmlns:ns2="http://soa.com/xsd/business/1.0" 
xmlns:ns3="http://soa.com/xsd/deploymentzone/1.0" xmlns:ns4="http://soa.com/xsd/asset/1.0" 
xmlns:ns5="http://soa.com/xsd/legals/1.0" xmlns:ns6="http://soa.com/xsd/dnmodel/1.0" 
xmlns:ns7="http://soa.com/xsd/resource/1.0">
    <APIVersionID>9f578a5a-0de4-4029-aa4c-fb63455d7919.acmepaymentscorp</APIVersionID>
    <APIID>b1d965dc-d560-416f-84af-0e60f1cbd199.acmepaymentscorp</APIID>
    <Name>Version 3</Name>
    <Environment>Production</Environment>
    <Visibility>Public</Visibility>
    <Created>2016-04-28T16:00:53Z</Created>
    <Updated>2016-04-28T16:00:55Z</Updated>
    <State>com.soa.api.state.open</State>
    <ProductionEndpointAccessAutoApproved>true</ProductionEndpointAccessAutoApproved>
    <SandboxEndpointAccessAutoApproved>false</SandboxEndpointAccessAutoApproved>
    <ns7:RatingSummary>
        <ns7:Five>0</ns7:Five>
        <ns7:Four>0</ns7:Four>
        <ns7:Three>0</ns7:Three>
        <ns7:Two>0</ns7:Two>
        <ns7:One>0</ns7:One>
    </ns7:RatingSummary>
    <SandboxAnonymousAccessAllowed>false</SandboxAnonymousAccessAllowed>
    <ProductionAnonymousAccessAllowed>true</ProductionAnonymousAccessAllowed>
    <ResourceLevelPermissionsSupported>false</ResourceLevelPermissionsSupported>
    <APIOwnedImplementations>true</APIOwnedImplementations>
    <ProductionServiceKey>uddi:632d751e-0d5a-11e6-9fe3-c2371d568f6f</ProductionServiceKey>
    <APIDesign>
        <CommonDesign>true</CommonDesign>
        <DesignServiceKey>uddi:61ecdfa2-0d5a-11e6-9fe3-c2371d568f6f</DesignServiceKey>
    </APIDesign>
</APIVersion>

Back to top

Response Headers

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

Header Description
Content-Type application/vnd.soa.v81+json, application/vnd.soa.v81+xml
Atmo-Renew-Token renew

Back to top

Response Body

Name Type Description
APIVersion APIVersion Includes information about an API version.

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.
404 The resource could not be found. For example, you might get this if you have a typo in the URL, or if the Accept header is set to a wrong value.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics