Facebook - custom audience ToS for sandbox account - facebook

Im trying to create custom audience using API. With the live ad account this works, but with sandbox account i get the below error:
{
"error": {
"message": "Permissions error",
"type": "OAuthException",
"code": 200,
"error_subcode": 1870034,
"is_transient": false,
"error_user_title": "Custom Audience Terms Not Accepted",
"error_user_msg": "You'll need to agree to the Custom Audience terms before you can create or edit an audience of CUSTOM type. To accept, go to https://www.facebook.com/ads/manage/customaudiences/tos/?act=************.",
"fbtrace_id": "********"
}
}
When i goto the URL provided, it tells me:
The link you followed may have expired, or the page may only be visible to an audience you're not in.
I have accepted ToS in marketing app tools as well.
I have added system user to the business, made system user as app admin for the app.
When i check for accepted ToS, i get this:
{
"tos_accepted": {
"web_custom_audience_tos": 1
},
"id": "act_***********"
}
I have looked at following answers, but still getting error:
https://stackoverflow.com/a/42766604/5690875
Am I missing any step?

I am having the same issue. So far I couldn't manage to get those Custom Audience ToS properly accepted by the sandbox Ad Account.
What did work for me was to create some dummy accounts and apps so I could use the API and test my code.
For now I did open a bug https://developers.facebook.com/support/bugs/370563156815064 and if there is any update I will update my answer here too.
Also there is another very similar bug already open https://developers.facebook.com/support/bugs/229033267958911. In the comments Felix(the guy who opened the bug) says that he managed to login with the sandbox Ad Account and accept the terms. I do not know how would you login with a sandbox Ad Account, but I did not look into it either.

Related

Facebook Graph API not working with comments?

I created a page and an app with a Facebook Developer account.
In the Explorer Tool, I can retrieve a list of posts with this query without any issues:
104801368572889/feed?fields=message,attachments&access_token=[token]
However, not so lucky when I try to retrieve the comments associated to a post with this query:
104801368572889_105680201818339/comments?access_token=[token]
That's the error I get:
{
"error": {
"message": "(#200) Missing Permissions",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AOmx5mNZC9xUFysAWp4oX3s"
}
}
It sounds like this means I don't have permissions. I tried to add all the possible permissions in the Explorer Tool (included the pages_read_engagement that is probably the one required for this API call). However, this doesn't seem to work. I also tried to add permissions in the app from the Developer Dashboard, but this brings me into a long process of information requests and reviews by Facebook. I don't want to go through this process as I'm just doing development at the moment. Isn't there something as a sandbox or development mode, where I can set the permissions that I want?

Facebook APP - How do I make my Facebook App Live

Am new to Facebook related stack. So, please bear if its a dumb question.
I created a Facebook App but I couldn't able to find the option to make my APP Live. Do I need to submit it for review and then only I can able to make it Live?
Also am trying to do a Facebook messaging using send API. Am getting "message": "(#803) Some of the aliases you requested do not exist: messages".
Am I missing something? Please help.
Also am trying to do a Facebook messaging using send API. Am getting
"message": "(#803) Some of the aliases you requested do not exist:
messages"
Your URL should be in this format
https://graph.facebook.com/v9.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>
This means you're missing the /me object in your call. Also since, it's a POST request you need to attach a body with the following params to the call.
"messaging_type": "<MESSAGING_TYPE>",
"recipient": {
"id": "<PSID>"
},
"message": {
"text": "hello, world!"
}
Do I need to submit it for review and then only I can able to make it
Live?
According to the page you linked, you need to request pages_messaging permission and that requires App Review in order for this Send API to work in your app.
Additionally, If you want to test this in development mode, you can give a role to the user(as a developer, tester, or analytics user) you're trying to message and test with them as mentioned on the page you linked:
Apps in Development Mode, are restricted to message people that have a
role in the app. Additionally, Pages in unpublished status will only be
allowed to message people with a role on the Page.

How to create a facebook ad inside the sandbox via api?

I want to create a sandbox facebook ad.
I managed to create a Campaign and an AdSet but when I try to create an AdCreative or an Ad I get following exception:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1885183,
"is_transient": false,
"error_user_title": "Article of the ad was created with an app in development mode",
"error_user_msg": "The advertisement was created by an app in development mode. It must be public to create this ad.",
"fbtrace_id": "123456789"
}
}
Does this mean its impossible to create even sandbox-ads as long as the app is in dev mode (not reviewd)?
If yes whats the point of the sandbox?
I followed this tutorial using Postman and curl step by step and everything worked until 4. Create Ad Creative. : https://github.com/keboola/ex-facebook-graph-api/wiki/Sandbox-Ad-Account-Testing-Environment
It will be better to post this question over the project issues
https://github.com/keboola/ex-facebook-graph-api/issues
Unfortunately this is a known issue on Facebook and it's not possible to create AdCreative for app in dev mode.
What I did is: I made a screencast for the possible part and make it possible for the reviewer to get access to the website to test it himself, this is also confusing, since there is no user interface where to check the created ad in sandbox, I created new facebook account, add it as a tester to my app, and send app for review explaining why ad can't be created, it was rejected the first time but I requested again and it got approved

Facebook sdk error: "Application does not have permission for this action"

I'm trying to use facebook java sdk to create ads. I'm able to create AdCampaign and AdSet, but when I'm trying to create AdCreative, it returns with error:
{
"error": {
"message": "Application does not have permission for this action",
"type": "OAuthException",
"code": 10,
"error_subcode": 1341012,
"is_transient": false,
"error_user_title": "No permission to access this profile",
"error_user_msg": "You don't have required permission to access this profile",
"fbtrace_id": "Gvc9OPtfxrb"
}
}
To create APIContext, I'm using Access Token, generated from "System User" section under Business settings and App Secret from application settings.
To create AdAccount, I'm using Ad Account Id.
I guess I miss some Id or Token, because I can go Ads Manager and do everything I need from ui, so looks like I have enough permissions.
Could you help me to figure out what I'm doing wrong?
We faced a similar issue wherein we were able to create campaigns and adsets using the API token generated for the ad account but not able to publish ads.
The problem was that the ad account for which the API token was generated had access to pages and the ad manager account but in addition to that we will have to give the user access to the page & ad account and apps. Because FB assumes that some user is running the code and not the ad account and hence users should be given access.
Just go to users -> People and add assets and the respective page, ad accounts and apps and run the code.

Accessing Facebook Ads API request error 270

I have a whitelisted Facebook App that is out of sandbox mode and has been approved for the Ads API, but I am receiving the following error when trying to make requests to the Ads API.
{
"error": {
"message": "(#270) This Ads API request is not allowed for apps with only developer access",
"type": "OAuthException",
"code": 270
}
}
This occurs when using adgroupstats, adcampaignstats, and reportstats requests, etc. The adaccounts request does return my account information though. My dashboard does read "This app is public and available to all users", as I needed to get out of sandbox mode in order for my app to be whitelisted.
Is there another setting that I have missed in order to gain access to the Ads API calls that I need?
Answer:
This is most likely due to your dev/admin accounts of the app not being set as "Admins" in facebook's ad manager. Let me know if this solves this issue for you.
Old response:
I am running into the same issue. Can not run api calls against reportstats even though the user that the app/ad account belongs too was an admin, i change that user to a developer and its still happening.
I opened a bug report for this: https://developers.facebook.com/bugs/786289188058999