API Discovery

Summary

Provides a REST API for finding out information about the APIs which are been managed by the API Manager

Description

Provides a REST API for finding out information about the APIs which are been managed by the API Manager

Resources

Resource Since Version Description
GET /api/portal/v1.2/discovery/apis Lists all APIs/services virtualised in the API Server.
GET /api/portal/v1.2/discovery/oauthresources Gets a list OAuth protected resources and their associated scopes.
GET /api/portal/v1.2/discovery/scopes Retrieves every resource on the API Server that is protected by OAuth, and the scopes that cover those resources
GET /api/portal/v1.2/discovery/sdk/{name}/{type} Get the details of the SDK.
GET /api/portal/v1.2/discovery/sdk/{name}/{type} Generates an SDK package for the specified API based on the type of client requested
GET /api/portal/v1.2/discovery/swagger/api/{name} Retrieves an extended Swagger feed for the specified API.
GET /api/portal/v1.2/discovery/swagger/apis Convenience method for retrieving all Swagger feeds for all virtualised services.
GET /api/portal/v1.2/discovery/swagger/apis/{id}/image 1.1 Retrieves the API image
GET /api/portal/v1.2/discovery/swagger/apis/{id}/service-definition 1.2 Retrieves the service definition of the API.

GET /api/portal/v1.2/discovery/apis

Summary

Lists all APIs/services virtualised in the API Server.

Description

Lists all APIs/services virtualised in the API Server. API Administrators see all APIs/services. Users see APIs/services for their organization.

Parameters

none

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error

Returns Array

[ DiscoveryAPI ]

Example

GET https://localhost:8075/api/portal/v1.2/discovery/apis

Response
HTTP 1.1 200 OK

{
  "result" : [ {
    "name" : "vanGuide Vancouver Data",
    "summary" : "",
    "id" : "aa269358-d352-40f7-a268-393539332c29",
    "uri" : "http://localhost:8075/api/portal/v1.2/discovery/swagger/api/vanGuide+Vancouver+Data",
    "type" : "rest"
  }, {
    "name" : "Info",
    "uri" : "http://localhost:8075/api/portal/v1.2/discovery/swagger/api/Info",
    "type" : "wsdl"
  } ]
}


GET /api/portal/v1.2/discovery/oauthresources

Summary

Gets a list OAuth protected resources and their associated scopes.

Description

Gets a list OAuth protected resources and their associated scopes.

Parameters

none

Status Codes

HTTP Status Code Reason
200 OK

GET /api/portal/v1.2/discovery/scopes

Summary

Retrieves every resource on the API Server that is protected by OAuth, and the scopes that cover those resources

Description

Retrieves every resource on the API Server that is protected by OAuth, and the scopes that cover those resources. Only API Administrators will be able to retrieve information.

Parameters

none

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error

Returns Array

[ OAuthProtectedResource ]

Example

GET https://localhost:8075/api/portal/v1.2/discovery/scopes

Response
HTTP 1.1 200 OK

[ {
  "uriprefix" : "/api/oauth/protected",
  "scopes" : [ "resource.WRITE", "resource.READ" ]
} ]


GET /api/portal/v1.2/discovery/sdk/{name}/{type}

Summary

Get the details of the SDK.

Description

Gets the SDK package details for the specified API based on the type of client requested.

Parameters

Parameter Description Data Type Location Required Multiple
name The name of the API to generate the client SDK package for string path Required
type Generated client type, one of: Android, AngularJS, iOS, Java, NodeJS string path Required

Status Codes

HTTP Status Code Reason
200 OK
403 Forbidden
500 Internal Server Error

Return Value

application/json


GET /api/portal/v1.2/discovery/sdk/{name}/{type}

Summary

Generates an SDK package for the specified API based on the type of client requested

Description

Generates an SDK package for the specified API based on the type of client requested. API Administrators will always generate an SDK for the specified API. Users will only generate an SDK for the specified API if it is available for their organization

Parameters

Parameter Description Data Type Location Required Multiple
name The name of the API to generate the client SDK package for string path Required
type Generated client type, one of: Android, AngularJS, iOS, Java, NodeJS string path Required

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error

Return Value

application/octet-stream


GET /api/portal/v1.2/discovery/swagger/api/{name}

Summary

Retrieves an extended Swagger feed for the specified API.

Description

Retrieves an extended Swagger feed for the specified API. API Administrators will always see the API. Users will only see the API if it is available for their organization.If filename is supplied, the download will use it as the Content-Disposition filename attachment.

Parameters

Parameter Description Data Type Location Required Multiple
name The name of the API to return String path Required
filename Override the default filename for download String query
swaggerVersion The Swagger version of the feed, either 1.1 (default) or 2.0. String query

Status Codes

HTTP Status Code Reason
200 OK
400 Bad Request
500 Internal Server Error

Return Value

application/json

Example

GET https://localhost:8075/api/portal/v1.2/discovery/swagger/api/vanGuide+Vancouver+Data

