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).

Additional information:

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

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

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

Back to top

Sample Request

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

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_{tenant}: {TokenID}

Sample request body

Not applicable.

Back to top

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

Back to top

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.

Back to top

Response

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

Back to top

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"
}

Back to top

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

Back to top

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.

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

More information about Akana API Platform API error messages.

Back to top

Related Topics