Onboard locations from Business Profile

Business Profile is a free and easy-to-use tool for businesses and organizations to manage their online presence across Google, including Search and Maps.

The Google My Business API provides an interface for managing business location information on Google. A business can grant access through OAuth consent to another business to manage their profile on their behalf.

Managed businesses on Business Profile have already been verified through the Business Profile verification process. If a business you want to enable for Business Messages for is already a verified Business Profile, you can extend the Business Profile OAuth consent flow to onboard that business to Business Messages and auto-verify the business for launch on Business Messages.

This is a more scalable and faster method to launching Business Messages and the recommended flow for enabling messaging for a Business Profile location.

Prerequisites

You must be an existing Business Profile partner with access to the Google My Business APIs. If you aren't, follow the Business Profile prerequisites to apply for access.

Once you are granted access to the Google My Business API, follow their basic setup and OAuth setup guides before continuing.

Enable Business Messages for a verified Business Profile location

  1. In your existing OAuth consent flow where a Business Profile account owner grants you access to call the Google My Business APIs on their behalf, update the API scopes to include

    • https://www.googleapis.com/auth/business.manage
    • https://www.googleapis.com/auth/businesscommunications

    Both scopes are required to successfully auto verify the agent and business locations.

  2. Create an agent with a displayName that matches the name of least one of the Google My Business listings owned by the OAuth credentials you obtained in the previous step. Look up locations with the Google My Business API to find the names of businesses.

    For name matching,

    • Character casing is insensitive.
    • Each word within the agent name needs to match to a word within the GMB location. For example, an agent name "GMB Bakery" matches "Gmb Bakery Mountain View", "Gmb Bakery", and "gmb bakery sunnyvale", but it doesn't match "Bakery San Francisco".
  3. For each location in Business Profile, create a location with the same placeId. The placeId for a Business Profile location is contained within the LocationKey object when a location is retrieved from the Google My Business API.

  4. With the agent you created and the obtained OAuth token, request agent verification.

    The verification request requires brand contact information, but the verification process won't send an email to the brand if the agent name matches the Business Profile name and if you obtained the OAuth token with the correct scopes.

    If you did this correctly, the output from the verification request should immediately return a verificationState of VERIFICATION_STATE_VERIFIED. If verificationState returns a different value, then it's likely that you didn't use the correct OAuth token when making the request or the agent couldn't be matched to a Business Profile location.

  5. Using the same OAuth token, request location verification for all locations owned by the business on Business Profile.

    As with agent verification, if you did this correctly, the output from the verification request should immediately return a verificationState of VERIFICATION_STATE_VERIFIED. If verificationState returns a different value, then it is likely that you didn't use the correct OAuth token when making the request or the Business Profile location isn't a claimed and verified business.

  6. Launch the agent with the entry point LOCATION.

  7. Enable messaging for specific locations by launching the locations that you want to be available through Search and Maps. Once the launch process begins, messaging for each launched location is available to users within a few hours.

Once you follow these steps, all consumer messages are posted to your registered Business Messages webhook, and you must send responses to consumers with the Business Messages API.