GET /api/apis/versions/{APIVersionID}/swagger/{SwaggerPath}

Returns the Swagger version 1.1 API document for the specified API version, showing the details for each operation, in JSON or XML format.

The file take the API name (service name).

Note: Do not use this operation. Instead, for all API description formats including Swagger 2.0, OAS 3.0, and others, use the GET /api/apis/versions/{APIVersionID}/definition/{Specification} operation.

Additional information:

Authorization Roles/Permissions: Must have Read permission for the resource.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/apis/versions/{APIVersionID}/swagger/{SwaggerPath}

Sample Request

The example below shows a request for the documentation for the follows service.

Sample Request URL

https://{hostname}/api/apis/versions/apiversion400.acmepaymentscorp/follows.json

Sample request headers

GET /api/apis/versions/apiversion400.acmepaymentscorp/validatePasswordResetCode.json HTTP/1.1
Host: {hostname}
Accept: application/json, text/javascript, */*; q=0.01
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

Not applicable.

Request Headers

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

Header Description
Accept application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, 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.
APIName Path string Required The name for the service or operaton for which you want the Swagger documentation.
SwaggerPath Path string Required The path for the Swagger document.
locale Query string Optional The locale applicable to the user requesting the content. For more information, see Supporting Multiple Languages.

Response

If successful, this operation returns HTTP status code 200, with information about the specified service or operation.

Sample Response

The sample response below shows information about the follows service, as requested in the sample request above.

Sample response headers: application/json

HTTP/1.1 200 OK
Date: Thu, 14 Feb 2013 15:10:30 GMT
Content-Type: application/json

Sample response body: application/json

{
  "apiVersion" : "1.0",
  "apis" : [ {
    "operations" : [ {
      "httpMethod" : "GET",
      "nickname" : "getFollowFDN",
      "parameters" : [ {
        "allowMultiple" : false,
        "dataType" : "string",
        "name" : "objectDN",
        "paramType" : "query",
        "required" : false
      }, {
        "allowMultiple" : false,
        "dataType" : "string",
        "name" : "userDN",
        "paramType" : "query",
        "required" : false
      } ],
      "responseClass" : "string"
    } ],
    "path" : "/follows/followobject"
  }, {
    "operations" : [ {
      "httpMethod" : "DELETE",
      "nickname" : "stopFollow",
      "parameters" : [ {
        "allowMultiple" : false,
        "dataType" : "string",
        "name" : "FollowID",
        "paramType" : "path",
        "required" : false
      } ],
      "responseClass" : "string"
    } ],
    "path" : "/follows/{FollowID}"
  }, {
    "operations" : [ {
      "httpMethod" : "POST",
      "nickname" : "follow",
      "responseClass" : "string"
    } ],
    "path" : "/follows"
  } ],
  "basePath" : "http://{hostname}/api",
  "resourcePath" : "/follows",
  "swaggerVersion" : "1.1"
}

Response Headers

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

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

Response Body

Name Type Description
apiVersion String The value specified for the API version in the API version definition.
apis api[ ]

An array of one or more elements representing an API. For each, an array of operations, with the following information for each:

  • httpMethod
  • nickname
  • parameters: an array of one or more parameters. For each, these values: allowMultiple, dataType, name, paramType, required.
  • responseClass
basePath String The base path for the API information returned in the response. The base path is the same for all operations and services for the API; for example, https://api.acmepaymentscorp.com/api.
resourcePath String The resource path for the API information returned in the response. The resource path is generally for a service (for example, /follows).
swaggerVersion String The Swagger version being used.

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.