facebook batch request for multiple users

谁说胖子不能爱 提交于 2019-12-06 03:40:40

According to the documentation on the batch requests page

The Batch API is flexible and allows individual requests to specify their own
access tokens as a query string or form post parameter. In that case the top
level access token is considered a fallback token and is used if an individual
request has not explicitly specified an access token.

Rewriting your original attempt should be like this

curl -F "access_token=USER_A_ACCESS_TOKEN" -F 'batch=[{"method": "GET", "relative_url": "me/friends?access_token=USER_A_ACCESS_TOKEN"}, {"method": "GET", "relative_url": "me/friends?access_token=USER_B_ACCESS_TOKEN"}]'

The original USER_A_ACCESS_TOKEN will be used as a fallback if there is an error with any of the other access_tokens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!