I would like to get url/link to conversation. based on official document it could be queried using link field.
https://developers.facebook.com/docs/graph-api/reference/v11.0/conversation
I have both required permission for my app.
The pages_messaging permission
The pages_manage_metadata permission
All i get is
"id": "m_M0wIE2LRCEnc1uq3puhx8tZG4cCq-FvBl1uMnd0HXaETmxzQ1c8jtHHfXzXMtO3qT4F7mmw4RcpNLiGaqYA01Q",
"created_time": "2021-09-01T16:06:42+0000"
}
CURL
curl --location --request GET 'https://graph.facebook.com/v11.0/{conversation_id}
/messages?access_token={token}&fields=id,created_time,link,message_count,participants,is_subscribed'
Related
I am sending a request to the Facebook device/login API via curl using a shell script as documented in the Facebook Login for Devices page:
curl -i -X POST https://graph.facebook.com/v14.0/device/login -F 'access_token=${app_id}|${client_token}' -F 'scope=ads_management,business_management,instagram_basic,instagram_content_publish,pages_read_engagement,pages_show_list,public_profile'
(The app_id and client_token are properly filled in.)
I get back the response such as
{
"code": "f4ee7axxxxxxxxxxxxxxxxec4b8e28eb",
"user_code": "PXXXXXXQ",
"verification_uri": "https://www.facebook.com/device",
"expires_in": 420,
"interval": 5
}
In my browser, I open a fresh private page and go to https://www.facebook.com/device, log in, and enter the user_code (e.g. PXXXXXXQ), and it completes successfully.
I then "poll" device/login_status via this curl command:
curl -i -X POST https://graph.facebook.com/v14.0/device/login_status -F 'access_token=${app_id}|${client_token}' -F 'code=f4ee7axxxxxxxxxxxxxxxxec4b8e28eb'
and get back a response with an access token:
{
"access_token": "EAAKxxxxxxxxxxxxxxxxxxxxxuuu",
"data_access_expiration_time": 1663078272,
"expires_in": 5183984
}
I then put the access token into the Access Token Debugger and find that it only has the two basic permissions of pages_show_list and public_profile. The other permissions are not granted.
I'm assuming I do not have my app configured properly. So far, the Facebook support has punted on the question so I'm turning here for help. I have "Enable Login for Devices" as the API page says in Step 1. I have "Facebook Login", "App Events", and "Instagram Basic Display" in my "Products" list. I don't see any warnings or flags on any of the app's pages. My "Test User" is a real Facebook user listed as in a Tester roll in the app.
Ultimately I want to use the Instagram media API. As a simpler test of the access token, I was trying to use the {page_id}?fields=instagram_business_account as a test and it wasn't working. Some pages suggest disconnecting and reconnecting the Instagram user and other things but I think the problem originates with the access token not having sufficient permissions.
I have also tried just requesting the permissions needed for the {page_id} and got the same results.
What changes do I need to make to get an access token via the device/login API that has more than just pages_show_list and public_profile permissions?
i'm getting an error while trying to invite a user to an ibm cloud account by REST API.
The error says that the IMS account is not valid.
Does anyone know whats an IMS Account?
here is my request:
curl -X POST \
https://user-management.cloud.ibm.com/v2/accounts/&MYACCOUNT/users \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"users": [
{
"email": "myuser#ibm.com",
"account_role": "Member"
}],
"iam_policy": [
{
"roles": [
{
"id": "crn:v1:bluemix:public:iam::::role:Viewer"
}]
}]
}'
And the respsonse:
{
"trace": "558156745",
"errors": [
{
"code": 9999,
"message": "Not Authenticated.",
"more_info": "IMS account id from token is incorrect."
}
]
}
Any ideas how to handle this ?
API keys on IBM Cloud are tied to either a user or can be for a service ID, a specific service and more. The API keys for user IDs and service IDs can be used to generate an IAM (authentication) token.
When you call into a REST API and use a token, it is checked that the token is not expired, belongs to a valid user and if the required privileges are held to execute that desired function.
If you want to invite a user to an account and want to grant privileges as part of that invitation process, you would need to use a user ID with the privilege to invite to that specific account. It can be different for any account in an enterprise hierarchy, including the enterprise account. On top of that, the privileges to grant the desired roles or resource access is needed. If one is missing, it gives an error message (not always the best).
I am trying to access Instagram Ad comments using Facebook Marketing API. But When I try the following command:
curl -G \
-d "access_token=<ACCESS_TOKEN>"\
-d "fields=id,message,instagram_user"\
"https://graph.facebook.com/<API_VERSION>/<EFFECTIVE_INSTAGRAM_STORY_ID>/comments"
I receive this error:
{'error': {'message': '(#10) Application does not have permission for this action', 'fbtrace_id': '', 'code': 10, 'type': 'OAuthException'}}
I am able to get the ads, their creatives but not the comments.
I used to be able to do the same a few months back. I am not sure what has changed. I do the same with Python but it is same as curl so in case someone do need to see it I can share it.
Here are the permissions that my app requests(it has development access and I am admin of both the ad account and the app):
Permissions
email
ads_read
ads_management
business_management
instagram_manage_comments
I am trying
curl -X GET -H "Authorization: Bearer <TOKEN>" "https://api.uber.com/v1.2/requests/<REQUEST_ID>"
and response is 403
{"message":"Forbidden","code":"forbidden"}
But the https://developer.uber.com/docs/riders/guides/scopes says that
The good news is you currently have access to these scopes when authorizing your own account or those of the developer accounts you list in your application dashboard (Limited Access). This allows you to start building an app immediately.
I've got token via OAuth using my own account
I've set param "scope=request" to https://login.uber.com/oauth/v2/authorize
And I've set "scope=request" when did https://login.uber.com/oauth/v2/token
Also I've trying to do request to https://sandbox-api.uber.com, it responds
{ "message": "cannot find trip", "code": "not_found" }
But I think it's ok, because sandbox doesn't contain my own account data, right?
Where is my fault could be?
I'm trying to hide a comment in a post in my page, i've tried:
curl -X "POST" -k "https://graph.facebook.com/v2.4/[comment_id]/?access_token=[access_token]&is_hidden=true"
as stated in the documentation, i am getting this response:
{"error":{"message":"(#210) Updating is_hidden requires a Page access token","type":"OAuthException","code":210}}
also i tried sending the parameters using --data in curl but it didn't work too
Edit:
Note: the token is a page access token
The following should work:
curl -XPOST \
-k \
-F 'is_hidden=true' \
-F 'access_token=[access_token]' \
https://graph.facebook.com/v2.4/[comment_id]
Also, check your access token to comply to
Permissions
A user access token with publish_actions permission is required to edit a comment posted by that user.
A page access token with publish_pages permission is required to edit a comment posted by that Page.
See
https://developers.facebook.com/docs/graph-api/reference/v2.4/comment#updating