1

我正在发出一个带有 50 个报告发布请求的异步批处理请求。

第一批请求向我返回报告 ID

第一步

dynamic report_ids = await fb.PostTaskAsync(new
                    {
                        batch = batch,
                        access_token = token
                    });

接下来我正在获取报告信息,以获取异步状态以查看它们是否已准备好下载。

第二步

var tListBatchInfo = new List<DataTypes.Request.Batch>();
                        foreach (var report in report_ids)
                        {
                            if (report != null)
                                tListBatchInfo.Add(new DataTypes.Request.Batch
                                {
                                    name = !ReferenceEquals(report.report_run_id, null) ? report.report_run_id.ToString() : report.id,
                                    method = "GET",
                                    relative_url = !ReferenceEquals(report.report_run_id, null) ? report.report_run_id.ToString() : report.id,
                                });

                        }
dynamic reports_info = await fb.PostTaskAsync(new
                        //dynamic results = fb.Post(new
                        {
                            batch = JsonConvert.SerializeObject(tListBatchInfo),
                            access_token = token
                        });

一旦我在第二步中调用它们,第一步中生成的一些 id 将返回此错误

消息:不支持的获取请求。ID 为“6057XXXXXX”的对象不存在,由于缺少权限而无法加载,或不支持此操作。请阅读 https://developers.facebook.com/docs/graph-api上的 Graph API 文档

我知道 id 是正确的,因为我可以在使用 facebook api explorer 中看到它。我究竟做错了什么?

4

1 回答 1

1

This may be caused by Facebook's replication lag. That typically happens when your POST request is routed to server A, returning report ID, but query to that ID gets routed to server B, which doesn't know about the report existence yet.

If you try to query the ID later and it works, then it's the lag. Official FB advice for this is to simply wait a bit longer before querying the report.

https://developers.facebook.com/bugs/250454108686614/

于 2017-02-14T13:30:53.847 回答