OAuthException while posting action - action

I am trying to post an action using the following javascript code:
FB.api('/me/spacemaze:fly_through',
'post',
{maze: 'http://www.gethugames.in/html5spacemaze/', lid: state.currentLevel, score: 1001},
function(resp) {
if(!resp || resp.error) {
console.log('err occured');
console.log(resp.error);
} else {
console.log('successfull action');
console.log(resp);
}
});
But the request fails and get the following error:
code: 1
message: "An unknown error has occurred."
type: "OAuthException"
in Open Graph Dashboard, fly_through is defined as an action with 2 custom properties lid and score of float type. Maze is an Object and I havent created any aggregations.
What is wrong with my code?
EDIT 1:
I got an access token, verified it to be valid in access token debugger, but Issues field says unknown. Not sure if that is a problem.
Then in Graph API Explorer, I posted a query with following fields
URL: me/spacemaze:fly_through
maze: http://www.gethugames.in/html5spacemaze
lid: 5
score: 10.1
but getting the same error:
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
PS: I got permissions for publish_stream and read_stream under extended permissions. Isnt it suffice?

Related

Instagram API graph stories

First I auth my user, which has role instagram Test Users, got access token by doint request to https://api.instagram.com/oauth/access_token Follow Getting Started guide.
Make a request to get user data https://graph.instagram.com/me?fields=username&access_token={{ACCESS_TOKEN}}
Everything OK, got 200 status and data.
Now tried to follow API Stories Docs
make a request to: https://graph.facebook.com/{{IG_ID}}/stories?access_token={{ACCESS_TOKEN}} (IG_ID is the ID I got from user data request) but doesn't work return invalid access token
{
"error": {
"message": "Invalid OAuth access token - Cannot parse access token",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "{ID}" //im not sure if important to hide
}
}
Now tried to use Explorer Api Graph (Tools->Explorer) I generate an access token (this token is generated with Facebook, not instagram), use this token and the ID (/me in Explorer API) in previous request and the response is:
//https://graph.facebook.com/{{ID}}/stories?access_token={{TOKEN}}
{
"error": {
"message": "(#100) Tried accessing nonexisting field (stories) on node type (User)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "{ID}"
}
}
Maybe I'm misunderstanding the guide, anyone have worked with API?
Hmmm... Does API works with private/public accounts? Or only if account is Business/Content Creator might use this?

Getting Error: Bad Request while retrieving the issues through vmware burp-rest-api

I am using vmware burp-rest-api . I have done the api testing and populated the sitemap.
Getting Error: Bad Request while retrieving the issues through swagger UI
Response body:
{
"timestamp": "2020-06-25T05:37:41.198+0000",
"status": 400,
"error": "Bad Request",
"message": "URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 1 in: "1$"",
"path": "/burp/scanner/issues"
}

Can't get page's email using Graph Api

I'm using explorer to test this request "::page_id::?fields=id,name,emails", but it returns this error message:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (emails) on node type (PlaceInformation)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Hzq4cKMXlI1"
}
}
I already tried to use contact_email and user_support_email, but it also didn't work.
What is the right field to get page email?
Take a close look at the error message, it says node type (PlaceInformation). I assume you are trying to use a Place, not a Page. Those are the fields available for Places: https://developers.facebook.com/docs/graph-api/reference/place/

How to fix - Update plannertaskdetails - If-Match header contains an invalid value

