# Set up RCS P2A conversation with QR code
---

Person-to-Application (P2A) conversations enable end users to initiate conversations with your RCS agent by scanning a QR code. This tutorial describes how to set up a complete P2A conversation flow using QR codes, [inbound configuration](https://www.infobip.com/docs/rcs/get-started#configure-inbound-actions-and-keywords), and [Moments flows](https://www.infobip.com/docs/moments/flow-editor).

## Products and channels [#products-channels]

- [Answers](https://www.infobip.com/docs/answers)
- [Moments](https://www.infobip.com/docs/moments)
- [RCS](https://www.infobip.com/docs/rcs)

## Prerequisites

- **Infobip account**. If you do not have one, you can [create a free trial account](https://www.infobip.com/docs/essentials/getting-started/create-an-account).
- The following enabled in your Infobip account:
  - **RCS channel**
  - Either **[Moments](https://www.infobip.com/docs/moments)** or **[Answers](https://www.infobip.com/docs/answers)**. This tutorial uses Moments.
- **[RCS sender](https://www.infobip.com/docs/rcs/get-started)** registered in testing phase or launched on carriers.
- **RCS-enabled device** for testing.

## Process overview[#process-overview]

This tutorial uses the [Infobip web interface](https://portal.infobip.com/login), which is the web-based user interface used to configure channels, senders, inbound settings, and Moments flows.

The process is as follows:

1. QR code creation
2. Inbound configuration setup
3. Flow setup on the Infobip web interface
4. Testing

## Implementation steps [#implementation-steps]

### Create QR code [#qr-code-creation]

To create a QR code, you need the Google Agent ID from your [RCS sender](https://www.infobip.com/docs/rcs/get-started). You use this ID to create a deep link, which is then encoded into a QR code.

#### Get Google Agent ID [#get-google-agent-id]

1. On the [Infobip web interface](https://portal.infobip.com/login), go to **Channels and numbers** > **Channels** > **RCS Business Messaging** > **Senders**.
2. Select the required sender.
3. Copy the Google Agent ID displayed under the sender name.

Example: `infobip_xe7vkqnx_agent`

#### Create a deep link [#create-deep-link]

A deep link is a URL that opens an RCS conversation with your agent when scanned from a QR code.

You can create deep link URLs in one of the following formats, as defined in GSMA RCC.07 v14.0, section 3.6.3.4:

- **Format 1**: Use only the service ID
- **Format 2**: Use a phone number and service ID

iOS limitation: Format 2 includes automatic fallback to SMS when the recipient device does not support RCS. This fallback behavior does not occur on iOS devices.

For both formats, you can include a pre-filled message that is delivered as message text when the conversation opens.

For more information, refer to the [Google Business Communications documentation](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/deeplinks).

##### Example deep link

The following example shows Format 1 with a pre-filled message `Hi`. Replace `infobip_xe7vkqnx_agent` with your Google Agent ID from the previous step.

```
sms:infobip_xe7vkqnx_agent%40rbm.goog?body=Hi
```

#### Generate the QR code [#generate-qr-code]

Generate a QR code that encodes the deep link using one of the following tools:

- [Google SMS link creator tool](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/deeplinks)
- Any free QR code generator tool available online

Enter the deep link URL into the QR code generator.

After the QR code is generated, proceed with the inbound configuration setup.

### Configure inbound settings [#configure-inbound-settings]

Configure the inbound settings for your RCS sender to route incoming messages to Moments.

1. On the Infobip web interface, go to **Channels and numbers** > **Channels** > **RCS Business Messaging** > **Senders**, select your sender, and select **Edit inbound configuration**.
2. Under **Keywords**, select **Add keyword**.
3. Configure the following fields:
   - **Keyword**: `HI`
     This value is an example keyword used in this tutorial and corresponds to the keyword specified in the deep link Keywords in this field must be uppercase. Keyword matching is case-insensitive, so `HI` will match incoming messages containing `Hi`, `HI`, or `hi`.

   - **Forwarding action**: Select either Follow subscription or Forward to HTTP
   - **Non-forwarding action**: Select **Conversations**

   - **[Application and entities API](https://www.infobip.com/docs/platform/application-entity)**: If you are using [CPaaS X](https://www.infobip.com/docs/cpaas-x) configuration, select the relevant option.

   For additional configuration options and detailed field descriptions, refer to the [RCS inbound configuration documentation](https://www.infobip.com/docs/rcs/get-started).

4. Select **Add keyword**.

### Create the flow in Moments [#flow-setup]

Create a [flow](https://www.infobip.com/docs/moments/flow-editor) in Moments to process incoming RCS messages.

#### Create a new flow [#create-flow]

1. On the Infobip web interface, go to **Moments** > **Flows**.
2. Select **Create flow**.
3. Select **Start from scratch**.
4. Select **Trigger** > **Inbound message**.

#### Configure the trigger [#configure-trigger]

A trigger is an event that starts a flow.

In the **Inbound message** trigger, configure the following:

1. In **Channels and conditions**, select **RCS** as the channel.
2. Select the RCS card to configure it.
3. In **To recipient**, select the RCS sender.
4. In **Condition**, select **Message body** **Contains word** `Hi`.

The value `Hi` corresponds to the keyword configured in the inbound settings step.

For more information, see the [Moments entry points documentation](https://www.infobip.com/docs/moments/flow-elements/flow-entry-exit).

#### Add response element [#add-response]

The response element defines the [message](https://www.infobip.com/docs/rcs/rcs-message-types-and-templates) sent by the RCS agent.

1. Add **Send RCS message** as the next element.

2. Disable **Use messages**
   This setting is used to send pre-created message templates. When disabled, the message content is configured directly in the flow element.
3. In **From**, select the RCS sender.
4. In **Message content**, select **Text**.
5. Enter the message text.
6. Select **Validate**.
7. Select **Activate**.

The flow is now active.

## Testing [#testing]

Test your P2A conversation setup with the steps below:

- If the RCS agent or sender is in testing phase, add the destination phone number as a test device. To add a test device, go to **Channels and numbers** > **Channels** > **RCS Business Messaging** > **Senders**, select your sender, go to the **Test devices** tab, and select **Add device**.
- If the RCS agent is launched on a network, testing is available on supported networks.

### Android device [#testing-android]

1. Scan the QR code with your mobile device.
2. Send the keyword `Hi` to start the conversation.

### iOS [#testing-ios]

1. Scan the QR code with your mobile device.
2. The keyword `Hi` is pre-filled in the messaging app.
3. Select **Send**.

## Additional resources [#additional-resources]

- [Google Business Communications – Start a conversation from an SMS deep link](https://developers.google.com/business-communications/rcs-business-messaging/guides/build/deeplinks)
- [Infobip RCS documentation](https://www.infobip.com/docs/rcs)
- [Moments – Flow editor documentation](https://www.infobip.com/docs/moments/flow-editor)
- [Moments – Manage flow documentation](https://www.infobip.com/docs/moments/manage-flow)