dongou2019 2014-12-16 12:07
浏览 26

在询问配置文件列表时,Google AnalyticsAPI会不断获得错误500

I have an script to update the profile list using

//all this code is inside a Class, and in the class constructor, always update the token 
$this->token = $this->getToken($this->accountId);
$tokenData = json_decode($this->token);

if($this->client->isAccessTokenExpired()) {
     $this->client->refreshToken($tokenData->refresh_token);
     $this->token = $this->client->getAccessToken();

     $this->accessToken = json_decode($this->token)->access_token;
     $this->saveToken($this->token,$this->accountId);
}

....

$this->service = new Google_Service_Analytics($this->client);


..
// then  i ask for the profiles
$profiles = $this->service->management_profiles->listManagementProfiles("~all", "~all",array('max-results' => 500));

but when i run this code i almost always get this error

Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles?max-results=500&key=##ACESS_KEY## : (500) Backend Error

this code, sometimes work, sometimes not , i have to be very lucky to just work , and i know is not a token problem because i can run other request like getting the visits for an specific profile without problem , i reduced the max-results to 200,100,50... etc, still happening , i also have been update to the lastest code from google api , any clue?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度