How can I generate a ad preview without requiring the ad account id in the Facebook Ads API? - facebook

Though it is mentioned in the docs about generating a preview without requiring the ad_account_id (https://developers.facebook.com/docs/marketing-api/generatepreview/v13.0). I even follow the parameters required. However, I keep getting this error (even though the endpoint was mentioned in the docs)
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "--"
}
Endpoint:
https://graph.facebook.com/<API_VERSION>/generatepreviews?ad_format=RIGHT_COLUMN_STANDARD&creative={
"object_story_spec": {
"link_data": {
"description": "Description",
"link": "<URL>",
"message": "Message",
"name": "Name"
}
}
}&access_token=<Access_Token>
However, It works when using the same endpoint but with the ad_account_id on it and with the same set of test data. So I assume there is no issue with my set of test data.
https://graph.facebook.com/<API_VERSION>/act_<ad_account_id>/generatepreviews?ad_format=RIGHT_COLUMN_STANDARD&creative={
"object_story_spec": {
"link_data": {
"description": "Description",
"link": "<URL>",
"message": "Message",
"name": "Name"
}
}
}&access_token=<Access_Token>
Maybe I'm missing something? Not really sure.
Thanks in Advance.

Related

Get Facebook page rating comments

I would like to retrieved comments from a page rating.
I'm getting page ratings from endpoind GET https://graph.facebook.com/v15.0/21[...]58/ratings?fields=created_time,has_rating,has_review,open_graph_story,rating,recommendation_type,review_text,reviewer
I get an array of rating object, with this rating for example:
{
"created_time": "2021-11-06T04:20:20+0000",
"has_rating": false,
"has_review": true,
"open_graph_story": {
"id": "21[...]58",
"message": "Lorem ipsum",
"start_time": "2021-12-26T21:14:02+0000",
"type": "sellers.rates",
"data": {
"recommendation_type": "positive",
"review_text": "Lorem ipsum",
"is_hidden": false,
"language": "fr",
"seller": {
"id": "54[...]12",
"title": "LOREM",
"type": "place",
"url": "https://facebook.com/lorem"
},
"has_review_update": false
}
},
"recommendation_type": "positive",
"review_text": "Lorem ipsum",
"reviewer": {
"name": "John Doe",
"id": "56[...]60"
}
}
Then, I'm trying to get comments from this review by requesting GET https://graph.facebook.com/v15.0/54[...]12_21[...]58/comments
But I get this error:
{
"error": {
"message": "Unsupported get request. Object with ID ' 54[...]12_21[...]58' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "Av[...]fN"
}
}
In the other hand, this request working fine with a "classic" post.
Does that means ratings are not concidered as a post ?
How can I get comments from rating ?
https://developers.facebook.com/docs/graph-api/reference/recommendation/
The Graph API docs do not mention any comments endpoint/edges for a single recommendation, so I assume it is not possible to get them.
Compare the docs to the page post docs: https://developers.facebook.com/docs/graph-api/reference/page-post/#edges

What does Facebook error code "-1" subcode "2018012" error_key "E-1_S2018012"mean?

I received this error from Facebook, for a specific guest user:
"message": "[FacebookClient] response",
"status": 400,
"request": {
"baseURL": "https://graph.facebook.com/v8.0/",
"url": "/me/messages?access_token=EAAT9ZAq9Nm..."
},
"data": {
"error": {
"message": "(#-1) Unexpected internal error",
"type": "OAuthException",
"code": -1,
"error_subcode": 2018012,
"fbtrace_id": "AJcFpXZa28zOMut3XAUxorW"
}
},
....
"error_key": "E-1_S2018012"
Facebook documentation did not mention anything about this error. And very few info from Internet with reasons (not encode as unicode, send same payload messages in same time and timezone) that are not applicable to me.
Pls help me what it is and how to solve? Thank a lot!

Unsupported get request. Object with ID '{USER_ID}' does not exist, cannot be loaded due to missing permissions, or does not support this operation

