【发布时间】:2019-01-22 00:29:37
【问题描述】:
我想向 Xbox Live Restful API 的个人资料 URI 和人员 URI 发送请求。这两个接口的Authorization部分看不懂。
- POST (/users/batch/profile/settings) page 说只需要一个普通的身份验证令牌和声明。如何生成身份验证令牌以及声明是什么?
我使用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。
- GET (/users/{ownerId}/people) page 表示需要 XUID 授权,并且还有一个 Authorization Header。在哪里放置 XUID?
我使用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。
【问题讨论】:
-
你有没有想过这个问题?
-
@JeffThomas 我已经写下了我的答案。