您可能必须输入相对 url 。这是来自营销批处理 API 文档的 example
curl -F 'access_token=______'
-F 'test1=@./test1.jpg'
-F 'batch=[
{
"method": "POST",
"name": "create_creative",
"relative_url": "<API_VERSION>/act_187687683/adcreatives",
"attached_files": "test1",
"body": "title=Test title&body=Test body&link_url=http://www.test12345.com&image_file=test1.jpg"
},
{
"method": "POST",
"relative_url": "<API_VERSION>/act_187687683/adgroups",
"body": "campaign_id=6004163746239&redownload=1&bid_type=CPC&bid_info={\"clicks\":150}&creative={\"creative_id\":\"{result=create_creative:$.id}\"}&targeting={\"countries\":[\"US\"]}&name=test1"
},
{
"method": "POST",
"relative_url": "<API_VERSION>/act_187687683/adgroups",
"body": "campaign_id=6004163746239&redownload=1&bid_type=CPC&bid_info={\"clicks\":150}&creative={\"creative_id\":\"{result=create_creative:$.id}\"}&targeting={\"countries\":[\"GB\"]}&name=test2"
},
{
"method": "POST",
"relative_url": "<API_VERSION>/act_187687683/adgroups",
"body": "campaign_id=6004163746239&redownload=1&bid_type=CPC&bid_info={\"clicks\":150}&creative={\"creative_id\":\"{result=create_creative:$.id}\"}&targeting={\"countries\":[\"IE\"]}&name=test3"
}
]' https://graph.facebook.com/
我假设这对其他请求也很常见。
其他各种阅读来源
1.) 来自here
将版本标识符预先附加到请求路径的开头。为了
例如,这是对 v2.2 的调用:
GET graph.facebook.com
/v2.2/me
这适用于所有版本,以这种通用形式:
GET graph.facebook.com
/vX.Y/{request-path}
2.) 把它放在 url 中似乎是为了Dialogs and Social plugins
对话框
版本化路径不仅适用于 API 端点,也适用于
用于对话和社交插件。例如,如果你想生成
Web 应用程序的 Facebook 登录对话框,您可以在前面添加一个版本
生成对话的端点的编号:
https://www.facebook.com/v2.0/dialog/oauth?
client_id={app-id}
&redirect_uri={redirect-uri}
社交插件
如果您使用的是我们的社交插件的 HTML5 或 xfbml 版本,
渲染的版本将由指定的版本决定
您正在初始化 JavaScript SDK。
如果您要插入我们其中一个的 iframe 或纯链接版本
插件,您可以将版本号添加到
插件:
<iframe
src="//www.facebook.com/v2.0/plugins/like.php?href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&width&layout=standard&action=like&show_faces=true&share=true&height=80&appId=634262946633418" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"> </iframe>