首页 > 解决方案 > facebook 营销 API 错误 803 c#

问题描述

试图做 https://developers.facebook.com/docs/marketing-api/buying-api
令牌是一个沙盒令牌
得到错误:{“错误”:{“消息”:“(#803)一些别名您请求的不存在”
是一个帐户 ID 错误
,我从以下网址获得了帐户 ID:https
://www.facebook.com/adsmanager我什至尝试了我的 Facebook 页面 ID 或来自:https://developers.facebook 的应用 ID。 com/应用程序/

不知道还有什么可以尝试的任何人都知道如何处理这个错误?

static void Main(string[] args)
    {

        string test = postrequestAsync().GetAwaiter().GetResult();


        Console.WriteLine(test);
    }

    private static async System.Threading.Tasks.Task<string> postrequestAsync()
    {

        /*
         'name=My campaign' \
          -F 'objective=LINK_CLICKS' \
          -F 'status=PAUSED' \
          -F 'access_token=<ACCESS_TOKEN>' \
          https://graph.facebook.com/v3.0/act_<AD_ACCOUNT_ID>/campaigns


         */

        try
        {
            var values = new Dictionary<string, string>
        {
           { "name", "My campaign" },
           { "objective", "LINK_CLICKS" },
           { "status", "PAUSED" },
           { "access_token", token }
        };

            var content = new FormUrlEncodedContent(values);

            var response = await client.PostAsync("  https://graph.facebook.com/v3.0/act_<"+accountid+">/campaigns", content);

            var responseString = await response.Content.ReadAsStringAsync();
            return responseString;
        }catch(Exception e)
        {
            return e.Message;
        }
    }

标签: c#facebook-graph-api

解决方案


推荐阅读