Facebook graph api 如何使用Insights API异步作业下载facebook报告?
嗨,我是facebook营销API的新手。我想下载csv格式的帐户完整报告,我正在使用Insights API异步作业,使用它我可以获得“report\u run\u id”,然后我提出了API请求。它给出了错误的响应。有人能帮我下载csv格式的报告吗?我尝试的代码是:Facebook graph api 如何使用Insights API异步作业下载facebook报告?,facebook-graph-api,facebook-ads-api,facebook-marketing-api,facebook-java-api,Facebook Graph Api,Facebook Ads Api,Facebook Marketing Api,Facebook Java Api,嗨,我是facebook营销API的新手。我想下载csv格式的帐户完整报告,我正在使用Insights API异步作业,使用它我可以获得“report\u run\u id”,然后我提出了API请求。它给出了错误的响应。有人能帮我下载csv格式的报告吗?我尝试的代码是: OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.facebook
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.facebook.com/ads/ads_insights/export_report/?report_run_id=279445242544715&name=reports&format=csv")
.get()
.build();
Response response = client.newCall(request).execute();
if(response.isSuccessful()){
String resposes=response.body().string();
}
我将给出使用curl的示例,但您应该能够轻松地将其转换为javascript 使用
报告\u运行\u id
,您可以查询异步查询的完整性,例如:
curl -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.10/1000002
然后,您需要使用insights edge查询报告运行id:
curl -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.10/<YOUR_REPORT_RUN_ID>/insights
curl-G\
-d'访问\u令牌='\
https://graph.facebook.com/v2.10//insights
您找到了如何使用API的解决方案?太好了,对我有用!
curl -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.10/<YOUR_REPORT_RUN_ID>/insights