List Applications

Resource

oauth.listuserapplications

Description

Fetches a list of applications based on user token.

Request Parameters

Parameter Description
spkey (required) The service provider key assigned by Mashery
user_token (required) Token representing a specific user.

Response Parameters

Parameters for Each Result
Description
name Application name as entered by consumer
description
Description of the application as entered by consumer
uri Location of the application as entered by consumer
createdbyname Display name of the developer that created this application
created Date the application was created
access_tokens An array of oath access tokens for this application and service
access_token Oauth access token
consumer_spkey Service provider id that the application was registered under
consumer_key The consumer key associated with this application

Examples

JSON Request

 

{
      "method": "oauth.listuserapplications", 
      "params": [
            {
                  "spkey": "c7sdsd8xmenyvtr8ws6jqbn6b", 
                  "properties": {
                        "user_token": "T1MkAIO9uSEz5n31u8jCffjQ3p_snQP0ddaBgM~TmzJ2Q-"
                  }
            }
      ], 
      "id": 1
}

 

JSON Response

{
      "result": [
            {
                  "name": "Johnsmith Test", 
                  "description": "test app", 
                  "uri": "", 
                  "created": "2008-06-16T16:05:47", 
                  "createdbyname": "johnsmith", 
                  "access_tokens": [
                        {
                              "access_token": "T1aWIABCkEbP_VbcXOl.xKHtpDpcN4f4xYh1SKj2MUn6tQlJeiQlt5YfwMrrshWP7yi7f.SHnVDllR9rGM_QAIdg--", 
                              "consumer_spkey": "dfg7ygdsqu77hukwgzdde3u4", 
                              "consumer_key": "3d567cqhthcbkkpcyxqzhg97"
                        }, 
                        {
                              "access_token": "T1FGHvXnHdObyobHpiKhHSf_mT8BZqfcJK7m22j.jCxRJZsYqFAYeF8_wgX_1LoZJdGLbaPhiQemd4pvcymxRjWw--", 
                              "consumer_spkey": "FFG7ygdsqu77hukwgzdde3u4", 
                              "consumer_key": "6d457cqhthcbkkpcyxqzhg97"
                        }, 
                        {
                              "access_token": "T1ZmpPqxMh1qDCO7SDF61eWYBgQyfOl0TjVOLeyIFMSTbMWUDCyKQOfyY5Nb7XTiWdYzKzWhICwPYrPNOEeQw2qA--", 
                              "consumer_spkey": "FFG7ygdsqu77hukwgzdde3u4", 
                              "consumer_key": "6d457cqhthcbkkpcyxqzhg97"
                        }
                  ]
            }
      ], 
      "error": null, 
      "id": 1
}
PHP Sample Code

 

<?php

// acme developer key to access Mashery APIs
$key = 'ww3457dpabc9rb97zrmj4efv';
$secret = '9T56yxBJ';

// acme service to make calls upon
$spkey = 'ndfxx8xmenyvtr8ws6jqbn6b';

// User to list apps for
$user_token = 'B1AIO9uSEz5n31u8sDFGHsQ3p_snQP0ppcBgM~TmzJ2Q-';

$sig = hash('md5', $key . $secret . time());
$url = "http://api.mashery.com/services/jsonrpc?apikey={$key}&sig={$sig}&mashery_area=acme";

$call = array(
    'method' => 'oauth.listuserapplications',
    'params' => array(array('spkey' => $spkey, 'properties' => array("user_token" => $user_token))),
    'id' => 1
);

$jcall = json_encode($call);

print $jcall;

echo "\n";

$req = new HttpRequest($url, HttpRequest::METH_POST);

$req->setBody($jcall);
$req->setContentType('application/json');

$msg = $req->send();

print_r($msg);

 

token representing a specific user

Docs Navigation