I am getting this from Facebook webhook. I am trying to get the sender's name and profile picture.
<pre>
{
"object": "page",
"entry": [
{
"id": "172916740162087",
"time": 1609667491,
"changes": [
{
"value": {
"from": {
"id": "2529118547136023",
"name": "Md Abid Hasan Nayem"
},
"post": {
"status_type": "added_photos",
"is_published": true,
"updated_time": "2021-01-03T09:51:29+0000",
"permalink_url": "https://www.facebook.com/CodeWareLTD/posts/851154192338335",
"promotion_status": "inactive",
"id": "172916740162087_851154192338335"
},
"message": "Happy new year",
"post_id": "172916740162087_851154192338335",
"comment_id": "851154192338335_853191445467943",
"created_time": 1609667489,
"item": "comment",
"parent_id": "172916740162087_851154192338335",
"verb": "add"
},
"field": "feed"
}
]
}
]
}
</pre>
When I am sending request with the user id /{USER_ID}?access_token=token then it's returning this error.
Whereas I have all the required permissions approved.
<pre>
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "ABtpgYvcMuaA_jQcW8Fdi3M"
}
}
</pre>
I opened a bug report, but they told me it's ok as per the current Facebook system design. But
still, I'm unable to get the user's first name, last name, and profile picture.
Bug Report Link: https://developers.facebook.com/support/bugs/887826828623849/.
Please, help me to get the exact API to get the sender's name & profile picture.
my currently successfully reviewed permissions are:
email,
pages_manage_metadata,
pages_read_engagement,
pages_show_list,
pages_messaging,
pages_read_user_content,
public_profile,
pages_manage_engagement,
pages_manage_posts

PSID is unsupported GET request Graph API?

I'm trying to get labels associated with participants of conversations on my fb page.
My GET request: <pageID>/conversations?fields=participants,id&access_token=<PageAccessToken>
The POST:
{
"participants": {
"data": [
{
"name": "Jim Bean",
"email": "numbers#facebook.com",
"id": "2821512231253160"
},
{
<my page info>
]
},
"id": "<convo link>"
},
When I click on the participant's ID, I get the following error.
"message": "Unsupported get request. Object with ID '2821512231253160' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph...",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AwlTn9Vx3mfPtRGnquaHm8k"
Thus, I cannot request labels associated with PSIDs without being able to get info on my user's PSIDs.
What am I missing? How can I retrieve PSIDs from conversations?

Facebook Graph Search Error while searching "Event"

This is embarrassing, but I am at my wits end. While performing a very simple search for "Events" using fb Graph Search, I get the following error:
{
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}}
This is the code I execute:
https://graph.facebook.com/search?q=conference&type=event&limit=1&access_token=XXXXXXXXXX|XXXXXXXXXX
It works JUST FINE for any other type of search - with the same access token for example:
https://graph.facebook.com/search?q=conference&type=place&limit=1&access_token=XXXXXXXXXX|XXXXXXXXXX
I get the following result:
{
"data": [
{
"category": "Local business",
"category_list": [
{
"id": "164243073639257",
"name": "Hotel"
}
],
"location": {
"street": "Langelaan 3",
"city": "Noordwijk",
"state": "",
"country": "Netherlands",
"zip": "2211XT",
"latitude": 52.251963727407,
"longitude": 4.4722281054509
},
"name": "NH Conference Centre Leeuwenhorst",
"id": "165032770219308"
}
],
"paging": {
"next": "https://graph.facebook.com/search?limit=1&type=place&access_token=XXXXXXXX|XXXXXXXXX&offset=1&__after_id=165032770219308"
}
}
At this point, I am out of ideas.
Facebook recently changed things in their API, Search was one of those things. You can only do this kind of search on Places and Pages now. To search events, you need an app access token. See this blog post: https://developers.facebook.com/blog/post/2013/04/03/platform-updates--operation-developer-love/
Fixed! I am now able to search for events by using an App Token generated using the new api. Thank everyone for your help