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.
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
URL
https://{hostname}/api/apis/{APIID}/versions
Sample Request
The examples below show adding a new API version.
Sample 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, with CloneDesign set to true.
To view the response, see Sample response body #1.
{ "APIVersionInfo": { "Name": "Version 2 (clone)", "Visibility": "Public" }, "CloneAPIVersionRequest": { "SourceAPIVersionID": "d10b9d83-260a-437e-b929-5d756f510090.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" } }
Sample request body #4: Specifying privacy on a new version
Valid in version: 2020.1.0 and later.
The example below adds an API version, specifying only the following:
- Version name: V3 (new version from file, private visibility)
- Visibility of Limited (in the user interface, Private)
Note: In this example, the original version has a visibility of Public and the new version has a visibility of Limited.
To view the response, see Sample response body #2.
{ "AddAPIImplementationRequest":{ "CreateMechanism":"PROXY" }, "DLDescriptor":{ "ServiceDescriptorReference":{ "ServiceName":"Swagger_Petstore_5_Operations", "FileName":"swagger_petstore_5_operations.json", "DropboxFileId":1158 } }, "APIVersionInfo":{ "Name":"V3 (new version from file, private visibility)", "Visibility":"Limited" } }
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 |
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. |
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:
Properties supported in the AddAPIImplementRequest (part of this object) when creating an API version are:
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. |
Response
If successful, this operation returns HTTP status code 200, with information about the new API version.
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: Wed, 11 Nov 2020 15:19:58 GMT Content-Type: application/vnd.soa.v81+json Atmo-Renew-Token: renew
Sample response body #1 (response to Sample request body #1)
Valid in version: 2020.2.0 and later.
Successful response for creating a new version by cloning an existing version.
{ "APIVersionID" : "8acefc82-4307-4f02-975d-fd972cc1f34c.acmepaymentscorp", "APIID" : "0aeddfaf-be1b-4c19-8081-a445725b1270.acmepaymentscorp", "Name" : "v2 (cloning an API that has policies)", "Environment" : "Production", "Tag" : [ ], "ProductionEndpointOAuthDetailsList" : [ ], "SandboxEndpointOAuthDetailsList" : [ ], "Endpoints" : { "Endpoint" : [ { "Category" : "Production", "Uri" : "http://10.250.24.9:7905/api17080live", "CName" : "10.250.24.9", "DeploymentZoneRule" : "9d5d-ffd4-4e6a-9334-bd850387eed9default-http0", "ConnectionProperties" : [ { "Name" : "virtualHost", "Value" : "10.250.24.9" }, { "Name" : "gateway_hostname", "Value" : "10.250.24.9" }, { "Name" : "visibility", "Value" : "public" } ], "BindingQName" : "{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_Binding_0_0", "BindingType" : "binding.http", "EndpointKey" : "uddi:f9bd764f-8f09-4176-8997-792494dcb41d", "EndpointImplementationDetails" : { "DeploymentZoneEndpoint" : { "DeploymentZoneID" : "1c64704a-03cd-46c4-ba07-3786f8f82a8c.acmepaymentscorp", "EndpointKey" : "uddi:f9bd764f-8f09-4176-8997-792494dcb41d", "ListenerName" : "default-http0", "ContainerKey" : "9d5d-ffd4-4e6a-9334-bd850387eed9", "GatewayHostName" : "10.250.24.9", "GatewayHostPath" : "/", "EndpointHostName" : "10.250.24.9", "EndpointPath" : "/api17080live", "Protocol" : "http", "Path" : "/api17080live", "Url" : "http://10.250.24.9:7905/api17080live", "BindingQName" : "{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_Binding_0_0", "BindingType" : "binding.http", "Public" : true } }, "ImplementationCode" : "Live" } ] }, "Visibility" : "Public", "Created" : "2020-11-11T16:24:32Z", "Updated" : "2020-11-11T16:24:33Z", "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:d49168c1-f104-4fbe-be6b-d6de9f13a42f", "APIDesign" : { "BindingType" : [ "binding.http" ], "CommonDesign" : true, "DesignServiceKey" : "uddi:466c544d-d498-4f85-a53a-da210f92855c" }, "Links" : [ ] }
Sample response body #2 (response to Sample request body #4)
Valid in version: 2020.1.0 and later.
Successful response for adding an API version, specifying a custom visibility setting.
{ "APIVersionID":"04cd3067-768e-4f52-a243-645d6f6a9ea2.acmepaymentscorp", "APIID":"0aeddfaf-be1b-4c19-8081-a445725b1270.acmepaymentscorp", "Name":"V3 (new version from file, private visibility)", "Description":"Swagger_Petstore_5_Operations. Based on http://petstore.swagger.io/v2/swagger.json with deletions in API Designer.", "Environment":"Production", "Tag":[ ], "ProductionEndpointOAuthDetailsList":[ ], "SandboxEndpointOAuthDetailsList":[ ], "Endpoints":{ "Endpoint":[ { "Category":"Production", "Uri":"http://10.250.24.9:7905/api17077live", "CName":"10.250.24.9", "DeploymentZoneRule":"9d5d-ffd4-4e6a-9334-bd850387eed9default-http0", "ConnectionProperties":[ { "Name":"virtualHost", "Value":"10.250.24.9" }, { "Name":"gateway_hostname", "Value":"10.250.24.9" }, { "Name":"visibility", "Value":"public" } ], "BindingQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_Binding_1", "BindingType":"binding.http", "EndpointKey":"uddi:120d6ef9-87d6-4935-9675-11c5a8d03817", "EndpointImplementationDetails":{ "DeploymentZoneEndpoint":{ "DeploymentZoneID":"1c64704a-03cd-46c4-ba07-3786f8f82a8c.acmepaymentscorp", "EndpointKey":"uddi:120d6ef9-87d6-4935-9675-11c5a8d03817", "ListenerName":"default-http0", "ContainerKey":"9d5d-ffd4-4e6a-9334-bd850387eed9", "GatewayHostName":"10.250.24.9", "GatewayHostPath":"/", "EndpointHostName":"10.250.24.9", "EndpointPath":"/api17077live", "Protocol":"http", "Path":"/api17077live", "Url":"http://10.250.24.9:7905/api17077live", "BindingQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_Binding_1", "BindingType":"binding.http", "Public":true } }, "ImplementationCode":"Live" } ] }, "Visibility":"Limited", "Created":"2020-11-11T16:15:50Z", "Updated":"2020-11-11T16:15:52Z", "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:81239d77-e40f-46ae-87ea-e42e7f2316a6", "APIDesign":{ "BindingType":[ "binding.http" ], "CommonDesign":true, "DesignServiceKey":"uddi:0724434d-cb09-4401-b947-20c5a4258f26" }, "Links":[ ] }
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 |
Response Body
Name | Type | Description |
---|---|---|
APIVersion | APIVersion | Includes information about an API version. |
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.