Google Apps Marketplace CustomerLicense Authorization Steps ?

114 views Asked by At

We have recently create the google marketplace app and published as public .admin of the google apps domain users can able to install it . i recently try to implement the CustomerLicense,LicenseNotification Apis in for my app But i dont know how to send a Authorization for it Please suggest me to how to do this

My requirement : 1.I need to know whether the given domain has installed my marketplace app or not (My input is authorization,email id or domain name 2.If any user uninstall or revoke the data access for my marketplace app i need to get the notify (optional)

Here is sample code :

$appId = '';**//Where i get this** 
$userid = '';**//It is emailid or domain name or user unique numeric id**/
$oauthOptions = array(
    'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
    'signatureMethod' => 'HMAC-SHA1',
    'consumerKey' => '', **//Where i get this** 
    'consumerSecret' => ""  **//Where i get this** 
 );
//We get from APP URL
try {
    $userid = 'backup-testing.in';
    $token = new Zend_Oauth_Token_Access();
    $client = $token->getHttpClient($oauthOptions);
    $url = "https://www.googleapis.com/appsmarket/v2/customerLicense/$appId/$userid";
    $client->setMethod(Zend_Http_Client::GET);
    $gdata_put = new Zend_Gdata($client);
    $resultR = $gdata_put->get($url);
} catch (Exception $e) {
    var_dump($e);
}

This is my marketplace app in chrome westore : https://chrome.google.com/webstore/detail/gapps-backup/jmjnfmekbahcminibjmedfehecoihglj

1

There are 1 answers

0
Gerardo On

Here you can find information about the Licensing API https://developers.google.com/google-apps/marketplace/v2/developers_guide which i think will be useful for what you want to do. hope it helps.