我想向Xbox Live Restful API的Profiles URI和People URI发送请求。我无法理解这两个界面的“授权”部分。
我使用Follow命令将请求发送到POST (/users/batch/profile/settings)
:
curl -X POST \
https://profile.xboxlive.com/users/batch/profile/settings \
-H 'Signature: xxxx' \
-H 'Authorization: XBL3.0 x=xxxx' \
-H 'Content-Type: application/json' \
-H 'x-xbl-contract-version: 2' \
-d '{
"userIds": [
"xxxx"
],
"settings": [
"AppDisplayName",
"GameDisplayName",
"Gametag",
"AppDisplayPicRaw",
"GameDisplayPicRaw",
"AccountTier",
"TenureLevel",
"Gamescore"
]
}'
Xbox Live Restful API返回403。
我使用Follow命令将请求发送到GET (/users/{ownerId}/people)
:
curl -X GET \
'https://social.xboxlive.com/users/xuid(xxxx)/people' \
-H 'Signature: xxxx' \
-H 'Authorization: XBL3.0 x=xxxx'
它还会返回403。
是否有一些演示来演示如何调用Xbox Live Restful API?
在some search之后,我们应该在请求的标头中传递Signature
和Authorization
。我们可以从GetTokenAndSignatureAsync
中获取Signature
和Authorization
以及在Authorization
中编码的声明和XUID,但仍返回403。
答案 0 :(得分:0)
我遵循authenticate
中的xbox-webapi-python
来获取Authorization
标头(XBL3.0 x=<uhs>,<xsts>
)。只需将Authorization
添加到每个Xbox Live API请求中其他必需的标头旁边,您就可以得到正确的响应。
Authorization
的值也可以得到getTokenAndSignatureAsync
。此值适用于所有Xbox Xbox终结点。