trying to do
https://developers.facebook.com/docs/marketing-api/buying-api
the token is a sandbox token
getting error:{"error":{"message":"(#803) Some of the aliases you requested do not exist"
is an account id error
i got the account id from :https://www.facebook.com/adsmanager
i even tryd my facebook page id or an app id from :https://developers.facebook.com/apps/
not sure what else to try anyone know how to deal with this error?
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;
}
}