Facebook Ads API: transaction_detail? - facebook

Facebook currently supports the ability to list the transactions that occur on an Ad Account through their API (although its very hard to find):
https://graph.facebook.com/v2.4/act_{{ACCOUNT_ID}}/transactions
{
"id": "{{TRANSACTION_ID}}-1399450",
"time": 1438255264,
"account_id": "{{ACCOUNT_ID}}",
"fatura_id": 0,
"amount": {
"currency": "CAD",
"total_amount": "2,100.40"
},
"charge_type": "payment",
"status": "completed",
"billing_start_time": 0,
"billing_end_time": 0,
"payment_option": "credit_card",
"tx_type": 3,
"app_amount": {
"currency": "CAD",
"amount": "2,100.40"
},
"provider_amount": {
"currency": "CAD",
"amount": "2,100.40"
}
}
However, if you notice, there's nothing in there about the Payment ID, thus making it very difficult to figure out what the heck this transaction/payment is for... nothing tiing to ads, adsets, campaigns, anything!
If anyone has any recommendations as to how to get more specific information about a transaction, I would love the help!
Also - just to note that if I used my APP_ID token (because it claims I can't do it from a user access token, which misleads me to think I was actually getting somewhere!) and ping the transaction id as such:
https://graph.facebook.com/v2.4/{{TRANSACTION_ID}}
I get:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Which is how you can apparently inspect payments from within canvas payments, but this is specifically for Ad accounts payments/transactions.

Related

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

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.

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?

How To User Fetch Friends Data Using Graph API

What i Need:
i need to fetch my friends like email ,id , name .
i have tried using https://developers.facebook.com/tools/explorer/1456/?method=GET&path=me&version=v2.1.
url is like graph.facebook.com/v2.1/me .
data
{
"id": "77",
"email": "af55#gmail.com",
"first_name": "Mo",
"gender": "male",
"interested_in": [
"female"
],
"last_name": "f",
"link": "https://www.facebook.com/app_scoped_user_id/777/",
"locale": "en_GB",
"name": "singh",
"timezone": 5.5,
"updated_time": "2014-08-18T05:34:55+0000",
"verified": true
}
but making call graph.facebook.com/v2.1/user
Error
{
"error": {
"message": "(#803) Cannot query users by their username (user)",
"type": "OAuthException",
"code": 803
}
}
i have refer the url https://developers.facebook.com/docs/graph-api/reference/v2.1/user.
i have tried to solve by go ->getACEESS TOKEN->check on permissions->email->user_friends.
but still i cannot fetch url through user.
making call with me/friends
{
"data": [
{
"name": "Ashwani Gaur",
"id": "62036"
},
{
"name": "Shobhit Puri",
"id": "131"
},
{
"name": "Rahul Raman",
"id": "10007"
},
{
"name": "Piyush Agarwal",
"id": "800899"
},
{
"name": "Neeraj Yadav",
"id": "10000"
}
],
"paging": {
"next": "https://graph.facebook.com/v2.1/777009872366669/friends?limit=5000&offset=5000&__after_id=enc_AeytV0frT0k1mTj0ZfZRTxPsdSP3TVT_Qd-I1Aoc8vA8YseN4Rr8Vg5n6RgECxsd6RXaVNL8fJ0iaI79qEW7K8nw"
},
"summary": {
"total_count": 383
}
}
i need id, name, email, friend personal_info.
Since April 2014 (v2.0), there are no friend permissions anymore and it´s not possible to get user data from people who don´t use the App. See the changelog for more information: https://developers.facebook.com/docs/apps/changelog
The docs are a bit misleading, you can only use /me to get data of the user who is logged in at the moment.
Update:
By requesting /me/friends, you get all the friends using the App. But as i said in my first sentence, there are no friend permissions anymore. You will only get ID and name of your friends, nothing else. Even if your friend authorized your App, you can ONLY get more data with his own session and by calling /me. The email permission only gives you access to the email of the user who is logged in, not access to the emails of all his friends, of course.
You can only store the email after authorizing a user, that is the only way for other users to get the email of his friends - at least the ones who authorized your App too.

Permissions to get comments of post user is tagged in on facebook

I'm attempting to do some analysis of a user's Facebook data, so I'm attempting to collect as much as possible. Using the Facebook graph api, which permissions do I need to request in order to get the comments for a post the user is tagged in. If the post is on the user's wall, it isn't a problem, but if the user is tagged in a post on a friend's wall no comments are there, and the count is set to 0.
I'm making a request to //feed with what I believe to be a valid access token from my application. However, using the graph explorer tool from Facebook the same situation happens. I assume the problem is a permission I am missing, but can't seem to figure out which one I should add.
I'm currently requesting the following permissions:
friends_photos
friends_likes
friends_checkins
friends_status
user_photos
user_likes
user_checkins
user_status
read_mailbox
read_stream
{
"id": REDACTED,
"from": {
"name": REDACTED,
"id": REDACTED
},
"to": {
"data": [
{
"name": REDACTED,
"id": REDACTED
}
]
},
"message": REDACTED,
"message_tags": {
"121": [
{
"id": REDACTED,
"name": REDACTED,
"type": "user",
"offset": 121,
"length": 11
}
]
},
"privacy": {
"value": ""
},
"type": "status",
"created_time": "2013-03-13T14:25:44+0000",
"updated_time": "2013-03-13T14:25:44+0000",
"comments": {
"count": 0
}