Rich communication services (RCS) offers advanced features such as sharing files and media, interactive buttons, and carousels. Use RCS to promote your products and services, send appointment reminders, send important service messages, and more.

This tutorial describes how to send the following message types to end users:

- Over Broadcast: Text message
- Over API: Text, PDF, Audio, Video, Card, and Carousel messages

Customize the examples in the tutorial for other message types.

## Products and channels [#products-channels]

- [RCS](https://www.infobip.com/docs/rcs)
- [Broadcast](https://www.infobip.com/docs/broadcast)

## Prerequisites

- **Infobip account** with **RCS** enabled. Contact your Infobip account manager regarding the number of assigned free credits/RCS messages.

  [Broadcast](https://www.infobip.com/docs/broadcast) is enabled by default with your Infobip account.

  If you do not have an account, [create a free trial account](https://www.infobip.com/docs/essentials/getting-started/create-an-account) and select the **RCS** channel on the welcome screen.

- **Infobip API key** with the `rcs:message:send` scope.

  For information about creating an API key with the required scope, refer to [API authorization](https://www.infobip.com/docs/essentials/api-essentials/api-authorization).
- **HTTP client**. This tutorial uses curl. Alternatively, you can choose the official [Infobip SDK](https://www.infobip.com/docs/sdk) for the required programming language.
- **RCS agent or sender must be configured and launched** on the mobile network/carrier in which you want to check the RCS capability of destination phone numbers.

  If the agent or sender is not launched on the network, the capability check request always returns a negative status for the destination phone numbers.

  To launch the sender or to configure a custom RCS sender, contact your Infobip account manager.
- A **destination phone number** to which you can send the RCS message.

  If the RCS agent is not launched, you can only send messages to safelisted phone numbers.

## Implementation over the Infobip web interface [#implementation-over-web-interface]

### Safelist a phone number [#safelist-web-interface]

Note
This feature is in Early access phase. For more information, contact your Infobip account manager.

1. On the [Infobip web interface](https://portal.infobip.com/login), go to **Channels and numbers** > **Channels** > **RCS Business Messaging** > **Senders** tab.

    A list of all RCS senders for your account and their statuses is displayed.

2. Select the sender that you want to use to send messages.

3. In the **Test devices** tab, select **Add test device**.

4. Enter the phone number in international format with country prefix.

5. Select **Create**.

The new number is in **Pending** status until the tester's invitation is accepted.

When the number is accepted, the status is displayed as **Ready**. You are now ready to send your first test RCS message.

### Send an RCS message over Broadcast

1. On the [Infobip web interface](https://portal.infobip.com/login), go to **Moments** > **Broadcasts**.
2. Select **Create broadcast**.
3. Select **RCS** as the channel.
4. Configure the **Recipients** and **Sender** fields.
5. **Select to create content**.

6. Select the type of message to send. This tutorial uses **Text** message type.

7. Enter the message content.
8. Select **Done designing**.
9. Configure the other fields in the broadcast as required.
10. Check all the fields and rename the broadcast if required.
11. Select **Continue to preview**.
12. Check the preview and make sure that all the information is correct.
13. Select **Launch**.

To see the broadcast, go to **Moments** > **Broadcasts**.

## Implementation over API [#implementation-over-api]

Important
When sending an RCS message over API, the URL of the resource must start with either http:// or https://. The maximum supported file size is 100 MB.

### Safelist a phone number [#safelist-api]

Note
This feature is in Early access phase. For more information, contact your Infobip account manager.

#### How to safelist the phone number

1. In the [RCS Service management](https://www.infobip.com/docs/api/channels/rcs/rcs-service-management) APIs, use the following code:

    ```json
    curl -X POST https://api.infobip.com/rcs/1/senders/{senderName}/test-numbers \
    -H 'Authorization: App {YOUR_API_KEY}'\
    -H 'Content-Type: application/json' \
    {
      "testNumber": "YOUR_DESTINATION"
    }
    ```

    If the API request is successful, you will receive a response with a `200 OK` status that contains a `senderName`, `testNumber`, and `requestStatus`.

    ```json
    curl -X POST https://api.infobip.com/rcs/1/senders/{senderName}/test-numbers \
    -H 'Authorization: App {YOUR_API_KEY}'\
    -H 'Content-Type: application/json' \
    {
        "senderName": "YOUR_SENDER",
        "testNumber": "YOUR_DESTINATION",
        "requestStatus": "PENDING"
    }
    ```

2. To check the request status for the RCS test number, either use a GET request or receive the status on the [webhook](https://www.infobip.com/docs/api/channels/rcs/rcs-service-management/receive-rcs-test-number-update-events).

    GET request:

    ```json
    curl -X POST https://api.infobip.com/rcs/1/senders/{senderName}/test-numbers/{testNumber}/request-status \
    -H 'Authorization: App {YOUR_API_KEY}'\
    -H 'Content-Type: application/json'
    ```

    If the API request is successful, you will receive a response with a `200 OK` status.

    ```json
    {
        "senderName": "YOUR_SENDER",
        "testNumber": "YOUR_DESTINATION",
        "requestStatus": "COMPLETED",
        "completedAt": "2025-05-09T08:17:01.514+0000",
        "errors": []
    }
    ```

You can now send your first test RCS message.

#### Request and Test number status

The following `requestStatus` are available:

- **PENDING**: Request is accepted and is in progress.
- **REJECTED**: Request is rejected. An error occurred when processing the request.
- **COMPLETED**: Request is successfully completed.

The following `testNumberStatus` are available:

- **WAITING_FOR_TESTER_ACCEPTANCE**: Waiting for the user to accept the request to become a tester.
- **APPROVED**: User has accepted to become a tester. Test messages can be sent to that number.
- **EXPIRED**: If the user does not accept the invitation within 24 hours, the status of the test number is changed to EXPIRED.
- **UNSUPPORTED**: Test number is not supported for RCS traffic.
- **FAILED**: Failed because an internal service error occurred when processing the request. Contact the [Infobip Support](https://www.infobip.com/contact) team.

### Supported content types [#supported-content-types-api]

The RCS APIs support the following content types:

- image/jpeg
- image/jpg
- image/gif
- image/png
- audio/aac
- audio/mp3
- audio/mpeg
- audio/mpg
- audio/mp4
- audio/mp4-latm
- audio/3gpp
- application/ogg
- audio/ogg
- video/h263
- video/m4v
- video/mp4
- video/mpeg
- video/mpeg4
- video/webm
- application/pdf

### Send a Text message [#send-text-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "text": "Tutorial test",
        "type": "TEXT"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

```json
{
    "bulkId": "17410073165653388351152",
    "messages": [
        {
            "messageId": "17410073165653388351153",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message sent to next instance"
            },
            "destination": "{YOUR_DESTINATION}"
        }
    ]
}
```

### Send a File message (PDF) [#send-file-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "file": {
          "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
        },
        "type": "FILE"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

### Send a File message (Audio) [#send-audio-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "file": {
          "url": "https://www.computerhope.com/jargon/m/example.mp3"
        },
        "type": "FILE"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

### Send a File message (Video) [#send-video-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "file": {
          "url": "https://cdn-web.infobip.com/uploads/2025/02/RCS%20Business%20Messaging%20product%20video(1).mp4"
        },
        "thumbnail": {
          "url": "https://i.postimg.cc/W3g3G96P/Infobip-Logo-80kb.png"
        },
        "suggestions": [
          {
            "text": "Find out more",
            "postbackData": "more",
            "type": "REPLY"
          }
        ],
        "type": "FILE"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

### Send a Card message [#send-card-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "orientation": "HORIZONTAL",
        "alignment": "LEFT",
        "content": {
          "title": "Rich card tutorial title",
          "description": "Rich card tutorial description",
          "media": {
            "file": {
              "url": "https://i.postimg.cc/QdpVWNsd/Infobip-Demo.png"
            },
            "height": "TALL"
          },
          "suggestions": [
            {
              "text": "Web page",
              "postbackData": "Web page",
              "url": "https://www.infobip.com/rcs",
              "type": "OPEN_URL"
            },
            {
              "text": "Find out more",
              "postbackData": "more",
              "type": "REPLY"
            }
          ]
        },
        "type": "CARD"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

### Send a Carousel message [#send-carousel-api]

Use the following request:

```json
curl -X POST https://api.infobip.com//rcs/2/messages \
-H 'Authorization: App {YOUR_API_KEY}'\
-H 'Content-Type: application/json' \
{
  "messages": [
    {
      "sender": "{YOUR_SENDER}",
      "destinations": [
        {
          "to": "{YOUR_DESTINATION}"
        }
      ],
      "content": {
        "orientation": "HORIZONTAL",
        "alignment": "LEFT",
        "content": {
          "title": "Rich card tutorial title",
          "description": "Rich card tutorial description",
          "media": {
            "file": {
              "url": "https://i.postimg.cc/QdpVWNsd/Infobip-Demo.png"
            },
            "height": "TALL"
          },
          "suggestions": [
            {
              "text": "Web page",
              "postbackData": "Web page",
              "url": "https://www.infobip.com/rcs",
              "type": "OPEN_URL"
            },
            {
              "text": "Find out more",
              "postbackData": "more",
              "type": "REPLY"
            }
          ]
        },
        "type": "CARD"
      }
    }
  ]
}
```

If the API request is successful, you will receive a response with a `200 OK` status that contains a `bulk ID`, `message ID`, `status`, and `destination`.

## Additional resources [#additional-resources]

- RCS API reference documentation
- Subscriptions management API documentation
- [RCS](https://www.infobip.com/docs/rcs) documentation
- [Broadcast](https://www.infobip.com/docs/broadcast) documentation
- [Response status and error codes](https://www.infobip.com/docs/essentials/api-essentials/response-status-and-error-codes) documentation
- Broadcast on the Infobip web interface
- [Infobip SDK](https://www.infobip.com/docs/sdk) documentation