### Response Body Example Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/operations-api/manage-by-api This is an example of the JSON response body returned after updating agent launch information. ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "John Doe", "title": "Contact manager", "email": "john.doe@gmail.com" } ], "optinDescription": "Users accepted our terms of service online.", "triggerDescription": "We are reaching pre-registered users", "interactionsDescription": "This agent sends notifications and processes suggested replies.", "optoutDescription": "Reply stop and we stop.", "agentAccessInstructions": "This is a simple agent that reaches registered users.", "videoUris": [ "https://www.google.com/a/video" ], "screenshotUris": [ "https://www.google.com/a/screenshot" ] }, "launchDetails": { "/v1/regions/thecarrier": { "launchState": "LAUNCH_STATE_REJECTED", "comment": "We don't have a billing contract in place with you.", // Note: The field is optional only for launch approval; otherwise, required. "updateTime": "2023-04-28T15:22:10.221191Z" } } } } ``` -------------------------------- ### Agent Launch Visibility Response Example Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/operations-api/manage-by-api This JSON shows an example response after setting the agent's launch visibility, indicating whether it is hidden. ```json { "name": "brands/8b5c7f80-b025-486b-bc8a-2d0797559711/agents/my-agent-demo/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "John Doe", "title": "Mr", "email": "johndoe@developer.com" } ], "optinDescription": "Messages are sent to known MSISDNs", "triggerDescription": "We respond to any interaction", "interactionsDescription": "Simple conversations with a chatbot", "optoutDescription": "User sends stop" }, "launchDetails": { "/v1/regions/thecarrier": { "launchState": "LAUNCH_STATE_SUSPENDED", "updateTime": "2026-02-20T15:10:36.528669Z", "isHidden": true } } } } ``` -------------------------------- ### Example Webhook for SUGGESTED_ACTION_CLICK Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This example shows a webhook response when a user taps on a suggested action. This generates a single billable event. ```json { "agentId": "...", "senderPhoneNumber": "...", "messageId": "...", "sendTime": "...", "suggestionResponse": { "text": "Click here", "postbackData": "...", "type": "ACTION" }, "richMessageClassification": { "classificationType": "SUGGESTED_ACTION_CLICK" } } ``` -------------------------------- ### Webhook Request Example Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account This example demonstrates how to handle an incoming webhook request. It verifies the clientToken and responds with the secret. ```javascript // clientToken from Configure const myClientToken = "SJENCPGJESMGUFPY"; // Example endpoint app.post("/rbm-webhook", (req, res) => { const msg = req.body; if (msg.clientToken === myClientToken) { res.status(200).send(msg.secret); return; } res.send(400); }); ``` -------------------------------- ### Example Webhook for RICH_MEDIA_MESSAGE (P2A) Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This example shows a webhook response for a user-sent RICH_MEDIA_MESSAGE, which contains an uploaded file. It is billed as a single, flat-rate event. ```json { "agentId": "AGENT_ID", "senderPhoneNumber": "PHONE_NUMBER", "messageId": "MESSAGE_ID", "sendTime": "2025-05-22T20:03:35.474764Z", "userFile": "...", "payload": "...", "richMessageClassification": { "classificationType": "RICH_MEDIA_MESSAGE" } } ``` -------------------------------- ### Upload Multipart Attachment - cURL Example Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/attachments/create This example demonstrates uploading both file metadata and the binary using a multipart request. The metadata must be a JSON object including `attachmentOperationSource`. ```bash curl -X POST \"https://businesscommunications.googleapis.com/upload/v1/{parent=brands/*/agents/*}/attachments?uploadType=multipart\" \"-F\" \"metadata={"attachmentOperationSource": "USER_MESSAGE"}\" \"-F\" \"file=@/path/to/your/file.pdf\" ``` -------------------------------- ### Agent Definition Example Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/operations-api/manage-by-api This JSON object shows an example of an agent's definition as returned by the API. ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent", "displayName": "My new agent", "rcsBusinessMessagingAgent": { "description": "This is the agent description that will be displayed in the Agent info tab in Messages", "logoUri": "https://agent-logos.storage.googleapis.com/_/kt90w53vzw2QSxK6PG1uCeJf", "heroUri": "https://agent-logos.storage.googleapis.com/_/kt90vzob74GQcfeHoEQbVRTP", "phoneNumbers": [ { "phoneNumber": { "number": "+12223334444" }, "label": "Call support" } ], "privacy": { "uri": "https://policies.google.com/privacy", "label": "Our privacy policy" }, "termsConditions": { "uri": "https://policies.google.com/terms", "label": "Our Terms and Conditions" }, "color": "#0B78D0", "billingConfig": { "billingCategory": "NON_CONVERSATIONAL" }, "agentUseCase": "MULTI_USE", "hostingRegion": "NORTH_AMERICA", "partner": { "partnerId": "unique-identifier-for-my-partner", "displayName": "My partner", "company": "Public name of the company for my partner" } } } ``` -------------------------------- ### Agent Launch Information Example Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/operations-api/manage-by-api This JSON object represents the launch information returned by the API for an agent. ```json { "name": "brands/8b5c7f80-b025-486b-bc8a-2d0797559711/agents/my-agent-demo/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "John Doe", "title": "Mr", "email": "johndoe@developer.com" } ], "optinDescription": "Messages are sent to known MSISDNs", "triggerDescription": "We respond to any interaction", "interactionsDescription": "Simple conversations with a chatbot", "optoutDescription": "User sends stop" }, "launchDetails": { "/v1/regions/thecarrier": { "launchState": "LAUNCH_STATE_LAUNCHED", "updateTime": "2023-02-20T15:10:36.528669Z" } } } } ``` -------------------------------- ### Example Dialogflow Event with Parameters Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/rest/v1/phones.dialogflowMessages This example shows how to use parameters within a Dialogflow event to personalize an agent's response. The `eventName` 'welcome_event' is used, and the `parameters` object includes a 'name' field set to 'Sam', which can be used to greet the user. ```json { "eventName": "welcome_event", "parameters": { "name": "Sam" } } ``` -------------------------------- ### Send a simple message with a suggested action Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/libraries/send-messages This example demonstrates sending a basic text message with a 'View Location' suggested action. ```APIDOC ## Send a simple message with suggested action This code demonstrates how to send a simple text message with a 'View Location' suggested action. ### Language: C# ```csharp using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // create an view location action ViewLocationAction viewLocationAction = new ViewLocationAction { Query = "Googleplex Mountain View, CA" }; // Attach the view location action to a suggested action SuggestedAction suggestedAction = new SuggestedAction { ViewLocationAction = viewLocationAction, Text = "View map", PostbackData = "postback_data_1234" }; // Attach the action to a suggestion object Suggestion suggestion = new Suggestion { Action = suggestedAction }; List suggestions = new List { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions ); ``` ``` ```APIDOC ## Share a location The following code sends a Share location action to a device with a client library. ### Language: Node.js ```javascript // Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define a share location suggested action let suggestions = [ { action: { text: 'Share your location', postbackData: 'postback_data_1234', shareLocationAction: { } } }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with a share location suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); }); ``` ``` ```APIDOC ### Language: Java ```java import com.google.api.services.rcsbusinessmessaging.v1.model.ShareLocationAction; import com.google.api.services.rcsbusinessmessaging.v1.model.SuggestedAction; import com.google.api.services.rcsbusinessmessaging.v1.model.Suggestion; import com.google.rbm.RbmApiHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); // Create suggestions for chip list List suggestions = new ArrayList(); // creating a share location suggested action ShareLocationAction shareLocationAction = new ShareLocationAction(); // creating a suggested action based on a share location action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Share location"); suggestedAction.setPostbackData("postback_data_1234"); suggestedAction.setShareLocationAction(shareLocationAction); // attaching action to a suggestion Suggestion suggestion = new Suggestion(); suggestion.setAction(suggestedAction); suggestions.add(suggestion); // Send simple text message with the suggestion action rbmApiHelper.sendTextMessage( "Hello, world!", "+12223334444", suggestions ); } catch(Exception e) { e.printStackTrace(); } ``` ``` ```APIDOC ### Language: Python ```python # Reference to RBM Python client helper and messaging object structure from rcs_business_messaging import rbm_service from rcs_business_messaging import messages # Create a share location suggested action suggestions = [ messages.ShareLocationAction('Share location', 'reply:postback_data_1234') ] # Create text message to send to user text_msg = messages.TextMessage('Hello, world!') cluster = messages.MessageCluster().append_message(text_msg) # Append suggestions for the message to send to the user for suggestion in suggestions: cluster.append_suggestion_chip(suggestion) # Send a simple message with suggested action to the device cluster.send_to_msisdn('+12223334444') ``` ``` ```APIDOC ### Language: C# (Share Location) ```csharp using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Create a share location action ShareLocationAction shareLocationAction = new ShareLocationAction(); // Attach the share location action to a suggested action SuggestedAction suggestedAction = new SuggestedAction { ShareLocationAction = shareLocationAction, Text = "Share location", PostbackData = "postback_data_1234" }; // Attach the action to a suggestion object Suggestion suggestion = new Suggestion { Action = suggestedAction }; List suggestions = new List { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions ); ``` ``` -------------------------------- ### C# Pub/Sub Pull Snippet Source: https://developers.google.com/business-communications/rcs-business-messaging/whats-new/past-releases Example of how to implement Pub/Sub pull functionality in C#. ```csharp using Google.Cloud.PubSub.V1; using System; using System.Threading.Tasks; public class PubSubPull { public async Task PullMessagesAsync(string projectId, string subscriptionId) { SubscriptionName subscriptionName = SubscriptionName.FromProjectSubscription( projectId, subscriptionId); // Create a subscriber client for the subscription. SubscriberClient subscriberClient = await SubscriberClient.CreateAsync(subscriptionName); // Begin receiving messages asynchronously. await foreach (ReceivedMessage message in subscriberClient.PullAsync()) { Console.WriteLine($"Received message {message.Message.MessageId} with data: {message.Message.Data}"); // Acknowledge the message so that it is removed from the subscription. await message.AckAsync(); } } } ``` -------------------------------- ### Get Agent Integration Details (Node.js) Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/webhooks Retrieve details of an existing agent integration. Requires initialization with service account credentials. ```javascript const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper .getAgentIntegration(integrations.integrations[0].name) .then((response) => { console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); }); ``` ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_hfaoplpu_agent/integrations/4efdb82f-fd6d-4ba4-8ea3-f2f4a60d1547", "status": "ENABLED", "agentWebhookIntegration": { "webhookUri": "https://myrbmserviceendpoint.somewhere.com/callback" } } ``` -------------------------------- ### Get Agent Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents Get information about an agent. ```APIDOC ## get ### Description Get information about an agent. ### Method GET ### Endpoint /v1/agents/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The name of the agent to retrieve. ``` -------------------------------- ### Get Tester Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest Gets the invite status of a tester device. ```APIDOC ## GET /v1/{name=testers/*} ### Description Gets the invite status of a tester device. ### Method GET ### Endpoint /v1/{name=testers/*} ``` -------------------------------- ### Agent Launch Information (Java Example) Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/agents This Java code snippet shows how to request an agent launch and the structure of the returned agent launch information. ```APIDOC ## requestRbmAgentLaunch ### Description Requests the launch of an agent to specified regions, optionally including questionnaire details. Returns the agent launch information. ### Method (Implicitly a POST request via SDK method) ### Endpoint (Not explicitly defined, but implied by the SDK method) ### Parameters #### Path Parameters - **agent.getName()** (string) - Required - The name of the agent. - **regionIds** (array) - Required - A list of region IDs to launch the agent to. #### Request Body - **q** (Optional) - Optional - Questionnaire details for the agent launch. ### Response #### Success Response - **name** (string) - The resource name of the launch. - **rcsBusinessMessaging** (object) - RCS Business Messaging specific configurations. - **questionnaire** (object) - Questionnaire details. - **contacts** (array) - List of contacts. - **optinDescription** (string) - Description of the opt-in process. - **triggerDescription** (string) - Description of the trigger. - **interactionsDescription** (string) - Description of interactions. - **optoutDescription** (string) - Description of the opt-out process. - **agentAccessInstructions** (string) - Instructions for accessing the agent. - **videoUris** (array of strings) - URIs for videos. - **screenshotUris** (array of strings) - URIs for screenshots. - **launchDetails** (object) - Details about the launch in different regions. - **region_id** (object) - Launch state and update time for a specific region. - **launchState** (string) - The current launch state. - **updateTime** (string) - The time the launch status was last updated. - **launchRegion** (string) - The region the agent is launched in (deprecated). ### Request Example (Java) ```java Optional q = Optional.of(AgentFactory.createRbmQuestionnaire()); AgentLaunch launch = api.requestRbmAgentLaunch(agent.getName(), regionIds, q); logger.info("RBM agent updated launch: " + launch); ``` ### Response Example ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "James Bond", "title": "Mr O O 7", "email": "someone@somewhere.com" } ], "optinDescription": "Users accepted our terms of service online.", "triggerDescription": "We are reaching preregistered users", "interactionsDescription": "This agent does not do much.", "optoutDescription": "Reply stop and we stop.", "agentAccessInstructions": "This is a a simple agent that reaches registered users.", "videoUris": [ "https://www.google.com/a/video" ], "screenshotUris": [ "https://www.google.com/a/screenshot" ] }, "launchDetails": { "/v1/regions/some-carrier": { "launchState": "LAUNCH_STATE_PENDING", "updateTime": "2023-02-24T15:02:13.903554Z" } }, "launchRegion": "NORTH_AMERICA" } } ``` ``` -------------------------------- ### Get Agent Launch Information Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents Gets the launch information for an agent. ```APIDOC ## getLaunch ### Description Gets the launch information for an agent. ### Method GET ### Endpoint /v1/agents/{name}:getLaunch ### Parameters #### Path Parameters - **name** (string) - Required - The name of the agent for which to get launch information. ``` -------------------------------- ### Batch Get Users Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/rest Gets the RCS-enabled phone numbers for a list of users. ```APIDOC ## POST /v1/users:batchGet ### Description Gets the RCS-enabled phone numbers for a list of users. ### Method POST ### Endpoint /v1/users:batchGet ``` -------------------------------- ### Create a Brand using Node.js Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/brands Initialize the API with your credentials and call the createBrand method. The response includes the new brand's details. ```javascript const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper.createBrand('My new brand').then((response) => { console.log('The new brand is:'); console.log(response.data); }).catch((err) => { console.log(err); }); ``` -------------------------------- ### Example API Response for RICH_MEDIA_MESSAGE Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This is an example of an API response when a message is classified as a RICH_MEDIA_MESSAGE. ```json { "name": "...", "sendTime": "2025-05-22T20:03:35.474764Z", "contentMessage": { ... }, "richMessageClassification": { "classificationType": "RICH_MEDIA_MESSAGE" } } ``` -------------------------------- ### List Brands using Node.js Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/brands Initialize the API and call listBrands to get all available brands. The response data contains the list of brands. ```javascript const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper.listBrands().then((response) => { console.log('Current brands available are:'); console.log(response.data); }).catch((err) => { console.log(err); }); ``` -------------------------------- ### Upload Media Attachment - cURL Example Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/attachments/create Use this command to upload a file binary directly. Ensure the `--upload-file` flag points to the correct file path and the `attachmentOperationSource` query parameter is included. ```bash curl -X POST \"https://businesscommunications.googleapis.com/upload/v1/{parent=brands/*/agents/*}/attachments?uploadType=media&attachmentOperationSource=USER_MESSAGE\" \"--upload-file\" \"/path/to/your/file.pdf\" ``` -------------------------------- ### Get an integration Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents.integrations/get Use a GET request to retrieve an integration. The `name` parameter specifies the unique identifier for the integration. ```APIDOC ## GET brands.agents.integrations.get ### Description Retrieves an integration with the specified URL format. ### Method GET ### Endpoint `https://businesscommunications.googleapis.com/v1/{name=brands/*/agents/*/integrations/*}` ### Parameters #### Path Parameters - **name** (string) - Required. The unique identifier of the integration. Example: `brands/1234/agents/5678/integrations/9092` ### Request Body The request body must be empty. ### Response #### Success Response (200) - **Integration** (object) - Contains the details of the integration. ### Authorization scopes - `https://www.googleapis.com/auth/businesscommunications` ``` -------------------------------- ### brands.agents.requestLaunch Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents/requestLaunch Begins the launch process for an agent, making it available to users. An agent can only have one launch instance at a time. ```APIDOC ## brands.agents.requestLaunch ### Description Begins the launch process for an agent, making it available to users. An agent can only have one launch instance at a time. ### Method POST ### Endpoint `https://businesscommunications.googleapis.com/v1/{name=brands/*/agents/*}:requestLaunch` ### Parameters #### Path Parameters - **name** (string) - Required. The unique identifier of the agent. Example: `brands/1234/agents/5678`. #### Request Body - **agentLaunch** (object) - Required. The agent launch to create. Name and Launch status are ignored. ```json { "agentLaunch": { "object (AgentLaunch)" } } ``` ### Response #### Success Response (200) - **AgentLaunch** (object) - An instance of `AgentLaunch`. ### Authorization scopes - `https://www.googleapis.com/auth/businesscommunications` ``` -------------------------------- ### Get Agent Verification Information Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents/getVerification Retrieves the verification status and details for a given agent. This is an HTTP GET request. ```APIDOC ## GET brands.agents.getVerification ### Description Gets the verification information for an agent. ### Method GET ### Endpoint `https://businesscommunications.googleapis.com/v1/{name=brands/*/agents/*/verification}` ### Parameters #### Path Parameters - **name** (string) - Required. The unique identifier of the brand and agent verification. ### Request Body The request body must be empty. ### Response #### Success Response (200) - **AgentVerification** (object) - Contains the agent's verification information. ### Authorization Scopes - `https://www.googleapis.com/auth/businesscommunications` ``` -------------------------------- ### Get device capabilities using C# Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/capabilities This C# snippet shows how to initialize the RBM API helper with credentials and project ID, then retrieve device capabilities. ```csharp using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Register the device as a tester Capabilities capabilities = rbmApiHelper.GetCapability("+12223334444"); ``` -------------------------------- ### Example Webhook POST Request Body Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/get-started/partner-account This is an example of the JSON payload structure for a POST request sent to your webhook endpoint. ```json { "clientToken":"SJENCPGJESMGUFPY", "secret":"1234567890" } ``` -------------------------------- ### Launch an agent to one or more regions (initial launch) Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/agents This section describes how to launch an agent for the first time to one or more regions. It requires providing a map of all desired regions in the request body. ```APIDOC ## POST /v1/brands/BRAND_ID/agents/AGENT_ID:requestLaunch ### Description Launches an agent to one or more regions for the first time. The request body must include a map of all regions the agent should be launched to. ### Method POST ### Endpoint https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID:requestLaunch ### Parameters #### Request Body - **name** (string) - Required - The resource name of the launch, formatted as `brands/BRAND_ID/agents/AGENT_ID/launch`. - **rcsBusinessMessaging** (object) - Required - Contains RCS Business Messaging specific configurations. - **questionnaire** (object) - Optional - Information about the agent's questionnaire. - **contacts** (array) - Optional - A list of contact persons for the agent. - **name** (string) - Required - The name of the contact person. - **title** (string) - Required - The title of the contact person. - **email** (string) - Required - The email address of the contact person. - **optinDescription** (string) - Optional - Description of the opt-in process for users. - **triggerDescription** (string) - Optional - Description of how the agent is triggered. - **optoutDescription** (string) - Optional - Description of how users can opt out. - **agentAccessInstructions** (string) - Optional - Instructions for accessing the agent. - **videoUris** (array of strings) - Optional - URIs for videos related to the agent. - **screenshotUris** (array of strings) - Optional - URIs for screenshots of the agent. - **launchDetails** (object) - Required - Details about the launch in different regions. - **region_id** (object) - Required - An empty object representing a region to launch to. Example: `/v1/regions/fi-rcs`. ### Request Example ```json { "name": "brands/BRAND_ID/agents/AGENT_ID/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "Contact person 000", "title": "Contact manager 000", "email": "user@domain.com000" } ], "optinDescription": "Opt-in description 0", "triggerDescription": "Trigger description 0", "optoutDescription": "Opt-out description 0", "agentAccessInstructions": "Agent instructions 0", "videoUris": [ "https://www.youtube.com/watch?v=NN75im_us4k" ], "screenshotUris": [ "https://www.youtube.com/watch?v=NN75im_us4k" ] }, "launchDetails": { "/v1/regions/fi-rcs": {} } } } ``` ``` -------------------------------- ### Example Webhook for RICH_MESSAGE (P2A) Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This example shows a webhook response for a user-sent RICH_MESSAGE, which contains only text. It includes the segment count for billing. ```json { "agentId": "AGENT_ID", "senderPhoneNumber": "PHONE_NUMBER", "messageId": "MESSAGE_ID", "sendTime": "2025-05-22T20:03:35.474764Z", "text": "Hello, world!", "richMessageClassification": { "classificationType": "RICH_MESSAGE", "segmentCount": 1 } } ``` -------------------------------- ### Create Open URL Suggested Action (Python) Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/send This Python snippet shows how to create an 'Open Google' suggested action using the RCS Business Messaging client helper. It defines the action's text, postback data, and the URL to be opened. ```python # Reference to RBM Python client helper and messaging object structure from rcs_business_messaging import rbm_service from rcs_business_messaging import messages # Create an open url suggested action suggestions = [ messages.OpenUrlAction('Open Google', 'reply:postback_data_1234', 'https://www.google.com') ] ``` -------------------------------- ### A2P API Response Example for RICH_MESSAGE Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This example demonstrates the `richMessageClassification` field in a successful RBM API call response for an agent-sent message classified as a RICH_MESSAGE. ```APIDOC ## A2P API Response Example for RICH_MESSAGE ### Description This example shows the `richMessageClassification` field in a successful RBM API call response for messages sent by the agent. ### Response Example ```json { "name": "...", "sendTime": "2025-05-22T20:03:35.474764Z", "contentMessage": { ... }, "richMessageClassification": { "classificationType": "RICH_MESSAGE", "segmentCount": 5 } } ``` ``` -------------------------------- ### Get Agent Launch Information Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands.agents/getLaunch Retrieves the launch information for a specific agent. This method uses an HTTP GET request and requires the agent's unique identifier. ```APIDOC ## GET brands.agents.getLaunch ### Description Gets the launch information for an agent. ### Method GET ### Endpoint `https://businesscommunications.googleapis.com/v1/{name=brands/*/agents/*/launch}` ### Parameters #### Path Parameters - **name** (string) - Required. The unique identifier of the agent launch. ### Request Body The request body must be empty. ### Response #### Success Response (200) - **AgentLaunch** (object) - If successful, the response body contains an instance of AgentLaunch. ### Authorization scopes Requires the following OAuth scope: - `https://www.googleapis.com/auth/businesscommunications` ``` -------------------------------- ### RBM API Error Example Source: https://developers.google.com/business-communications/rcs-business-messaging/support/overview/troubleshooting This is an example of an error response from the RBM APIs, showing the error code, message, and status. This format is useful for debugging API calls. ```json "error": { "code": 403, "message": "There was an error looking up the RBM agent (ID: my-test-agent@rbm.goog) that corresponds to the Google Cloud Platform (GCP) project you're authenticating with.", "status": "PERMISSION_DENIED", } ``` -------------------------------- ### Create and Launch an RBM Agent in Java Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/agents Use this Java code to create a new RBM questionnaire and request an agent launch. It returns the agent launch information. ```java Optional q = Optional.of(AgentFactory.createRbmQuestionnaire()); AgentLaunch launch = api.requestRbmAgentLaunch(agent.getName(), regionIds, q); logger.info("RBM agent updated launch: " + launch); ``` ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "James Bond", "title": "Mr O O 7", "email": "someone@somewhere.com" } ], "optinDescription": "Users accepted our terms of service online.", "triggerDescription": "We are reaching preregistered users", "interactionsDescription": "This agent does not do much.", "optoutDescription": "Reply stop and we stop.", "agentAccessInstructions": "This is a a simple agent that reaches registered users.", "videoUris": [ "https://www.google.com/a/video" ], "screenshotUris": [ "https://www.google.com/a/screenshot" ] }, "launchDetails": { "/v1/regions/some-carrier": { "launchState": "LAUNCH_STATE_PENDING", "updateTime": "2023-02-24T15:02:13.903554Z" } }, "launchRegion": "NORTH_AMERICA" } } ``` -------------------------------- ### Import Java Library Source: https://developers.google.com/business-communications/rcs-business-messaging/reference/libraries Import the `RbmApiHelper` class where required in your Java code. ```java import com.google.rbm.RbmApiHelper; ``` -------------------------------- ### Example API response for RICH_MESSAGE Source: https://developers.google.com/business-communications/rcs-business-messaging/carriers/billing/us-billing-model This example shows the `richMessageClassification` field in a successful RBM API call response for an agent-sent message classified as a RICH_MESSAGE, including the segment count. ```json { "name": "...", "sendTime": "2025-05-22T20:03:35.474764Z", "contentMessage": { ... }, "richMessageClassification": { "classificationType": "RICH_MESSAGE", "segmentCount": 5 } } ``` -------------------------------- ### Upload Video and Thumbnail Files Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/send Uploads a video and a thumbnail file to be used in a message. Ensure the `oauth2l header` command is correctly configured with your service account key path. ```bash curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/upload/v1/files?agentId=AGENT_ID" \ -H "Content-Type: video/mp4" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ --upload-file "FULL_PATH_TO_VIDEO_MEDIA_FILE" # Capture server-specified video file name from response body JSON curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/upload/v1/files?agentId=AGENT_ID" \ -H "Content-Type: image/jpeg" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ --upload-file "FULL_PATH_TO_THUMBNAIL_MEDIA_FILE" # Capture server-specified image file name from response body JSON ``` -------------------------------- ### Send Message for Check-in Process Start Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/use-cases/boarding-wallet Sends a simple text message to inform the user about the start of the check-in process and its steps. This is typically followed by sending a policy image. ```javascript const params = { messageText: "OK, great. It's just 3 simple steps to check in. Here's the first step to get you onboard:", msisdn: msisdn, }; let self = this; rbmApiHelper.sendMessage(params, function (response, err) { self.sendPolicyImage(msisdn); }); ``` -------------------------------- ### Launch an Agent to New Regions using cURL Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/agents Use this cURL command to launch an agent to one or more regions for the first time. Ensure all required fields for the questionnaire are provided. ```curl curl -X POST \ "https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID:requestLaunch" \ -H "Content-Type: application/json" \ -H "$(oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications)" \ -d "{ 'name': 'brands/BRAND_ID/agents/AGENT_ID/launch', 'rcsBusinessMessaging': { 'questionnaire': { 'contacts': [ { 'name': 'Contact person 000', 'title': 'Contact manager 000', 'email': 'user@domain.com000' } ], 'optinDescription': 'Opt-in description 0', 'triggerDescription': 'Trigger description 0', 'optoutDescription': 'Opt-out description 0', 'agentAccessInstructions': 'Agent instructions 0', 'videoUris': [ 'https://www.youtube.com/watch?v=NN75im_us4k' ], 'screenshotUris': [ 'https://www.youtube.com/watch?v=NN75im_us4k' ] }, 'launchDetails': { '/v1/regions/fi-rcs': {} } } }" ``` -------------------------------- ### Updated Agent Launch Details JSON Structure (Node.js) Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/management-api/agents Example JSON structure showing updated agent launch details after adding a new carrier. This includes the newly added carrier in the `launchDetails` object. ```json { "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch", "rcsBusinessMessaging": { "questionnaire": { "contacts": [ { "name": "James Bond", "title": "Mr O O 7", "email": "someone@somewhere.com" } ], "optinDescription": "Users accepted our terms of service online.", "triggerDescription": "We are reaching preregistered users", "interactionsDescription": "This agent does not do much.", "optoutDescription": "Reply stop and we stop.", "agentAccessInstructions": "This is a a simple agent that reaches registered users.", "videoUris": [ "https://www.google.com/a/video" ], "screenshotUris": [ "https://www.google.com/a/screenshot" ] }, "launchDetails": { "/v1/regions/some-carrier": { "launchState": "LAUNCH_STATE_PENDING", "updateTime": "2023-02-24T15:02:13.903554Z" }, "/v1/regions/another-carrier": { "launchState": "LAUNCH_STATE_PENDING", "updateTime": "2023-02-24T15:04:50.456552Z" } }, "launchRegion": "NORTH_AMERICA" } } ``` -------------------------------- ### Get the invite status of a test device Source: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/test Query the RBM Management API to get the invite status of a specific test device. This is useful to check if a tester has accepted or declined your invitation. ```APIDOC ## Get the invite status of a test device When you invite a tester, they can either accept or decline the invite on their device. You can query the API for the device's invite status. ### Console To get the invite status of a test device with the RCS for Business Developer Console: 1. Open the RCS for Business Developer Console, sign in with your RBM Google Account, and click your agent. 2. On the left menu, select **Devices**. 3. Add a test device to the **Test devices list** by entering the device's phone number, including the country code and the area code. To add multiple phone numbers, separate them with commas. When a test device is added to the list, you can check its status in the **Status** column. ### API To get the invite status of a test device with the RBM Management API: * Use the following code. For formatting and value options, see `testers`. ### cURL ```bash curl -X GET "https://businesscommunications.googleapis.com/v1/testers/PHONE_NUMBER?agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications`" ``` ```