I want to use Get /v1.2/products REST API of Uber in android - uber-api

I want to use Uber in my app by using its Rest API, and when I hit the same from Postman and i will get the same error every time
{
"message": "No authentication provided.",
"code": "unauthorized"
}
after entering the same request as given sample on the Uber Developers Site. you can also check the same here:
this is the link
And I am attaching here the pic of my request.
here is the image

In your Authorization header, replace server_token with Token.
So your example header has:
Authorization:server_token SERVER_TOKEN
replace that with:
Authorization: Token SERVER_TOKEN

Related

Permission issue when publish comment with Facebook Graph API v2.12

I am testing the facebook graph API comments
https://developers.facebook.com/docs/graph-api/reference/v2.12/object/comments
I checked my permission for the access token it contains the permission, which required by API. see the screenshot
I test my object-id (1797963943566411_1975256375837166) which is correct see me screenshot
Change the request method to POST and adding post data {"message": "haha"}
I get the error message shows:
"(#3) Publishing comments through the API is only available for page access tokens" see my screenshot
As you can see the first step checking, I have all the permission that the
API required.
Can any one see any sort of error in this process?
Try another way still not work.
I have a user who post a photo on his own facebook page.
I logged in with this user and give this user all permissions see the screenshot
enter image description here
call /me/accounts to get page access token
enter image description here
copy the page access token into the Graph API Explorer's access token field
call
GET: 1797963943566411_1975256375837166/likes
is working fine
But call POST: 1797963943566411_1975256375837166/likes
Get error response:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "GtEaBfyXrUD"
}
}
The reason is Facebook changed the API behaviour. We are no longer to use api to like any POST on our time line. API can only like or comments on facebook page. Sad face !!!!

Facebook API error subcode 33

I have an app that gets leads from facebook after webhook request when leads fill out forms: Some pages are throwing this error:
{
"error": {
"message": "Unsupported get request. Object with ID '233332620530416' 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": "HIItB4mggfk"
},
"__debug__": {}
}
I cannot find the error subcode description in Facebooks API docs.
Check you access token at https://developers.facebook.com/tools/debug/accesstoken
Your app might be missing a needed permission scope.
Visit Business Settings > Users > System Users > Chose «Conversions API System User» > Add Assets. Add your Pixel with ID from your request to the list of assets System User can access.
I have had this issue a few times and the error led me to spend an hour or two combing the docs. The real issue for me each time has been malformed json in the request body (I'm using curl). Dumb I know, but in case a poor soul comes across this. Be sure to validate your json before you decide you query is wrong.
I got this error when adding access_token in post body, worked when adding parameters to url.
Success result using postman
Not success result using postman
Add your access token in the Authorization tab, then choose Oauth2.0 and add your access token on the right side. Please refer to the screenshot for the postman.Click here for the screenshot
I found the answer recently
Follow this steps using postman
https://graph.facebook.com/page-name/feed
headers:
Content-Type: application/x-www-form-urlencoded
Body:
message: "your message"
link:"your web link "
access_token:'Your access token '

"error": "unsupported_grant_type" uber rest api

I am using Uber Rest Api and trying to get access token:
Step 1:
Calling the get web API - https://login.uber.com/oauth/v1.2/authorize?client_id=gdSzxhaqFwjXly338goebrVCh_A7ND8b&response_type=code
Step 2:
URL: https://login.uber.com/oauth/v2/token
Request Body:
{
"client_secret": "xxxxxxxxxxxxxxxxxxxx",
"client_id": "gdSzxhaqFwjXly33",
"grant_type": "client_credentials",
"redirect_uri": "abc",
"code": "EBvazkPeZXbszs4MufjxA0poKUZuur"
}
and getting the response : "error": "unsupported_grant_type"
Please help me to fix the issue.
Thanks
Suresh Patel
First you should double check if you set the correct redirect url in the dashboard - needs to be the same as one on authorization url. Second your request to 'https://login.uber.com/oauth/v2/authorize' seems to contain invalid version. Please follow the steps of the authentication guide.
Briefly, you need to:
• Send user to authorize url. It starts by redirecting the user to the authorize endpoint: https://login.uber.com/oauth/v2/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=YOUR_REDIRECT_URI .You can add scopes as well (check 'scope' parameter on authentication guide)
• Receive the redirect with an authorization code. After the user approves the scopes the user will be redirected to the redirect_uri with an auth code that you can post to the /v2/token endpoint to receive an access token.
• Make a POST call to: 'https://login.uber.com/oauth/v2/token'
• Store access and refresh token for future use
Try making your scope public.
To do that, add:
"scope: "public"
in your param

Can We Access Facebook Api Using Postman client

I want to access my full details using facebook api . I am using postman client for this and hit api as
URL : graph.facebook.com/v2.2/me
METHOD : GET
HEADER PARAMETER :
AccessToken : djbjd
AppID : dsdmds
AppSecret :sdkkd
Now I get response :
STATUS : 400 Bad Request and Response
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "AQt0krgrd2U"
}
}
Can anyone tell me how I can hit facebook api using postman client .
You only need one GET parameter for this, the access_token parameter. It must be a valid User Token or Page Token.
You can also just try this in the browser directly: https://graph.facebook.com/me?access_token=xxx
I've been using Bearer Token to input the access token on Postman Client. The cool thing about it is you can add it to the folder and have every query inside the folder inherit it from the parent.
This lets me focus on the call and use each folder as an environment for calls related to the same object Page, App, Messenger and other tests

Playframework scala OAuth2 authentication by facebook

There is wonderful tutorial how to use OAuth2 api to be authenticated by github. But if I want to use same api for facebook. I tried following and end up with error. So how can use OAuth2 api for facebook?
fb.client.id=79756xxxxxxxx
fb.client.secret=205adxxxxx
fb.redirect.url= "https://graph.facebook.com/oauth/access_token?client_id=%s&redirect_uri=%s&client_secret=%s&code=%s"
// eventually url is filled as
https://graph.facebook.com/oauth/access_token?toeken&client_id=797565xxxx&redirect_uri=http://localhost:9000/_oauth-callback&client_secret=email&code=e3887ea3-3319-4462-a3b1-xxxxx
// get this error
{
"error": {
"message": "Invalid verification code format.",
"type": "OAuthException",
"code": 100
}
}
Update after updating the request url as
fb.redirect.url="https://graph.facebook.com/oauth/authorize?client_id=%s&redirect_uri=%s"
I managed to get facebook's login prompt. After submitting fb credential my redirect url is called as
http://localhost:9000/_oauth-callback/?code=AQD72MtTesmEIoQty3c0ZTC3a211egWR0pvVcLGhb6lB2T6TslG7r99IouP6KbE4oDYCl7n0_imyI0zxe-8Nb2CUDsRN5pEyQ_Pk6JRwy0JRy3T27kbDJ9DRcr11NrDdlZtNK3tOe6kfTdVQm52YXMTF7L9Kq3N6z0ZIBbVxsizvWZ00kVUL2YkSdnh5mpx4ofKaTgd0pHNhE9X33mBdzS7Evu_R0yW8XqgZFfvEPFE3f1e9qdrbrhwHaj1kfZyk6NigDBpnyZ5CgtzFTDpLHZVKQXCWDNzfqMwlxYuV2amTJUEgq77_HzxnDD3njvU4dJK0lrpVrkimqMeldCFEHzbV#_=_
I don't know how to use this code = XXX. Don't even know what does this code mean? How can ask user public profile info after my redirect url is called? Please let me