• Register

fetchUserApplications

Description

Fetches the applications with access tokens for the given user.

Syntax

oauth2.fetchUserApplications (service_key, user_context)

Parameters

Parameter Type Description
service_key string The id of the OAuth 2.0 protected service definition
user_context string Provider-defined user context identifier
token_status string Type of tokens to return (active/inactive/all). Default: all, which returns all access tokens attached to the application for the user. A value of "active" only returns active tokens and status of "inactive" only returns inactive tokens

Return Value

[
 {
  "id": <Mashery application ID: integer>,
  "name": <application name: string>,
  "client_id": <developer API key: string>,
  "access_tokens": [
   <access token: string>*
  ]
 }*
]

Errors

Standard JSON-RPC errors.

Sample Requests and Responses

Sample Request (Ordered Parameters)

{
   "method":"oauth2.fetchUserApplications",
   "params":[
      "rmeqcgpw3zu2y47y9bs8vs2h",
      "qrqefasdfjp98"
   ],
   "id":1
}

Sample Request (Named Parameters)

 

{
   "jsonrpc":"2.0",
   "method":"oauth2.fetchUserApplications",
   "params":{
      "service_key":"rmeqcgpw3zu2y47y9bs8vs2h",
      "user_context":"qrqefasdfjp98"
   },
   "id":1
}

Sample Response

 

{
   "result":[
      {
         "id":12345,
         "name":"OAuth 2.0 Test App",
         "client_id":"r3qwqesr223dfdasd",
         "access_tokens":[
            "SlAV32hkKG",
            "AkEfi83Dmx"
         ]
      }
   ],
   "error":null,
   "id":1
}

Docs Navigation