Beta Release of SmartDocs

The Beta release of SmartDocs lets you try the Apigee Edge management APIs. How does it work?

1. In the Resource URL, replace any values enclosed in "{}", such as your organization name.
2. Set the Basic Authentication credentials. These are your Edge credentials (user must be in the Org Admin role).
3. Select Send this request to send the live request to Edge and to view the response.

Resource Summary

Auth Type

BASICAUTH,

Content Type

application/json, text/xml

Category

OAuth 2.0 Access Token,

retrieveOAuth2AccessTokenbyEndUserIDorAppID

GET

Get OAuth 2.0 Access Token by End User ID or App ID

Retrieves an OAuth 2.0 access token by end user ID, app ID, or both. Only users with the orgadmin or opsadmin role assigned can make this call.

Full use of this API call requires some setup. See Enable retrieval and revocation of OAuth 2.0 access tokens by end user ID, app id, or both.

Resource URL

https://api.enterprise.apigee.com/v1 /organizations/{org_name}/oauth2/search

    Query Parameters

  • Name
    Value
    Description
  • enduser
    Use to retrieve OAuth 2.0 access tokens associated with a specific end user. This is an end user of one of your developer apps. This value is not required, but you must query by either enduser or app.
  • app
    Use to retrieve OAuth 2.0 access tokens associated with a specific developer app ID (UUID). This is an app developed by one of your developers. This value is not required, but you must query by either enduser or app.
  • limit
    Use to set the number of OAuth 2.0 access token results you want to display per “page,” or list, of results. Set this parameter if you have many results and want to paginate them, but don’t want to use the default limit of 10.

    Note: You cannot retrieve more results that the number defined by the oauth_max_search_limit property in your keymanagement.properties files for your management server and message processor.
  • start
    When the number of access tokens returned exceeds the limit value, use start to navigate the multiple pages, or lists of results.

    For usage details, see "Use start and next to Navigate Through Multiple Pages of Results" below.

org_name Mention the organization name true

Basic Auth

OAuth 2

Custom Token

Reset

Make a request and see the response.

Make a request and see the response.

Response Payload Elements

Name Description
list Provides the OAuth 2.0 access code for the end user ID and/or app ID defined in the request.
totalResults Provides the total number of OAuth 2.0 access codes associated with the specified end user ID.
next When the number of access tokens returned exceeds the limit defined in the query parameters, next displays the value of the next access token to be displayed in the list. Use this value to navigate through multiple "pages," or lists of results.

For usage details, see "Use start and next to Navigate Through Multiple Pages of Results" below.

Use start and next to Navigate Through Multiple Pages of Results

When the number of access tokens returned exceeds the limit defined in the query parameters, you will have multiple "pages," or lists, of access token results to scroll through. Use the start query parameter and next response payload element to navigate through the results.

For example, let's say your first call returns the following response payload:

{
"list" : [ "0XXX0wX4vX43lXXXX4f8e3504oXX", "0oXzhtXdXX8kXgeXv22zv7bXXdj4", (...+8 more)],
"meta" : {
"limit" : 10,
"next" : "3gwbXXX2thXXzX7XXdyOblXtXyXX",
"query" : {
"endUser" : "{enduser}"
},
"start" : "",
"totalResults" : 100
}
}

Note that the request limited the results returned per page, or list, to 10 and that the total number of results is 100. You need a way to navigate through nine more pages of results to see all 100 results.

To do this, make another call with the next value in bold above as the start query parameter as shown in bold below. The request URL may look something like this:

https://api.enterprise.apigee.com/v1/o/{org-name}/oauth2/search?enduser={enduser}&start=3gwbXXX2thXXzX7XXdyOblXtXyXX&limit=10

See the response payload below:

{
"list" : [ "3gwbXXX2thXXzX7XXdyOblXtXyXX", "482XXv8XfXiouXvcXq6geXXkXXXX", (...+8 more)],
"meta" : {
"limit" : 10,
"next" : "Xa8mXidgXXtXXXcXnX8XXeXgXX6X",
"query" : {
"endUser" : "{enduser}"
},
"start" : "3gwbXXX2thXXzX7XXdyXblXtXyXX",
"totalResults" : 100
}
}

Note that this next page of 10 results shown above starts with the access token requested by the start parameter. To see the next 10 results, make the same call, just using the next value in bold above as the start value as shown in bold below:

https://api.enterprise.apigee.com/v1/o/{org-name}/oauth2/search?enduser={enduser}&start=Xa8mXidgXXtXXXcXnX8XXeXgXX6X&limit=10

You can page through each set of results by repeating this pattern of calls.
application/xml

Response Error Details

  • HTTP Code
    Error Code
    Description
  • 400 Bad Request
    keymanagement.service. app_id_not_found
    An app ID provided in the query parameters was not found.
  • 400 Bad Request
    keymanagement.service. parameters_missing
    An end user ID provided in the query parameters was not found.
  • 400 Bad Request
    keymanagement.service. InvalidValueForLimitParam
    The limit value provided in the query parameters exceeds the value of the oauth_max_search_limit property defined in your keymanagement.properties files for your management server and message processor.

Working...

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)