Facebook Graph API - Cannot GET appassets edge for my Instant Game App - facebook

I'm sending request to appassets edge endpoint, using user access token (I'm the owner ``of the app):
curl -i -X GET \
"https://graph.fb.gg/v15.0/1172368406965046/appassets?access_token=USER_ACCESS_TOKEN"
Instead of a list of assets I'm getting following error:
{
"error": {
"message": "Tried accessing nonexisting field (appassets) on node type (Application)",
"type": "FacebookApiException",
"code": 100,
"fbtrace_id": "AaJwxbXg7TKHb0EE53NLr0K"
}
}
How can I reach my app assets?

Related

How to subscribe facebook pages to my facebook app using Graph API?

Currently, I am developing a messenger bot. For this purpose, I created a facebook app from facebook developer platform.
Now I need to subscribe facebook pages to my app using graph API, so for any message from the page, I can respond from my server.
I find one in Graph API Doc.
When I try it in the graph API explorer, I am encountering an error.
I followed the following steps:
1. Create a new app and page.
2. Get the page access token from my app.
3. In graph api explorer, Select my desired facebook app(newly created) from the drop-down menu.
5. When I was getting the user access token, made sure, I took permission for both 'publish_pages' and 'manage_pages'
6. Replaced the {page-id} with 'page access token'
I am getting this error:
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: EAAfIhxeHRsYBAD3VNK3BzOqkyhxOL8aZBPnUVZA94olvxYrZA93rNGKwUIJFFhS91ogEbBBlGQJxYGSyJe5I1dNntxsPnqNYFkoI1NcEroa4TunvZCWZAZA06U0UcpvUu5HgBIifGqZCWTDcUH6sCe7BCWdljg5LU7OjwbRgyLe2nCILijnuGqH",
"type": "OAuthException",
"code": 803,
"fbtrace_id": "BUv80nDC3jo"
}
}
I sent this code from graph API Explorer:
curl -i -X GET \
"https://graph.facebook.com/v3.1/EAAfIhxeHRsYBAD3VNK3BzOqkyhxOL8aZBPnUVZA94olvxYrZA93rNGKwUIJFFhS91ogEbBBlGQJxYGSyJe5I1dNntxsPnqNYFkoI1NcEroa4TunvZCWZAZA06U0UcpvUu5HgBIifGqZCWTDcUH6sCe7BCWdljg5LU7OjwbRgyLe2nCILijnuGqH/subscribed_apps?access_token=EAAfIhxeHRsYBAD8dPXQ6jR06FPFhsECXlALtumbecpEV1iZAk1BRFd580J3NEZBrH8mmn7DWZA9NqlefpskmpMjbZA7HrmdmLVhWmOsHOHzVS1nHLNizqX8ODAItZARTiIig34NZCbXnfwOyRqewiKvnh6fMIwEA4sVICGtFTEJXdsVUiTkZAkDrAI9pbZAAu5KQW5f6ZAktXvQZDZD"
FULL DEBUG INFORMATION:
==== Query
curl -i -X GET \
"https://graph.facebook.com/v3.1/EAAfIhxeHRsYBAD3VNK3BzOqkyhxOL8aZBPnUVZA94olvxYrZA93rNGKwUIJFFhS91ogEbBBlGQJxYGSyJe5I1dNntxsPnqNYFkoI1NcEroa4TunvZCWZAZA06U0UcpvUu5HgBIifGqZCWTDcUH6sCe7BCWdljg5LU7OjwbRgyLe2nCILijnuGqH/subscribed_apps?access_token=<access token sanitized>"
==== Access Token Info
{
"perms": [
"manage_pages",
"pages_manage_instant_articles",
"pages_show_list",
"publish_pages",
"read_page_mailboxes",
"pages_messaging",
"pages_messaging_phone_number",
"pages_messaging_subscriptions",
"public_profile"
],
"user_id": 1077587462403179,
"app_id": 2190807377856198
}
==== Parameters
- Query Parameters
{}
- POST Parameters
{}
==== Response
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: EAAfIhxeHRsYBAD3VNK3BzOqkyhxOL8aZBPnUVZA94olvxYrZA93rNGKwUIJFFhS91ogEbBBlGQJxYGSyJe5I1dNntxsPnqNYFkoI1NcEroa4TunvZCWZAZA06U0UcpvUu5HgBIifGqZCWTDcUH6sCe7BCWdljg5LU7OjwbRgyLe2nCILijnuGqH",
"type": "OAuthException",
"code": 803,
"fbtrace_id": "BUv80nDC3jo"
}
}
==== Debug Information from Graph API Explorer
- https://developers.facebook.com/tools/explorer/2190807377856198?method=GET&path=EAAfIhxeHRsYBAD3VNK3BzOqkyhxOL8aZBPnUVZA94olvxYrZA93rNGKwUIJFFhS91ogEbBBlGQJxYGSyJe5I1dNntxsPnqNYFkoI1NcEroa4TunvZCWZAZA06U0UcpvUu5HgBIifGqZCWTDcUH6sCe7BCWdljg5LU7OjwbRgyLe2nCILijnuGqH%2Fsubscribed_apps&version=v3.1```
[1]: https://developers.facebook.com/tools/explorer/?method=GET&path=%7Bpage-id%7D%2Fsubscribed_apps&version=v3.1

