I'm trying to create an ad creative in Facebook from my test app with the following request (pretty much taken from the Python SDK Docs here):
Message: Call was not successful
Method: POST
Path: https://graph.facebook.com/v2.4/act_somenumber/adcreatives
Params: {'object_story_spec': '{"link_data":{"caption":"www.example.com","image_hash":"existing_hash","link":"http://example.com","message":"try it out"},"page_id":"some_page_id"}', 'name': 'AdCreative for Link Ad'}
However, I get the following response:
Status: 500
Response:
{
"error": {
"code": 100,
"is_transient": false,
"error_subcode": 1885183,
"error_user_msg": "Ads creative post was created by an app that is in development mode. It must be in public to create this ad.",
"error_user_title": "Ads creative post was created by an app that is in development mode",
"message": "Invalid parameter",
"type": "FacebookApiException"
}
}
Now, I've seen a similar question, which states:
If you want to create ads from an app which is in development mode, this is possible, but the post you're going to promote must have been created by an app which isn't in development mode - i.e if your app is in development mode it's OK provided you're promoting existing page posts from a page's /promotable_posts endpoint and the app that created those posts is not itself in development mode
I'm not trying to create an ad; I'm merely trying to create an ad creative and then later update the ad to use that creative. What is the correct way of creating a new creative with link data from a development app? I have no problem creating ad creatives that correspond to right hand column ads, it's the newsfeed / feeds ads whose objectives are "Website Clicks". The ad in question was actually created through the ad manager, not through an app.
The work-around is simply to create a dummy app and set it publicly visible.
Related
I'm implementing an application using Facebook Marketing API's SDK (python), I'm a newbie to this, yet I read the documentation and I was able to create campaigns, and ad sets. But not for ad creatives. The error was that my app is in dev mode and I need to switch it to be public.
Status: 400
Response:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1885183,
"is_transient": false,
"error_user_title": "Ads creative post was created by an app that is in development mode",
"error_user_msg": "Ads creative post was created by an app that is in development mode. It must be in public to create this ad.",
"fbtrace_id": "Dxgr83ugqSu"
}
}
Once I did, another error occurred stating that an extended permission should be granted:
Status: 403
Response:
{
“error”: {
“message”: “(#294) Managing advertisements requires an access token with the extended permission for ads_management”,
“type”: “OAuthException”,
“code”: 294,
“fbtrace_id”: “HZ8N55VciZg”
}
}
What I did understand is that I need to submit my app for review before trying to push the ad. However, I was wondering if it is possible by anyway to push an ad without doing so? for the sake of testing my script?
Note: it is the same case for sandbox mode.
apologize if this sound like a naive question.
whenever creating or updating an Ad's creative, I'm getting this error:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1772103,
"is_transient": false,
"error_user_title": "Instagram Account Is Missing",
"error_user_msg": "You're using Instagram as a placement. Please select an Instagram account to represent your business in your Instagram ads, or select a Facebook Page to use instead.",
"fbtrace_id": "..."
}
}
However, what I simply try to do is to create an Ad for a specifc Page Post and add this to an existing AdSet. To create a new creative for a given Post, I use the /adcreatives endpoint and pass the following:
POST: https://graph.facebook.com/v3.1/act_<ActId>/adcreatives
{
"name": "Test",
"object_story_id":"<PostIdWithPage>",
}
This works fine so far. But the following update of the Ad results in the error above:
POST: https://graph.facebook.com/v3.1/<AdId>
{
"creative": {
"creative_id": "<CreativeId>",
}
}
I guess, the above error happens when I try to add a creative to the Ad that can not be used on Instagram.
But why isn't it working like in the Business Manager? There, I can simply select a Post for a newly created Ad. If this Post is not valid for Instagram, it shows a warning but it still works.
So, when I want to create a tool that can create Ads based on given Posts, how can I achieve that? How can we come around the error above?
The important missing part here is, that we have to specify instagram_actor_id when creating the AdCreative. The ID can be retrieved by GETting <PageId>/page_backed_instagram_accounts.
Further to the accepted answer, I needed a little bit more information to properly connect an instagram account to my page:
There are two ways to link in instagram account to your page:
1. Setup a 'Page Connected' instagram account
Log in as a page admin, go to page settings > instagram and link
an existing instagram account to the page.
You can then get the linked instagram account id by doing a GET on:
<PageId>/instagram_accounts
2. Create a 'Page Backed' instagram account.
This is for when you don't have an existing instagram account you want to link to your page, and want to instead create a 'shadow' instagram account based off your page.
You can generate a paged backed instagram account by performing a POST on the following endpoint. And retrieve an existing one, by performing a GET.
<PageId>/page_backed_instagram_accounts
** Note that both these endpoints require you to have a 'page access token' rather than the normal 'account access token' you use to create your ads.
To get your page access token, you can do a GET request on:
/me/accounts
Then, as stated in the accepted answer - pass your new, linked instagram account id as the instagram_actor_id in your ad creative request.
Sources:
https://developers.facebook.com/docs/marketing-api/guides/instagramads/
https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens
I created an app on the FB developer page, and correctly configured it to allow “publish_actions”. Also tested to comment my own posts using the graph API and everything went OK.
https://graph.facebook.com/v2.2/xxx/comment
Sending the field message “some comment” (as post)
The problem is whenever that “Comment ID” does not belong to me, for example a friend or a page post that I am trying to comment, I always get:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200
}
}
(The token generation, and permission requests worked flawlessly, also even added all the permission available to test, but no luck)
Is there any way to test the comment function on other person post or page without submitting the app? Or is there a way to create “test” pages (as there is for test users) to test this?
In business manager it's possible to create a Link Ad with a Facebook Event url. I like to do the same with Facebook Ads API but facing a permissions error.
The Ad Creative of an Ad created in business manager looks like this one:
{
"object_story_spec": {
"page_id": "24188824589????",
"link_data": {
"link": "https://www.facebook.com/events/25595316793????/",
"message": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"image_hash": "cbb1f226fd5fe47c826dd1cad117????"
}
}
}
When I am trying to create the same Ad Creative via Ads Api I get an error message like the following:
{
"error": {
"message": "Invalid parameter",
"type": "FacebookApiException",
"code": 100,
"error_subcode": 1349118,
"is_transient": false,
"error_user_title": "Disallowed Post Link",
"error_user_msg": "One or more of the given URLs is not allowed by the Stream post URL security app setting. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. Read https://developers.facebook.com/docs/facebook-login/security/ to learn more about app settings related to security."
}
}
I get the same error if I try to create a Link Post with Graph API separately to use as object_story_id.
We really need this kind of Ads for our business. In stream ads perform much better than display ads. Is there anyway to create ads like this one via Ads API?
You should check the migration settings for your app to see if "Steam post URL security" is enabled.
This prevents URLs being posted by your app which do not link to a domain listed in your app settings.
Yesterday I started a new app on Facebook. Today I got the message that when people copy the link to Twitter they get an error. This is what you get:
{
"error": {
"message": "Unknown path components: /your_namespace:your_action",
"type": "OAuthException",
"code": 2500
}
}
What does this mean? What could be the problem?
Are you actually sending the POST action link to Twitter? Why?
I think you misunderstood how Open Graph works. Basically, you should be the one publishing actions when users take an action using your service. You can use a server-side or a client-side language to POST request (when you click a link, your browser actually makes a GET request, not a POST) to https://graph.facebook.com/me/namespace:action?access_token=ACCESS_TOKEN&OBJECT_PATH=OBJECT_URL
Note that you need to create an app, use it to authenticate users to get the access token and also set your custom actions / objects. These will need to be approved before you can actually use them.
You should start by taking a look at the sample apps to see how they work: https://developers.facebook.com/docs/samples/