To proceed, make sure you've completed the steps in Prerequisites and that your project has been approved for Google My Business API access.
Enable the APIs
At the moment, there are 7 APIs associated with Google My Business that must be enabled in the Google API Console:
- Google My Business API
- My Business Account Management API
- My Business Lodging API
- My Business Place Actions API
- My Business Notifications API
- My Business Verifications API
- My Business Business Information API
Enable the API
If you've completed all of the Prerequisites and have been granted access to the API, but were unable to use the provided shortcut, you can enable the API manually with the following steps.
To enable an API for your project, do the following:
- Open the API Library in the Google API Console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.
- If the API you want to enable isn't visible in the list, use search to find it.
- Select the API you want to enable, then click the Enable button.
- If prompted, enable billing.
- If prompted, accept the API's Terms of Service.
Request an OAuth 2.0 client ID
Because your app accesses protected, non-public data, you need an OAuth 2.0 client ID. This lets your app request authorization to access your organization's location data on behalf of your app's users.
Your application must send an OAuth 2.0 token with any Google My Business API request that accesses private user data.
Learn REST basics
There are two ways to invoke the API:
- Send an HTTP request and parse the responses.
- Use client libraries.
If you decide not to use client libraries, you need to understand the basics of REST.
REST is a style of software architecture that provides a convenient and consistent approach to request and modify data.
The term REST is short for "Representational State Transfer." In the context of Google APIs, it refers to the use of HTTP verbs to retrieve and modify representations of data stored by Google.
In a RESTful system, resources are stored in a data store. A client sends a request for the server to perform a particular action, such as to create, retrieve, update, or delete a resource, and the server performs the action and sends a response. That response is often in the form of a representation of the specified resource.
In Google's RESTful APIs, the client specifies an action with an HTTP verb, such as
DELETE. The client specifies
a resource by a globally unique uniform resource identifier (URI) of the following form:
Because all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.
You might find the
method definitions in the HTTP 1.1 standards documentation
useful. They include specifications for
REST in the Google My Business APIs
The Google My Business APIs operations map directly to REST HTTP verbs.
The specific format for the Google My Business APIs are shown in the following URI:
The full set of URIs used for each supported operation in the API is summarized in the Google My Business API Reference documentation.
Resource paths vary based on the endpoint.
For example, the resource path to an account appears as in the following example:
The resource path for a location appears in the following form:
Learn JSON basics
The Google My Business API returns data in JSON format.
Make a simple HTTP request
You can use the OAuth 2.0 Playground to experiment with the Google My Business API. Because the Google My Business API isn't a public API, there are a few extra steps you need to take to use it in the Playground. You need a client ID for a web application to proceed.
- Go to the Google API Console and open your project. If you don't have an OAuth client ID for web applications, create one now:
- From the Create credentials drop-down list, select OAuth client ID.
- For Application type, click Web Application.
Add the following as a valid redirect URI:
- Click Create.
- Copy the client ID to the clipboard.
- Go to OAuth 2.0 Playground.
- Click the gear icon to open the configuration options and make the following changes:
- Set OAuth flow to Client-side.
- Select Use your own OAuth credentials.
- Paste in your OAuth client ID.
- Close the configuration options.
Under "Step 1 - Select & authorize APIs," paste the following scope for the Google My Business API into the Input your own scopes field:
- Click Authorize APIs.
- Click Accept when prompted.
Under "Step 2 - Configure request to API," paste the following URI into the Request URI field:
- Click Send the request. The response should show a status of
For more information about how to make various types of requests, see the Google My Business API Reference.
The Google My Business API client libraries support the functionality of the Google My Business API. They provide functionality common to all Google APIs, such as HTTP transport, error handling, authentication, and JSON parsing.
To download client libraries, see Libraries.