Calling the Google Maps API (Business) - api

I'm stumped.
This should be fairly easy, but...
I bought a subscription for the Google Maps Engine for Business - and eventually managed to figure out how to generate a Client ID.
But however I try to call the Maps API, I keep getting the "not allowed" error message.
My script currently tries to fetch
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?client=[CLIENT_ID].apps.googleusercontent.com&sensor=false&v=3.4"></script>
I've tried removing the ".apps.googleusercontent.com" part.
Can anyone spot the error? Is there another way of testing the validity of your client id?
Thanks in advance.

Related

Restrict API access to my Frontend app using daily random API key

I'm creating an API that will be accessed solely by my Vue.js application for displaying data like movie times, video on demand links, etc. No private sensitive info, but I would like to avoid other people and bots using my resources to get free data. I know restricting an API to my own one-page frontend application is almost impossible, as someone can always either:
Get the API key from the page source
Spoof the referrer header to the one that my API is restricted to
So I was thinking to "attenuate the damage", i.e. the amount of bots using my API, by having the backend server generate an API key every day at noon for example. Then when the PHP loads the Vue.js application, it inserts that API key in the Vue.js code, which will use it to query my Python API. If Vue gets an "incorrect API key" error (case when the page was loaded at 11:59 and a request was sent at 12:01), the Vue.js would refresh the page to get the new key.
This way, if someone took the API key from the source, it would expire in less than 24 hours anyways. Of course someone could scrape the page to get the API key every day and still use the API, but I feel this would stop a lot of bots and spammers.
Has anyone ever tried anything like this? Does it sound like a viable solution or there is something better to be done that I couldn't find on StackOverflow?
How about Server-side Rendering from the same location (server, private DNS) as the API server?
You can write fetch(api) within the server function itself.

Outlook REST API calls return internal server error 500

When using the Microsoft Outlook REST API to make calls to my own Outlook Calendar, I receive an internal server error 500. My access tokens are apparently fine and everything, but I still get this error. I thought there might be a problem somewhere in my script, but I get the error even when using the Outlook OAuth Sandbox. I understand that certain Outlook accounts are not REST API-enabled yet, but according to the documentation,
making API calls to mailboxes that are not yet upgraded will return a
MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI error
code.
I do not receive those error codes. So does anyone know what the problem might be?
Sorry to hear that you're having this problem. We recently discovered a scenario where Outlook.com accounts that haven't been migrated onto the REST-enabled platform will get this error instead of the expected MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI code. It sounds like your account hasn't been migrated yet. This is a problem on our side in that we're not returning the correct error.
In the meantime if you need an account to test against, if you create a new account it should be REST-enabled right away.

direct message sync issue with twitter API

I am using the twitter api to get all direct messages
while testing I tried to delete a message from the twitter website and then tried to reload my app's direct message page (get via api) - the dm I deleted was still showing in my app but it wasn't on the account I was using on the website.
I'm not sure whats going on here, any help is appreciated
You usually should give a second after an update/delete operation on Twitter. If you do, I would say that something is going wrong with your code.

Google Search Console Validation Failing

all
I'm attempting to validate my client's website with their Google Search Console account. I've confirmed that the meta tag for site verification is in the head of the site, and that it correctly corresponds with the string that Google is looking for in the Search Console. However, validation repeatedly fails with the message that the meta tag is not in the head of the document. I've also attempted to validate using the client's Google Analytics account, which also returns the error that the async code is not in the head of the document, even though I've confirmed that it is.
Quite puzzled by this, as it's the same process I've used on many other sites, including my own, without ever having issue. Any input in appreciated.
The site in question is http://reasonableandcaringdental.com
Thanks!
...And, it was programmer error :) There was an open tag in the head prior to the Google meta tag, preventing an accurate crawl of the site.

Do any Google Voice APIs still work?

I am interested in writing a simple CLI program that will send an SMS using Google Voice.
There are several scripts and an API or two available, but I have run into an issue that none of them seem to work any longer; as they mostly rely on parsing returned web pages.
Is anyone familiar with a current API that works so that I can send an SMS on Google Voice?
Thanks!
Looks like Google Voice changed the login procedure, and it now expects you to pass back a cookie. This issue for the Python wrapper sums it up: http://code.google.com/p/pygooglevoice/issues/detail?id=60
UPDATE AND FIX: Actually all that needs to happen is to change the login URL in your code:
Old URL - https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral
New URL - https://accounts.google.com/ServiceLogin?service=grandcentral