Invalid Credentials Error when passing Oauth 2.0 Access Token to Fusion Tables API in PHP

蓝咒 提交于 2019-12-06 03:35:49

The access token should either sent as an Authorization: Bearer HTTP header OR as the value of access_token parameter in the URL.

To send as the Authorization: Bearer header, use the $arrHeader variable again, but update the line of code to the following:

$arrHeader = array('Content-Type'=>'application/json', 'Authorization'=>'Bearer <your_access_token>');

Or, if you want to use the access_token parameter, update the following line and do not send the access token in the body of the post:

  curl_setopt($ch, CURLOPT_URL, 'https://www.googleapis.com/fusiontables/v1/tables/'.$strTableID.'/styles/1?&key=redactedKey&access_token=<your_access_token>');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!