Gayngel Posted March 9, 2014 Share Posted March 9, 2014 Is it possible to place a Google API key into a script. If so what function should I use? Link to comment Share on other sites More sharing options...
Qie Niangao Posted March 9, 2014 Share Posted March 9, 2014 Can you be a little more specific about what Google API you're using, and how you're invoking it? If it happens to be the Maps API as used for SL maps, I can say it's a bit weird in that I don't seem to supply my key when invoking that API from an in-world MoaP javascript, and Google says such keys aren't used for recent Maps API versions, although I do seem to still be supplying it when accessing that API from a browser and it still works. That may need more investigation if starting a new Maps API project today. I'm guessing, however, that you're using a different, non-Maps API. In that case, it's just a string you'll need to include in each properly formatted http request you issue to the API (at least for the few Google APIs I've used). Link to comment Share on other sites More sharing options...
Gayngel Posted March 11, 2014 Author Share Posted March 11, 2014 key http_request_id; default{ state_entry() { http_request_id = llHTTPRequest("https://www.googleapis.com/language/translate/v2?key=APIKey", [], ""); } Link to comment Share on other sites More sharing options...
Qie Niangao Posted March 11, 2014 Share Posted March 11, 2014 I'd assume you'd simply replace the "APIKey" part of the string with the key you got from Google when you created your project in the developers console. I've never used the Translate API, but I understand it to be a paid service these days, and AFAIK these services are all RESTful which suggests a lot more stuff would go into that http request, so I may be missing the point of that code sample. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now