Facebook API Campaign Create - facebook

Some background...
I'm trying to create a Campaign using the graph.facebook.com API. When I post, I get an ID back, which I thought would most likely be the Campaign-id, when I do a Get, I am returned a list of ID's...presumably campaigns.
When I go the AdManager page to see all my campaigns there is nothing. I have tried searching Adverts and Adsets, but also nothing. I now have a list of Id's but no idea what they actually represent.
If I do a GET on one of Ids I was hoping I might get some further information about the object (node), but instead I just get the id back and nothing else.
The AdAccount I am POSTing the campaigns to is a SandBox account, not sure if this makes a difference.
...
Can anyone confirm whether or not the id I am receiving is likely to be the CampaignId?
Is there a special way to see campaign's created for a sandbox account?
Is there a further stage I need to complete to get the Camapigns to show up?
many thanks.

Related

Facebook graph API not returning name with ads account listing

I'm trying to get all the personal ads account list. However, I get the IDs and act_ids but not the name along with them.I'm checking all the way but found no clue what's wrong i'm doing. I believe there's definitely way to get names with them as well.
I took all the reqired permissions, I believe
There's only IDs but no ad accounts name.
I was not getting name because by default the api doesn't return any other informations!
You have to mention the fields to get speicifc information you need. For me i needed name for the ad account so what i did is this
https://graph.facebook.com/v9.0/${fb_id}/adaccounts?fields=name&access_token=${token}
this way my result was expected one's. Although i was looking for this information speicifically but i didn't saw anywhere. Hope this will help you guys!

How to send message to specific facebook user from website?

My goal is to make a website, in which user could customize a photo and then provide his friends indicators like name or id. My next task is to fetch that info from database and send messages on specific date to provided users. Ex birthday wishes, greetings, and so on.
I studied facebook send api for a few days now and couldn't find solution for myself. If I want to send message, I need to have Page-scoped id of user, which is acquired when the person text you first, which is not desired, because person wouldn't know what it is.
Also I was looking into Customer matching API, also seems to require the same PSID. The next thing I checked was Send Dialog API, which seems to send messages instantly, but not on the specific date. Also I checked unofficial facebook-chat-api, which asks for user ID, whereas I can find my id, I couldn't find ids of my friends.
So I just want to know is it even possible, if yes, I'd really appreciate your help.
User to User communication is not possible (and not allowed) in an automatic way, there is no API for it except for the Send Dialog. The Messenger platform is for page to user communication only.
Do not use inofficial tools, they are not allowed and might get you banned.

How can I get owner email for a Facebook App using the App Access Token

How would I get the email address associated with an active Facebook App ID, if all the usual methods (such as here, and here) don't return any email information with my creator-uid?
(I simply don't get the email field returned, even when I specifically request it as per here. I don't think this is a case of this as I didn't get an "App has no owner" error, or any error whatsoever.)
I've also tried this, but I'm in a catch-22 as I can't log in to select the application first.
I'm looking for the owner email address, so I can log in to make administrative updates following graph API updates.
Other specifics:
I get the following when I hit the Graph API via: https://graph.facebook.com/{my-app-id}?access_token={my-access-token} or https://graph.facebook.com/{my-app-id}?access_token={my-access-token}&fields=email
{
"name": "my-name",
"id": "my-creator-uid" }
I've tried to recover my FB account using all emails I can think of, but FB says 'no account exists' for each that I try. (This is a data-analytics corporate account being used to gather data for 12+ months, so I can't simply create a new account/app ID and start using that instead, as app-scoped user IDs will change.)
I've also tried viewing https://www.facebook.com/app_scoped_user_id/{my-creator-uid}/ and https://www.facebook.com/{my-creator-uid}/ from another company FB account, but both get:
Sorry, this content isn't available right now The link you followed
may have expired, or the page may only be visible to an audience
you're not in.
What else would you suggest? What might have happened? I've tried to contact Facebook, but that search led me to this forum post, so I'm here. Thank you in advance for your help.
This is not a programming question, try to get in touch with the Facebook Team, if you are working with Facebook paid services (like Advertising) you might have an account representative that can accelerate the things a little bit (But this can be a really long wait).
A more realistic option is to create a new profile and an new app, also your application will be reviewed as well (Take a little less time than previous option).

Creating Facebook Newsfeed ad with Website Conversions as a goal

I'm trying to create an ad for an unpublished page post (link type) via FB Ads API with goal set to WEBSITE_CONVERSIONS. I was a bit puzzled by api docs, so I checked hwo FB Ad Manager does this and notices it send "OBJECTIVE" parameter to FB - something that doesn't exist in API Docs at all
I have a php script in cURL that does the job, sending the following to act_xxxx/adgroups endpoint:
method=post
access_token=xxxxxxxxxxxxxxxxxxxxxxxxxx
name=CURL 001
campaign_id=xxxxxxxxxxxxxxx
targeting={"countries":["US"],"age_min":13,"broad_age":1,"page_types":["feed"]}
bid_type=ABSOLUTE_OCPM
bid_info={"ACTIONS":25}
adgroup_status=ACTIVE
creative={"type":27,"object_id":"XXXXXXXXXXXXXX","story_id":"XXXXXXXXXXX"}
objective=WEBSITE_CONVERSIONS
conversion_specs={"action.type":["offsite_conversion"],"offsite_pixel":["XXXXXXXXXXX"]}
redownload=1
When I go to FB Ad Manager and open the campaign, I can see the ad with correct objective set. Everything looks OK even if I open it with FB Ad Manager.
However, when I send the same request using the application I work on, things get messy. From FB Ad Manager campaign view, everything looks OK, but when I open the ad for editing, I get the following error for my Objective: You've entered a destination that can't be used with the Website Conversions objective. Edit Objective.
So, am I missing something, is there a point in API where this is explained?
Thank you and sorry for the long explanation.
EDIT: After inspecting the ad I created via FB Ads Manager, I noticed that creative it generated had (among other) title, image_url and link_url fields, even though creatives of type 27 shouldn't have those (according to https://developers.facebook.com/docs/reference/ads-api/adgroup/). Maybe it's something new?
After noticing the same issue arises when using the Power Manager, I reported a bug and was explained that this is by design, i.e. currently it's not an option available via API. Users who use API should define their goals implicitly by setting the correct bid info (e.g. "Clicks to website" is set by selecting bid_type=CPC or ABSOLUTE_CPM and setting appropriate bid_info.

Is there any way to get a list of users for a custom audience?

Getting other details is easy, but there doesn't seem to be any API accessible way to get a list of users (or even approximate users) for the audience. You can add them, and delete them (?!) but not enumerate all the users in the list.
Is that truly the case, or am I missing something?
According to the documentation here: https://developers.facebook.com/docs/reference/ads-api/custom-audience-targeting/ you should be able to see an approximate count.
There is no way to get the users back from the custom audience list by design.
For the audiences you never upload raw contact data. You always have to hash it via SHA256 and send the feed to Facebook that way. Since you have not provided the actual contact information like email, phone number facebook won't give those back to you it would be an information breach in a way.
If what you are asking is whether you can retrieve back the hashes that you have sent, I have not been able to find a way it on the API so I assume they think that you already have that list since you uploaded it in the first place.
https://developers.facebook.com/docs/marketing-api/audiences-api/