Google Place Api for getting autocomplete sugggestion for places - ios

I m using google api for autotext completion. but i m getting could not fetch places. request Denied. I have tryed with also server and browser key. but still getting same responce.

You need to create browser key, and leave the site blank.

Related

List teamworkTags API returning 404

I am trying to run this GET /teams/{team-Id}/tags api in Graph explorer, but returning 404
Also, as per the documentation here, the API requires
Application permission | TeamworkTag.Read.All, TeamworkTag.ReadWrite.All
But these permissions are not present in the list of permission in the Graph Explorer under Modify Permission.
So, Q1: is it not possible to run the API from Graph Explorer ?
Plus, I added permission to my application on Azure and then call the API in my angular application - it still gave me 404.
Q2: What practice should I follow to make this API run?
EDIT:
As per this doc Delegated permission is not supported to run this API, so we tried with Postman and this method returned a 200 OK response code and a collection of teamworkTag objects in the response body.
Steps followed:
Added TeamworkTag.ReadWrite.All application permission n our Azure App.
Get access token as per this
Run this query in Postman.
GET https://graph.microsoft.com/beta/teams/{teamid}/tags

Youtube Data API - How to avoid Google OAuth redirect URL authorization

Requirement: I am trying to upload videos to my Youtube channel through Youtube Data API for Java. The request is sent from a war file hosted on tomcat container.My application is not for external users and I only use it to upload my own generated videos. With the help of the api documentation and sample youtube code snippets, I have successfully managed to post video on youtube.
Problem: The issue is that whenever I try to run the code, I get prompted for
Please open the following address in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=&redirect_uri=http://localhost:8080/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube.upload
Since I run this code on a remote server, it is not possible for me to always open this URL on the browser. Since I have registered my web app in Google Console, and got a pair of Client ID and Secret and a JSON file, so Youtube must allow me to publish videos by default to atleast my channel, isin't it?
I have used the Auth.java file(provided in youtube java code samples) and the following code is where this thing happens.
// Authorize.
return new AuthorizationCodeInstalledApp(flow, localReceiver).authorize("user#.com");
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(8080).build();
Please help here as this is really eating up a lot of my development time.
You should only need to authenticate your code once. When your code is authenticated you get a refresh token back. the refresh token will then allow you to get a new access token the next time your code runs.
There is no service account authentication for the YouTube api. Your code has to be authenticated by you the first time in order to get that refresh token.
I am not a java programmer but from a quick check of the documentation it looks quite similar to what I do in.net. You need to create a datastore to to store the first refreshh token then you should be able to run your code in the future with out needing to authenticate it again.

Calling Google Places/Nearby API from inside an iOS App

I'm trying to call the Google Places API to return a list of restaurants near me. When I call this from a browser it works fine. However, when I call this from inside an iOS App I built using Ionic Framework, it fails with a data NULL, status 0 error.
I researched quite a bit, figured out this was a CORS issue. I looked up Google documentation on how to issue GET requests for iOS App. I used my app's bundle id to create a key and client ID for my app. Using the steps here https://developers.google.com/accounts/docs/OAuth2InstalledApp#overview, I obtained an access_token, which I used as a query parameter just like the docs mentioned. Nothing works. What is going wrong?
URL that works on browser: https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MyServerApplicationsKey&location=33.85463,-84.35870&rankby=distance&types=restaurant
URL that fails from IOS App: https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MyiOSApplicationsKey&location=33.85463,-84.35870&rankby=distance&types=restaurant&access_token=MyToken
#plexer
I use the server key to call the URL from the browser. That works, as mentioned. From the App if I use this key, I get the following error:
{"data":null,"status":0,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"sameUrlThatWorksOnBrowser","headers":{"Accept":"application/json, text/plain, /"}},"statusText":""}
The Google Places API uses a Public API Access key, rather than oAuth. The good news is that these are a lot simpler to get started with.
Follow the instructions under the Authentication section on this page to create a new Public API access key, then include that key in the &key parameter for your application.
After clicking the "Create new Key" button, select "Server key". That's a bit weird, since you are calling the API from iOS, but it will work.

Yahoo - OAuth2 - what is Error 95037?

I am trying to implement oauth2 for yahoo (target is yahoo's contact api). See here: https://developer.yahoo.com/oauth2/guide/#implicit-grant-flow-for-client-side-apps
However, I get the following error:
Oops. Yahoo is unable to process your request.
We recommend that you contact the owner of the application or web site to resolve this issue. [95037]
How to get this resolved? It comes with I use response_type=token (which is needed for Implicit Grant Flow), but works fine for response_type=code
[EDIT]
The request to yahoo (urldecoded):
https://api.login.yahoo.com/oauth2/request_auth?client_id=[CLIENT_ID]&response_type=token&redirect_uri=[PATH]&display=popup&scope=&state={"client_id":"[CLIENT_ID]","network":"yahoo","display":"popup","callback":"_hellojs_23g8z6wk","state":"","redirect_uri":"[PATH]","scope":"friends,basic"}
[UPDATE]
After following the recommendations from HansZ., I was able to resolve it.
Now the issue has come back without changing any code. Basically, it only works when I am logged in with the Yahoo ID that I used to setup the App at Yahoo.
Otherwise, sometimes it goes in loops and chrome says
This webpage has a redirect loop`
rest of the time it gives the error again.
Your state is the problem. I can reproduce the problem by including your URL-encoded state in the authorization request for my Yahoo client. The problem is the length of the state or the total URL. You may revert to using a cookie for maintaining that state and send only the (much shorter) cookie name as the state parameter.

How to use yammer's oauth2 from iOS?

I'm trying to get a iOS client to make use of Yammer's Oauth2 to validate a user. I first tried the GTM-OAuth2 code, but I cannot get it to understand the response from Yammer. It appears that the GTM code is expecting the access_code as a query parameter, where as Yammer is returning it as a uri fragment. I hack he GTM code to see the fragment, but now it appears to be thinking that there is an error because the code and message fields are not in the response from Yammer.
I've also tried to use OAuth2Client api but the problem there is that Yammer does not seem to want to use the redirect_uri I pass to it, so Safari never gets the custom url and therefore never calls back to the app.
Does anyone have a working example of using Yammer's OAuth2?
I would also be interested if anyone has got GTM-OAuth2 to work with Facebook?
Yeah Yammer has a shitty implementation of oAuth. Looks like each service has taken its own implementation of oauth. anyway yammer requires the user to copy a 4-digit code from its website, go back to your service paste that code in your website. Only then you can request for access code.
check this - http://www.tutorialjinni.com/2011/04/yammer-api-example.html (its in php but hope you can get the gist).
Nothing you can do about it but a fun read - Yammer API sucks

Resources