2013-09-28 3 views
0

구독 목록 또는 사용자 목록을 검색하는 동안 모든 데이터를 Google의 자체 비즈니스 시스템과 동기화하는 데 문제가 있습니다.Google Apps API - 구독 또는 사용자 목록 얻기

{ 
"error": { 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "conditionNotMet", 
    "message": "Provisioning API is disabled for your domain. Please enable it in your Google Apps Control Panel.", 
    "locationType": "header", 
    "location": "If-Match" 
    } 
    ], 
    "code": 412, 
    "message": "Provisioning API is disabled for your domain. Please enable it in your Google Apps Control Panel." 
} 
} 

나는 구글 PHP 라이브러리를 사용하고, 이것은 기본적으로 구글의 예제 라이브러리에서 약간 변형 예이다 내가 사용하고있는 코드입니다.

$client->setScopes(array(
    'https://www.googleapis.com/auth/apps.order', // As required by the google api docs for /subscription 
)); 

/** 
* Google's own example code 
*/ 
if (isset($_GET['code'])) { 
    $client->authenticate(); 
    $_SESSION['access_token'] = $client->getAccessToken(); 
    $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 
    header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); 
} 

if (isset($_SESSION['access_token'])) { 
    $client->setAccessToken($_SESSION['access_token']); 
} 

if ($client->getAccessToken()) { 
     $url = 'https://www.googleapis.com/apps/reseller/v1'; 
     //$url = 'https://www.googleapis.com/apps/reseller/v1sandbox/'; // sandbox mode overwrite 
     $req = new Google_HttpRequest($url .'/subscriptions', 'GET'); 
     $resp = $client::getIo()->authenticatedRequest($req); 
     print "<h1>Subscriptions</h1>: <pre>" . $resp->getResponseBody() . "</pre>"; 

프로비저닝 API는 사용되지 않습니다 나는, 나는 내가 프로비저닝 (Provisioning) API의 오류가있는 이유 누군가가 알고있을 바라고 여기 부탁 해요 내 문제에 대한 해결책을 찾는 데에 실패 해요입니다.

답변

0

제어판에서 API 액세스를 사용 설정하면 오류 설명에 표시됩니다.

제어판 -> otehr controls -> security -> api reference -> API 액세스 허용.

동일한 작업을 수행하고 불충분 한 권한을 얻으려고합니다. ... (