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 Business Profile 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. You can extend the Business Profile OAuth consent flow to onboard these businesses to Business Messages and auto-verify them for launch on Business Messages.

This is a more scalable and faster method to launch Business Messages and is 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 Business Profile APIs. If you aren't, follow the Business Profile prerequisites to apply for access.

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

Enable Business Messages for a verified Business Profile location

The following diagram shows how your web service can leverage a brand's Business Profile location verification for a Business Messages agent. See below for detailed instructions.

Flow diagram for verifying agents automatically using Business Profile verification

  1. In your existing OAuth consent flow where a Business Profile account owner grants you access to call the Google Business Profile 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 Business Profile listings owned by the OAuth credentials you obtained in the previous step. Look up locations with the Google Business Profile API to find the names of businesses.

    For name matching,

    • Character casing is insensitive.
    • The agent's full name must exactly match the first word or words in the Business Profile location name. For example, an agent named "GBP Bakery" matches "Gbp Bakery Mountain View", "Gbp Bakery", and "gbp 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 Business Profile API.

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

    The verification request requires brand contact information. However, 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.