我正在尝试使用axios发送graph api批处理请求。当我在postman中尝试时,我尝试了以下内容 - 我正在尝试通过批处理请求发送send api。
url = https://graph.facebook.com?access_token=EA...`.
raw body = `{
"batch":[
{
"method": "POST",
"relative_url": "me/messages?access_token=<ACCESS_TOKEN>",
"body": "{ \"messaging_type\": \"MESSAGE_TAG\",\r\n \"tag\": \"ISSUE_RESOLUTION\",\r\n \"recipient\": {\r\n \"id\": \"1111944272264076\"\r\n },\r\n \"message\": {\r\n \"text\": \"hello, world!\"\r\n }}"
}
]
}
响应内容如下:
[
{
"code": 400,
"headers": [
{
"name": "WWW-Authenticate",
"value": "OAuth \"Facebook Platform\" \"invalid_request\" \"(#100) The parameter recipient is required\""
},
{
"name": "Expires",
"value": "Sat, 01 Jan 2000 00:00:00 GMT"
},
{
"name": "Strict-Transport-Security",
"value": "max-age=15552000; preload"
},
{
"name": "Facebook-API-Version",
"value": "v2.10"
},
{
"name": "Content-Type",
"value": "text/javascript; charset=UTF-8"
},
{
"name": "X-App-Usage",
"value": "{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"
},
{
"name": "Access-Control-Allow-Origin",
"value": "*"
},
{
"name": "Cache-Control",
"value": "no-store"
},
{
"name": "Vary",
"value": "Accept-Encoding"
},
{
"name": "Pragma",
"value": "no-cache"
}
],
"body": "{\"error\":{\"message\":\"(#100) The parameter recipient is required\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"BdrR5exbYCu\"}}"
}
]
响应代码为200。我已在正文中提供了收件人。