Response
HTTP 1.1 200 OK

{
  "result" : {
    "apiVersion" : "0.1",
    "swaggerVersion" : "1.1",
    "basePaths" : [ "http//localhost:8080" ],
    "resourcePath" : "/vancouver",
    "description" : "",
    "name" : "vanGuide Vancouver Data",
    "id" : "aa269358-d352-40f7-a268-393539332c29",
    "securityProfile" : null,
    "apis" : [ {
      "path" : "/libraries",
      "description" : "API on path /libraries",
      "operations" : [ {
        "id" : "eb5cdb36-fac6-44c8-986e-8909bf48fcbc",
        "httpMethod" : "GET",
        "nickname" : "Get Libraries",
        "responseClass" : null,
        "parameters" : [ {
          "paramType" : "query",
          "name" : "areaCode",
          "description" : "Vancouver area code of the libraries you wish to retrieve",
          "dataType" : "string",
          "required" : false,
          "allowableValues" : null
        }, {
          "paramType" : "query",
          "name" : "openWeekends",
          "description" : "Flag specifying whether or not the library is open at weekends. Default is 'true'",
          "dataType" : "boolean",
          "required" : true,
          "allowableValues" : null
        }, {
          "paramType" : "query",
          "name" : "blah",
          "description" : "This is a really really really long comment just to see what it looks like when rendered in the UI. Hopefully it doesnt look too bad. Actually, might be worth allowing markdown as a description here :)",
          "dataType" : "string",
          "required" : false,
          "allowableValues" : null
        }, {
          "paramType" : "query",
          "name" : "zzz",
          "description" : "zzz",
          "dataType" : "string",
          "required" : true,
          "allowableValues" : null
        }, {
          "paramType" : "query",
          "name" : "zebra",
          "description" : "Striped animal from the plains of Africa",
          "dataType" : "string",
          "required" : false,
          "allowableValues" : null
        }, {
          "paramType" : "query",
          "name" : "Aardvark",
          "description" : "Will I be first in the list?",
          "dataType" : "string",
          "required" : true,
          "allowableValues" : null
        } ],
        "summary" : "",
        "notes" : "",
        "securityProfile" : null,
        "errorResponses" : [ {
          "code" : 401,
          "reason" : "Unauthorized"
        }, {
          "code" : 403,
          "reason" : "Forbidden"
        } ]
      } ]
    }, {
      "path" : "/%24metadata",
      "description" : "API on path /$metadata",
      "operations" : [ {
        "id" : "828e0392-8a1d-46c2-9b5d-a32510337e05",
        "httpMethod" : "GET",
        "nickname" : "$metadata",
        "responseClass" : null,
        "parameters" : [ ],
        "summary" : "",
        "notes" : "",
        "securityProfile" : null,
        "errorResponses" : [ ]
      } ]
    } ]
  }
}


GET /api/portal/v1.2/discovery/swagger/apis

Summary

Convenience method for retrieving all Swagger feeds for all virtualised services.

Description

Convenience method for retrieving all Swagger feeds for all virtualised services that are visible to the authenticated user. The list of APIs can be filtered using the expression: field=__field__&op=__op__&value=__value__. Optionally, you can add a logical operation for all expressions, using the form: &lop=AND|OR. By default, the logical operation is AND. Multiple expression filters can be used, specifying field, op, and value for each filter. The field is one of:

id
Matches the API by the specified ID
name
Matches the API by the specified name
description
Matches the API by the specified description
summary
Matches the API by the specified summary
version
Matches the API by the specified version
type
Matches the API by the specified type. Type can be 'rest' or 'wsdl'
resourcepath
Matches the API by the specified inbound path
taggroup
Matches the API by the specified tag group
tag
Matches the API by the specified tag value
methodtaggroup
Matches the API by the specified method tag group, i.e. if the API contains a method that contains a tag group matching that specified
methodtag
Matches the API by the specified method tag value, i.e. if the API contains a method that contains a tag value matching that specified

The op is an operation and is one of:

eq
Equal
ne
Not equal
gt
Greater than
lt
Less than
ge
Greater than or equal
le
Less than or equal
like
Like
gete
Greater than or equal to, and less than or equal to; the value should be a lower-minimum and upper-maximum separated by comma, e.g: value=5,10

The value will be compared against the field, according to the supplied op.

Parameters

Parameter Description Data Type Location Required Multiple
swaggerVersion The Swagger version string query

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error

Return Value

application/json


GET /api/portal/v1.2/discovery/swagger/apis/{id}/image

Summary

Retrieves the API image

Description

none

Since

1.1

Parameters

Parameter Description Data Type Location Required Multiple
id The API identifier string path Required

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error

GET /api/portal/v1.2/discovery/swagger/apis/{id}/service-definition

Summary

Retrieves the service definition of the API.

Description

none

Since

1.2

Parameters

Parameter Description Data Type Location Required Multiple
id The API identifier string path Required

Status Codes

HTTP Status Code Reason
200 OK
500 Internal Server Error