Search code examples
google-beacon-platform

Authenticate Proximity Beacons via API Key


Is it possible to authenticate the Proximity Beacon API using API Keys rather than OAuth Clients? The Authorizing Requests page seems to indicate this is possible, but all my attempts to read endpoints with key=<API_KEY> appended to the request fail with 401: UNAUTHENTICATED.

I am able to successfully access endpoints using OAuth, but would like to opt for a simpler approach if possible.


Solution

  • So, there are a few key parts to the Proximity Beacon API.

    For the Admin (where you can register, modify, or add attachments) and Diagnostic (where you can get operational information about beacons) portions of the API, OAuth is required as these need to know who the authenticating user is. It seems as though most Google APIs are standardising around OAuth 2.0 for security and relative lack of frustration for end users of your apps.

    For the Serving API — Getting details about a beacon when I see it in my app (getforobserved) — you don't need to go through the full OAuth flow. For this, an API key is sufficient to get the information for the sighted beacon(s).