I am trying to update (PATCH) an existing Microsoft Planner task, to add one (1) checklist item to it. I am using Microsoft doc https://learn.microsoft.com/en-us/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=javascript as a reference, and I am using Postman to send the request.
{
"error": {
"code": "",
"message": "The If-Match header contains an invalid value.",
"innerError": {
"request-id": "7b50a25b-7c5a-443b-9a41-1b6314be4014",
"date": "2019-05-16T23:59:03"
}
}
}
As far as I can see, the If-Match key is built up exactly the same as how Microsoft's article used it.
I have found a somewhat similar article (https://powerusers.microsoft.com/t5/Connecting-To-Data/Custom-Connector-Graph-The-If-Match-header-must-be-specified-for/td-p/144092), but this person is filling in the If-Match value differently, and it doesn't work for me at all...
I reused the eTAG value from the response received after creating the task in the first place:
"#odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc=\""
Does anyone have a clue what I am doing wrong here?
This is my PATCH:
https://graph.microsoft.com/v1.0/planner/tasks/n...................pYAM-DX/details
These are my headers:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
This is my body:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"#odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
I was expecting the If-Match key to be correct, as I have used the Microsoft article, but somehow it results in the error message:
"The If-Match header contains an invalid value."
I had similar problem. I used etag from task when updates Task details.
The Task and Task Details are different objects.
Check on - MS Graph doc
Get etag value from Task details of created task using:
GET https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details

OAuthException exception with django-social-auth

I'm using django-social-auth to authenticate users for facebook login for my website.
<a href="{% url socialauth_begin 'facebook' %}?redirect_uri={{SITE_URL}}complete/facebook/">
This correctly leads me to an auth dialog, but then when I click "Go To App" in the dialog I get this error from social auth:
Request Method: GET
Request URL: http://[site_url]/complete/facebook/?state=DHlD9efEDau286xRGn2HtVpZ9AbooD3y&code=AQCACZRE3WYGMyBSII1eD-H8Sl8yDUtL6VoZ4qJPKSQ_NDBAoE_6JE7-4Ef353utpAygCZVJMUKiLNs_evC-y2oezOKRsH_njtFZW4FwPE2XoaFm14sdbtUkj1QsqivY6DSpGpsmTNCCs3twYxx-6_C-e1OWEcnd4x6SoBg59LmCUsWhocu739h_ppdLRR_wPjY
Django Version: 1.3.1
Exception Type: AuthFailed
Exception Value:
Authentication failed: There was an error authenticating the app
Exception Location: /app/.heroku/src/social-auth/social_auth/backends/facebook.py in auth_complete, line 131Request Method: GET
Request URL: http://[site_url]/complete/facebook/?state=DHlD9efEDau286xRGn2HtVpZ9AbooD3y&code=AQCACZRE3WYGMyBSII1eD-H8Sl8yDUtL6VoZ4qJPKSQ_NDBAoE_6JE7-4Ef353utpAygCZVJMUKiLNs_evC-y2oezOKRsH_njtFZW4FwPE2XoaFm14sdbtUkj1QsqivY6DSpGpsmTNCCs3twYxx-6_C-e1OWEcnd4x6SoBg59LmCUsWhocu739h_ppdLRR_wPjY
My requirements file is pointing to a forked version of django-social-auth so I could put some print statements around the error. The failure seems to occur after making a call to
https://graph.facebook.com/oauth/access_token?code=AQCc6tIfxJTQN64GGQsDVbT4BCK1hYGypw2oMFQjjMQf-kfJqrWtI-vGe78fJJJHTL6w5yuau90vQu8msVGDpZh30HgUYkwdXhAKJcC9MCf8h6bp1e23wxkkMzP5eaT2j7xOCorn-KgeRv-ZJA40U87GDx1_592amAlSemS4zhXaoAv7JWRHl9NzBFtJ6cuGdbg&client_secret=[app_secret]&redirect_uri=http%3A%2F%2F[site_url]%2Fcomplete%2Ffacebook%2F%3Fredirect_state%3DDHlD9efEDau286xRGn2HtVpZ9AbooD3y&client_id=[app_id]
The error I'm getting from that is
{
"error": {
"message": "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request",
"type": "OAuthException",
"code": 100
}
}
However if i add a slash to the end of the url I get this error:
{
"error": {
"message": "Error validating application. Invalid application ID.",
"type": "OAuthException",
"code": 101
}
}
I assure you that app_id is correct
I know this has been a long read but does anyone have any suggestions on how to fix this?
#omab was correct, my issue was attaching the redirect_uri. It addition to that I had edited django-social-auth to append a backslash to the url. This was also incorrect.