0
我想向OneDrive發出請求,但迄今爲止沒有成功。我已經能夠獲得我認爲很好的訪問令牌,因爲我可以訪問https://graph.microsoft.com/v1.0/me
中的信息。但是,當我嘗試訪問https://graph.microsoft.com/v1.0/me/drive
我得到500錯誤響應,這是響應對象說:要求onedrive的正確方法
[message:protected] => Unable to resolve template token
[string:Exception:private] =>
[code:protected] => 500
[file:protected] => C:\xampp\htdocs\OneDrive\vendor\thenetworg\oauth2-azure\src\Provider\Azure.php
[line:protected] => 68
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => C:\xampp\htdocs\OneDrive\vendor\league\oauth2-client\src\Provider\AbstractProvider.php
[line] => 644
[function] => checkResponse
[class] => TheNetworg\OAuth2\Client\Provider\Azure
[type] => ->
[args] => Array
(
[0] => GuzzleHttp\Psr7\Response Object
(
[reasonPhrase:GuzzleHttp\Psr7\Response:private] => Internal Server Error
[statusCode:GuzzleHttp\Psr7\Response:private] => 500
[headers:GuzzleHttp\Psr7\Response:private] => Array
(
[Cache-Control] => Array
(
[0] => private
)
[Transfer-Encoding] => Array
(
[0] => chunked
)
[Content-Type] => Array
(
[0] => application/json
)
[request-id] => Array
(
[0] => 7fc5c1c8-bd33-4788-bae9-5887d261c8c5
)
[client-request-id] => Array
(
[0] => 7fc5c1c8-bd33-4788-bae9-5887d261c8c5
)
[x-ms-ags-diagnostic] => Array
(
[0] => {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceB","ScaleUnit":"003","Host":"AGSFE_IN_2","ADSiteName":"AMS"}}
)
[Duration] => Array
(
[0] => 177.0851
)
[Date] => Array
(
[0] => Mon, 06 Feb 2017 12:55:27 GMT
)
)
[headerNames:GuzzleHttp\Psr7\Response:private] => Array
(
[cache-control] => Cache-Control
[transfer-encoding] => Transfer-Encoding
[content-type] => Content-Type
[request-id] => request-id
[client-request-id] => client-request-id
[x-ms-ags-diagnostic] => x-ms-ags-diagnostic
[duration] => Duration
[date] => Date
)
[protocol:GuzzleHttp\Psr7\Response:private] => 1.1
[stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
(
[stream:GuzzleHttp\Psr7\Stream:private] => Resource id #79
[size:GuzzleHttp\Psr7\Stream:private] => 237
[seekable:GuzzleHttp\Psr7\Stream:private] => 1
[readable:GuzzleHttp\Psr7\Stream:private] => 1
[writable:GuzzleHttp\Psr7\Stream:private] => 1
[uri:GuzzleHttp\Psr7\Stream:private] => php://temp
[customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
(
)
)
)
[1] => Array
(
[error] => Array
(
[code] => InternalServerError
[message] => Unable to resolve template token
[innerError] => Array
(
[request-id] => 7fc5c1c8-bd33-4788-bae9-5887d261c8c5
[date] => 2017-02-06T12:55:28
)
)
)
)
)
如果使用此帳戶登錄到[Microsoft Graph explorer](https://graph.microsoft.io/en-us/graph-explorer),那麼'/ me/drive /'調用結果是否相同錯誤? –
好吧,看起來問題是我沒有在我的授權和令牌URL中使用'v2.0'。現在一切正常。 – jemcaj
您可以將此作爲回覆發佈,並將您的答案標記爲正確嗎? –