Upload a image to Google Cloud Storage using Rest end point via API-KEY

I am new to Google Cloud. I want to upload an image to my Bucket.
I did it successfully from the GCP Console and GCP Shell. However, I am unable to do it using REST Endpoint using API-KEY.
Here is my URL.
https://www.googleapis.com/upload/storage/v1/b/[MY_BUCKET]/o?uploadType=media&name=myhero&key=[MY_API-KEY]
I am getting the following message
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Anonymous caller does not have storage.objects.create access to [MY_BUCKET]/myhero.",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Anonymous caller does not have storage.objects.create access to [MY_BUCKET]/myhero."
}
}
This is because the bucket currently does not allow any way to allow users with the API-KEY even though the API-KEY allows the user of this key to upload an object to the bucket.
What should I do
1) if I want to go with the API-key way.
2) if I want to go with service-account way. What is the best way to generate Authorisation token? I have come till this point
{"alg":"RS256","typ":"JWT"}.
{
"iss":"761326798069-r5mljlln1rd4lrbhg75efgigp36m78j5#developer.gserviceaccount.com",
"scope":"https://www.googleapis.com/auth/prediction",
"aud":"https://www.googleapis.com/oauth2/v4/token",
"exp":1328554385,
"iat":1328550785
}.
But I am unable to generate {Base64url encoded signature} as I am unable to figure out the private and public keys...
You are getting “anonymous caller” because you are not properly authenticated. You can authenticate using a bearer token instead of the API-KEY.
You can run the following script:
BUCKET=<BUCKET_NAME>
OBJECT=<OBJECT>
TOKEN=$(gcloud auth print-access-token)
curl "https://www.googleapis.com/upload/storage/v1/b/$BUCKET/o?uploadType=media&name=$OBJECT" -H"Authorization: Bearer $TOKEN" -H'Content-Type: image/jpg' --data-binary #$OBJECT

How to share file with room in HipChat via Postman or Jersey client?

Please provide the solution for this (I am new to jersey and postman). I tried with below link but unable to share the file: https://www.hipchat.com/docs/apiv2/method/share_file_with_room
I attached screen shots, which I tried from postman.
Note: I used API access token with send message scope.
I am getting below error as response:
{
"error": {
"code": 400,
"message": "No file was found in the request. See https://www.hipchat.com/docs/apiv2/method/share_file_with_room for an example",
"type": "Bad Request"
}
}

Facebook API send private message from page

I need to send private message from my page (i am the admin) to user who already contacted my page
My reference on that this link
https://developers.facebook.com/docs/messenger-platform/send-api-reference
I am testing this feature via Facebook Graph Explorer
https://developers.facebook.com/tools/explorer
Using version V2.9
Request:
curl -X POST -H "Content-Type: application/json" -d '{
"recipient": {
"id": "USER_ID"
},
"message": {
"text": "hello, world!"
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"
i replace the USER_ID with my id and access token of page i am admin of
But my response is:
{
"error": {
"message": "(#100) No matching user found",
"type": "OAuthException",
"code": 100,
"error_subcode": 2018001,
"fbtrace_id": "AeMT8VK2SbX"
}
}
I know it is required special permission pages_messaging so i am testing this feature using Facebook application Graph API Explorer not my application because it is not approved yet to use this permission
Any idea why i got this error ?

Facebook Graph API Explorer won't delete a request

I'm trying to delete a request via Graph API Explorer. Request is generated by my mobile application. Of course, I use an access token from this application. And I've got the following error:
{
"error": {
"message": "(#2) Failed to delete any app request",
"type": "OAuthException",
"code": 2
}
}
The request exists, I can GET it.
The issue was that I tried to delete a request that didn't belong to me.