Updates: Check the release notes for new features and product updates.

Verify your infrastructure

After you register an agent, Google sends you a test URL that you can use to verify that your infrastructure and the Business Messages API work as expected. If you open the URL on a mobile device with the Google Maps app installed, it opens a conversation with your agent. When you send a message in this conversation, your webhook receives the message. You can then send a response, which appears in the conversation window as a message from your agent.

If you can receive and send messages, you can design your infrastructure to route and manage messages for your brands' agents. However, performing an initial end-to-end test with the test URL helps you isolate and identify configuration issues.

Initial end-to-end test

For your initial test, use the Echo Agent sample to receive messages from your agent and echo the message content back to the user. This confirms that your infrastructure can both receive and send messages successfully.

Prerequisites

Before you get started, you need to gather a few items:

  • A mobile device with the Google Maps (Android/iOS) app installed
  • Your GCP Project ID
  • Your agent's test URL
  • The path to your service account key on your development machine

Additionally, you need the following software installed on your development machine:

Set up sample

On your development machine, download, extract, and configure the Echo Agent sample.

Node.js

  1. Download Echo Agent Sample - Node.js.
  2. Navigate to the sample's root directory.
  3. Copy your service account key to the /resources directory and rename the file "bm-agent-service-account-credentials.json".

Java

  1. Download Echo Agent Sample - Java.
  2. Navigate to the sample's root directory.
  3. Copy your service account key to the /src/main/resources directory and rename the file "bm-agent-service-account-credentials.json".

Python

  1. Download Echo Agent Sample - Python.
  2. Navigate to the sample's root directory.
  3. Copy your service account key to the /resources directory and rename the file "bm-agent-service-account-credentials.json".

Deploy the sample

  1. In a terminal, navigate to the sample's root directory.
  2. Run the following commands.

    Node.js

    Replace PROJECT_ID with your GCP Project ID.

    gcloud config set project PROJECT_ID
    gcloud app deploy
    

    Java

    Replace PROJECT_ID with your GCP Project ID.

    gcloud config set project PROJECT_ID
    mvn appengine:deploy
    

    Python

    Replace PROJECT_ID with your GCP Project ID.

    gcloud config set project PROJECT_ID
    gcloud app deploy
    

Send a message

  1. On your mobile device, open your agent's test URL. Either tap a link or use the Business Messages Agent Launcher.

    A conversation with the agent opens on your device.

  2. Enter and send the text "Hello, World!".

    Your webhook receives "Hello, World!" from your device and sends "Hello, World!" back as a response from the agent.

If you can't send the message or don't receive a response on your device, confirm the values you identified in Prerequisites, re-deploy the sample, and attempt sending another message. If you continue having issues, contact us. (You must first sign in with a Business Messages Google account. To register for an account, see Register with Business Messages.)

Next steps

Now that you've verified your project configuration and messaging flow, you can build out your message management infrastructure. Once your agent is tested and ready for real users, it's time to verify and launch.