Sending messages
Last updated
Was this helpful?
Last updated
Was this helpful?
The Channels API supports many of the features of Google RCS; however, due to the omni-channel nature of the API, there may be some differences between the Channels API message and the native Google RCS API.To send a Google RCS message, you must have an active Google RCS channel and perform an HTTP request to the following endpoint with a valid access key
When sending outbound messages as well as setting the receiver information you must set message body field in all cases except for sending a message template when you must only set the template field
Body
{
"receiver": {
"contacts": [
{
"identifierKey": "phonenumber",
"identifierValue": "+31612345678"
}
]
},
"body": {...}
}
Template
{
"receiver": {
"contacts": [
{
"identifierKey": "phonenumber",
"identifierValue": "+31612345678"
}
]
},
"template": {...}
}
You can send messages to users who have opted in to receiving messages from your Google RCS Agent and are also on a carrier that you have launched your Agent with.
The Channels API supports many of the features of Google RCS; however, due to the omni-channel nature of the API, there may be some differences between the Channels API message and the native Google RCS API. Here is an overview of the Google RCS message types and Channels API message types:
basic message
image
video
location
rich messages + suggestions
rich card
carousel
Supported file types
Image
image/jpeg, image/jpg, image/gif, image/png
Video
video/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webm
File
application/pdf
{
"type": "text",
"text": {
"text": "Single text message"
}
}
{
"type": "text",
"text": {
"text": "Single text message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 2"
}
}
]
}
}
{
"type": "text",
"text": {
"text": "Single text message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action 1",
"payload": "postback-payload-1"
}
},
{
"type": "postback",
"postback": {
"text": "Postback action 2",
"payload": "postback-payload-2"
}
}
]
}
}
{
"type": "text",
"text": {
"text": "Single text message with reply and postback actions",
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action 1",
"payload": "postback-payload-1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message"
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message"
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload-1",
"text": "Postback option 1"
}
},
{
"postback": {
"payload": "postback-payload-2",
"text": "Postback option 2"
},
"type": "postback"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 2"
}
}
]
}
}
{
"type": "image",
"image": {
"text": "Single image message with postback and reply actions",
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action",
"payload": "postback-payload"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action"
}
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload-1",
"text": "Postback action 1"
}
},
{
"postback": {
"payload": "postback-payload-2",
"text": "Postback action 2"
},
"type": "postback"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"reply": {
"text": "Reply action 2"
},
"type": "reply"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Multiple images message with postback and reply actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload",
"text": "Postback action"
}
},
{
"reply": {
"text": "Reply action"
},
"type": "reply"
}
]
}
}
{
"type": "file",
"file": {
"text": "Single file message",
"files": [
{
"contentType": "video/mp4",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FtXMQ4lIinia9ehf4EpC4%2Fvideo.mp4?alt=media"
}
]
}
}
{
"type": "file",
"file": {
"text": "Multiple files message",
"files": [
{
"contentType": "video/mp4",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FtXMQ4lIinia9ehf4EpC4%2Fvideo.mp4?alt=media"
},
{
"contentType": "application/pdf",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FPnRToYX2feW96HAOrh4x%2Fdocument.pdf?alt=media"
}
]
}
}
{
"type": "location",
"location": {
"coordinates": {
"latitude": 52.37164323041201,
"longitude": 4.884335169232767
},
"location": {
"label": "MessageBird Amsterdam office"
}
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.messagebird.com",
"text": "Visit MessageBird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 2",
"description": "Second card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 3",
"description": "Third card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 2",
"description": "Second card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{ "projectId":"ce6a2fd6-b2fa-4f5a-a2cd-f3bd15883318",
"version":"latest",
"locale":"en",
"parameters":[
{
"type":"string",
"key":"name",
"value":"Robert"
}
]
}
{ "projectId":"2bbf6fe2-7297-454d-9e8c-1419e21be803",
"version":"latest",
"locale":"en",
"parameters":[
{
"type":"string",
"key":"imageURL",
"value":"https://pbs.twimg.com/profile_images/1546538670936801280/ZBIxKfMq_400x400.jpg"
},
{
"type":"string",
"key":"name",
"value":"Robert"
}
]
}
/ /