PUT /api/apis/versions/{APIVersionID}/design

Updates an API version by providing an update to the API description.

Authorization Roles/Permissions: Must be logged in. Must have permission to modify the API; an API Admin or Business Admin.

This topic includes the following sections:

HTTP Method

PUT

URL

https://{hostname}/api/apis/versions/{APIVersionID}/design

Sample Request

The example below shows a request to modify the design for the specified API version.

Sample Request URL

https://{hostname}/api/apis/versions/4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp/design

Sample request headers

PUT /api/apis/versions/4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp/design HTTP/1.1
Host: {hostname}
Accept: application/vnd.soa.v81+json, */*; q=0.01
Content-Type: application/vnd.soa.v81+json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

{"DLContent":"{\"tags\":[],\"swagger\":\"2.0\",\"info\":{\"title\":\"Crest\",\"version\":\"v1\"},\"host
\":\"api11192live.acmepaymentscorp.com\",\"basePath\":\"/\",\"schemes\":[\"http\",\"http\"
,\"http\"],\"paths\":{\"/{db}/{collection}\":{\"get\":{\"parameters\":[{\"required\":false,\"allowEmptyValue
\":\"false\",\"in\":\"query\",\"name\":\"filter\",\"description\":\"To query\",\"type\":\"string\"},
{\"required\":false,\"allowEmptyValue\":\"false\",\"in\":\"query\",\"name\":\"query\",\"description\"
:\"query collection\",\"type\":\"string\"},{\"required\":false,\"allowEmptyValue\":\"false\",\"in\":
\"query\",\"name\":\"limit\",\"description\":\"Adds limit on row results\",\"type\":\"integer\"},{\"required
\":false,\"allowEmptyValue\":\"false\",\"in\":\"query\",\"name\":\"skip\",\"description\":\"To Skip\"
,\"type\":\"integer\"},{\"required\":true,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"collection
\",\"type\":\"string\"},{\"required\":false,\"allowEmptyValue\":\"false\",\"in\":\"query\",\"name\":
\"filter_count\",\"description\":\"To count a collection\",\"type\":\"string\"}],\"produces\":[\"application
/xml\",\"application/json\"],\"tags\":[\"svc_4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp.live.virtual
\"],\"operationId\":\"GET collection\",\"responses\":{\"200\":{\"schema\":{},\"description\":\"\"}},
\"deprecated\":false,\"description\":\"Gets a collection\",\"summary\":\"Gets a collection\"},\"post
\":{\"parameters\":[{\"required\":true,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"collection
\",\"type\":\"string\"},{\"required\":false,\"allowEmptyValue\":\"false\",\"in\":\"body\",\"name\":\"body
\"}],\"consumes\":[\"application/json\"],\"tags\":[\"svc_4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp
.live.virtual\"],\"operationId\":\"POST_db_collection_\",\"responses\":{\"201\":{\"schema\":{},\"description
\":\"Succesfully created a new resource\"}},\"deprecated\":false}},\"/{db}/{collection}/{id}\":{\"get
\":{\"parameters\":[{\"required\":true,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"collection
\",\"type\":\"string\"},{\"required\":true,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"id
\",\"type\":\"string\"}],\"produces\":[\"application/json\"],\"tags\":[\"svc_4635e7cf-7c19-48bc-aaa1-4afc8dccaeee
.acmepaymentscorp.live.virtual\"],\"operationId\":\"GET_db_collection_id_\",\"responses\":{\"200\":{
\"schema\":{},\"description\":\"\"}},\"deprecated\":false},\"put\":{\"parameters\":[{\"required\":true
,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"collection\",\"type\":\"string\"},{\"required
\":true,\"allowEmptyValue\":\"false\",\"in\":\"path\",\"name\":\"id\",\"type\":\"string\"}],\"produces
\":[\"application/json\"],\"tags\":[\"svc_4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp.live.virtual
\"],\"operationId\":\"PUT_db_collection_id_\",\"responses\":{\"204\":{\"schema\":{},\"description
\":\"\"}},\"deprecated\":false},\"delete\":{\"parameters\":[{\"required\":true,\"allowEmptyValue\":\"false
\",\"in\":\"path\",\"name\":\"collection\",\"type\":\"string\"},{\"required\":true,\"allowEmptyValue
\":\"false\",\"in\":\"path\",\"name\":\"id\",\"type\":\"string\"}],\"produces\":[\"application/json\"
],\"tags\":[\"svc_4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp.live.virtual\"],\"operationId\":\"DELETE_db_collection_id_
\",\"responses\":{\"204\":{\"schema\":{},\"description\":\"\"}},\"deprecated\":false}}},\"definitions
\":{},\"securityDefinitions\":{}}"}

Request Headers

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

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

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

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

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
APIVersionID Path String Required The unique ID for a specific API version.
DLDescriptor Body DLDescriptor Required

Contains information about the API description provided to define or update an API using an API description document such as a Swagger 2.0, RAML, WADL, or WSDL document.

The DLDescriptor can either be a Dropbox ID or the API definition content. If the uploaded file is a ZIP file, it could include FileName and/or Service Name in the ServiceDocumentReference parameter.

Response

If successful, this operation returns HTTP status code 200, with information about the updated API including the 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: Fri, 04 Mar 2016 02:08:42 GMT
Content-Type: application/vnd.soa.v81+json

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

{
  "APIID" : "29967a71-0c1a-4433-bc03-87bf7a9b1696.acmepaymentscorp",
  "Name" : "Crest",
  "Visibility" : "Public",
  "LatestVersionID" : "4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp",
  "RatingSummary" : {
    "Five" : 0,
    "Four" : 0,
    "Three" : 0,
    "Two" : 0,
    "One" : 0
  },
  "APIVersion" : {
    "APIVersionID" : "4635e7cf-7c19-48bc-aaa1-4afc8dccaeee.acmepaymentscorp",
    "APIID" : "29967a71-0c1a-4433-bc03-87bf7a9b1696.acmepaymentscorp",
    "Name" : "v1",
    "Environment" : "default",
    "Visibility" : "Public",
    "Created" : "2016-03-04T02:00:51Z",
    "Updated" : "2016-03-04T02:00:51Z",
    "State" : "com.soa.api.state.open",
    "ProductionEndpointAccessAutoApproved" : false,
    "SandboxEndpointAccessAutoApproved" : true,
    "RatingSummary" : {
      "Five" : 0,
      "Four" : 0,
      "Three" : 0,
      "Two" : 0,
      "One" : 0
    },
    "SandboxAnonymousAccessAllowed" : false,
    "ProductionAnonymousAccessAllowed" : false,
    "ResourceLevelPermissionsSupported" : false,
    "APIOwnedImplementations" : true,
    "ProductionServiceKey" : "uddi:ec5adc1c-e1ac-11e5-b291-974f3487303d"
  },
  "AdminGroupID" : "apiadmin-29967a71-0c1a-4433-bc03-87bf7a9b1696.acmepaymentscorp",
  "Created" : "2016-03-04T02:00:51Z",
  "Updated" : "2016-03-04T02:00:51Z"
}

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

Updates the design by uploading an updated API description document to the Dropbox.

{
  "ServiceDescriptorReference":{
    "ServiceName":"Swagger_Petstore",
    "FileName":"swagger_petstore.json",
    "DropboxFileId":1023
  }
}

Response Headers

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

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

Response Body

Name Type Description
API API Contains information about an API.

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

More information about Akana API Platform API error messages.