Sign inGet started

Sending messages

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
POST
/workspaces/{workspaceId}/channels/{channelId}/messages
Send a message to a channel
请求载荷
sender
object
显示子参数
sender.connector
object
必填
The sender of the message. For email messages, the sender is used to override the default sender username.
显示子参数
sender.connector.identifierValue
string
必填
The identifier value of the sender.
sender.connector.annotations
object
Annotations are used to add additional information to a message. For email messages, it can be used to specify a custom sender name.
显示子参数
sender.connector.annotations.name
string
receiver
object
必填
显示子参数
receiver.contacts
array of object
显示子参数
receiver.contacts.id
string
The ID of the receiver. This is a reference to a contact.
receiver.contacts.identifierKey
string
The identifier key for finding the contact. For WhatsApp channels with BSUID support, use whatsappbsuid to send to a contact by their Business-Scoped User ID without needing to know the channel's portfolio ID.
receiver.contacts.identifierValue
string
The identifier value for finding the contact.
receiver.contacts.type
string
The type of the receiver.
Possible values: cc, bcc, to
receiver.contacts.identifiers
array of object
显示子参数
receiver.contacts.identifiers.identifierKey
string
必填
The identifier key for finding the contact.
receiver.contacts.identifiers.identifierValue
string
必填
The identifier value for finding the contact.
receiver.contacts.platformAddress
string
The value that is used to send the message to the platform.
receiver.contacts.platformAddressSelector
string
An expression that defines how we resolve the platform address (e.g. phone number or email address) from a contact. This is an optional override for the default resolution logic (i.e. sending to the first identifier key-value pair for the relevant platform).
reference
string
A reference to the message. This can be used to identify the message in the channel.
template
object
必填
显示子参数
template.name
string
The platform name of the template.
template.projectId
string
the ID of the project from the project from Studio
template.version
string
The version of the template.
template.locale
string
template.attachments
array of object
显示子参数
template.attachments.mediaUrl
string
必填
The URL of the attachment.
template.attachments.filename
string
必填
The filename of the attachment.
template.attachments.inline
boolean
template.shortLinks
object
SMS link shortening options.
显示子参数
template.shortLinks.enabled
boolean
Enables link shortening for SMS messages.
template.shortLinks.domain
string
The domain to use when shortening links. When set to default, uses the default link shortening domain for the workspace.
template.variables
object
Deprecated: Use parameters instead (string parameter for variables). This property is maintained for backward compatibility but will be removed in a future version.
显示子参数
template.variables.default
string
template.utmParameters
array of object
The list of UTM parameters.
显示子参数
template.utmParameters.key
string
必填
The name of the parameter in the query string.
template.utmParameters.value
string
必填
The static value of the parameter. Mutually exclusive with Reference.
template.parameters
array of object
显示子参数
template.parameters.type
string
必填
Possible values: string
template.parameters.key
string
必填
template.parameters.value
string
template.settings
object
显示子参数
template.settings.disallowMmLite
boolean
This is specific for WhatsApp marketing templates and requires MM Lite to be disabled for the WABAID.
meta
object
显示子参数
meta.extraInformation
object
Free-form metadata. The useCase key (marketing, otp, transactional, or conversation) classifies the message and affects handling such as routing, frequency capping, email deliverability, and the messaging type/tag used on Meta channels (Messenger, Instagram).
meta.referral
object
显示子参数
meta.referral.source
string
meta.referral.title
string
meta.referral.text
string
meta.referral.group
string
meta.referral.metadata
object
显示子参数
meta.referral.metadata.source_id
string
meta.referral.metadata.source_url
string
meta.referral.metadata.media_url
string
meta.referral.metadata.tracking_id
string
meta.order
object
The order object contains information about the purchase order.
显示子参数
meta.order.products
array of object
显示子参数
meta.order.products.externalCatalogId
string
The platform-specific catalog ID of the product.
meta.order.products.externalProductId
string
The platform-specific product ID.
meta.order.products.quantity
integer
The number of items purchased.
meta.order.products.price
object
The price of the product.
显示子参数
meta.order.products.price.amount
integer
meta.order.products.price.exponent
integer
meta.order.products.price.currencyCode
string
meta.referredProduct
object
Referred product in an incoming message.
显示子参数
meta.referredProduct.externalCatalogId
string
The platform-specific catalog ID of the product.
meta.referredProduct.externalProductId
string
The platform-specific product ID.
meta.email
object
显示子参数
meta.email.subject
string
meta.email.headers
object
meta.email.from
object
显示子参数
meta.email.from.username
string
meta.email.from.displayName
string
meta.sms
object
显示子参数
meta.sms.smartEncoding
boolean
When enabled, attempts to transliterate Unicode characters to GSM-7 equivalents. If the resulting text is fully GSM-7 compatible, fewer message segments may be required. The original message body is preserved; transliteration is only applied when sending.
meta.pushNotifications
object
显示子参数
meta.pushNotifications.gatewayTypeOverride
string
Possible values: apns, firebase, web
meta.navigatorId
string
meta.navigatorMessageId
string
meta.flow
object
显示子参数
meta.flow.id
string
meta.flow.name
string
meta.flow.stepId
string
meta.flow.runId
string
meta.journey
object
显示子参数
meta.journey.id
string
meta.journey.name
string
meta.journey.stepId
string
meta.journey.runId
string
meta.campaign
object
显示子参数
meta.campaign.id
string
meta.campaign.name
string
replyTo
object
显示子参数
replyTo.id
string
必填
The ID of the message that is being replied to.
replyTo.order
integer
The order of the message in the conversation.
replyTo.type
string
必填
Possible values: message, click, referrals
notification
object
显示子参数
notification.url
string
A custom webhook url to send events to. Note: you should have a created webhook subscription. Refer to the Notifications API to learn how to create a webhook subscription.
capFrequency
boolean
If set to true, the frequency capping settings of the platform will be used to either allow or reject the message to a contact. Can only be set to true if the message is sent to a contact and .meta.extraInformation.useCase is marketing.
enableLinkTracking
boolean
If set to true, UTM parameters will be appended to the links in the message. For SMS channels, the shortLinks property must also be included in the request to enable link tracking.
ignoreQuietHours
boolean
If set to true, quiet hours settings will be ignored and the message will be sent as soon as possible.
ignoreGlobalHoldout
boolean
Do not check if the recipient is part of global holdout. To be used to send transactional messages.
tags
array of string
Tags to associate with the message. Tags are converted to lower case and tags that do not exist are automatically created. You can view your created tags in the UI. You can specify up to 10 tags per message.
shortLinks
object
SMS link shortening options. Must be included in the request for SMS channels when enableLinkTracking is set to true. When using templates, please refer to the template level shortLinks instead.
显示子参数
shortLinks.domain
string
必填
The domain to use when shortening links. When set to default, uses the default link shortening domain for the workspace.
scheduledFor
string
Scheduled time to send message at. Must be formated as RFC3339 timestamp. When set, the message status will be scheduled until it's sent. Messages scheduled for a time in the past or within 10 minutes of the request may be sent immediately. Messages scheduled farther than 35 days will be rejected.
validity
integer
Validity determines for how many seconds a message is valid. If none is provided, the channel message type will be used to determine it. A promotional, conversational or transactional channel message is valid for 36 hours (129600 seconds). A message sent from a 2FA channel is valid for 10 minutes (600 seconds).
响应载荷
body
object
显示子属性
body.text
object
必填
显示子属性
body.text.actions
array of object
显示子属性
body.text.actions.link
object
必填
显示子属性
body.text.actions.link.metadata
object
显示子属性
body.text.actions.link.metadata.description
object
显示子属性
body.text.actions.link.metadata.description.label
string
必填
body.text.actions.link.text
string
必填
body.text.actions.link.url
string
必填
body.text.actions.type
string
必填
Possible values: link
body.text.attachments
array of object
显示子属性
body.text.attachments.content
string
body.text.attachments.contentId
string
body.text.attachments.contentType
string
body.text.attachments.filename
string
必填
body.text.attachments.inline
boolean
body.text.attachments.mediaUrl
string
必填
body.text.metadata
object
显示子属性
body.text.metadata.apple
object
显示子属性
body.text.metadata.apple.appClipPreview
boolean
body.text.metadata.apple.appClipRegion
string
body.text.metadata.apple.summaryText
string
body.text.metadata.headers
object
body.text.metadata.line
object
显示子属性
body.text.metadata.line.emoji
object
显示子属性
body.text.metadata.line.emoji.items
array of object
显示子属性
body.text.metadata.line.emoji.items.emojiId
string
必填
body.text.metadata.line.emoji.items.index
integer
必填
body.text.metadata.line.emoji.items.length
integer
body.text.metadata.line.emoji.items.productId
string
必填
body.text.metadata.paymentDetails
object
显示子属性
body.text.metadata.paymentDetails.amount
string
必填
body.text.metadata.paymentDetails.currency
string
必填
body.text.metadata.paymentDetails.sessionIdentifier
string
body.text.metadata.paymentDetails.state
string
必填
body.text.metadata.subject
string
body.text.metadata.telegram
object
显示子属性
body.text.metadata.telegram.parseMode
string
body.text.metadata.whatsapp
object
显示子属性
body.text.metadata.whatsapp.callPermissionExpiration
string
body.text.metadata.whatsapp.callPermissionResponse
string
Possible values: accept, reject
body.text.metadata.whatsapp.previewUrl
boolean
必填
body.text.metadata.whatsapp.sharedContacts
array of object
显示子属性
body.text.metadata.whatsapp.sharedContacts.origin
string
必填
body.text.metadata.whatsapp.sharedContacts.phones
array of object
显示子属性
body.text.metadata.whatsapp.sharedContacts.phones.phone
string
必填
body.text.metadata.whatsapp.sharedContacts.phones.type
string
必填
body.text.metadata.whatsapp.sharedContacts.phones.waId
string
必填
body.text.metadata.whatsapp.sharedContacts.vcard
string
body.text.text
string
必填
body.type
string
必填
Possible values: text
bodyId
string
bodyStorage
object
显示子属性
bodyStorage.type
string
必填
Possible values: s3
bodyStorage.s3
object
必填
显示子属性
bodyStorage.s3.bucketArn
string
必填
bodyStorage.s3.encryptionKey
string
必填
bodyStorage.s3.key
string
必填
channelId
string
必填
chargeableUnits
integer
context
object
显示子属性
context.id
string
context.tagIds
array of string
context.type
string
createdAt
string
必填
details
string
This field is used to store additional information related to the message status.
direction
string
Possible values: incoming, outgoing
failure
object
显示子属性
failure.code
integer
omni channel interpretation of the failure to categorise the nature of message error
failure.description
string
human readable description of the error
failure.source
object
显示子属性
failure.source.code
string
numerical, text or alphanumeric code that indicates the error or issue while delivering the message in the last step
failure.source.name
string
Possible values: pre-processing, accounting, contact, touchpoint, sms-messagebird, sms-twilio, email-messagebird, whatsapp, facebook, instagram, line, telegram, apple-business-chat, viber, chat, google-business-messages, voice, smtp-messagebird, rcs-google, service
id
string
必填
ignorePersistedEventhooks
boolean
lastStatusAt
string
必填
meta
object
显示子属性
meta.campaign
object
显示子属性
meta.campaign.id
string
meta.campaign.name
string
meta.campaignId
string
meta.chargeOnceDelivered
boolean
meta.email
object
显示子属性
meta.email.from
object
显示子属性
meta.email.from.displayName
string
meta.email.from.username
string
meta.email.headers
object
meta.email.subject
string
meta.extraInformation
object
meta.flow
object
显示子属性
meta.flow.id
string
meta.flow.name
string
meta.flow.runId
string
meta.flow.scheduleExecutionId
string
meta.flow.stepId
string
meta.formResponse
object
显示子属性
meta.formResponse.id
string
必填
meta.formResponse.jsonResponse
string
必填
meta.formResponse.requestIdentifier
string
必填
meta.formResponse.selections
array of object
显示子属性
meta.formResponse.selections.items
array of object
显示子属性
meta.formResponse.selections.items.identifier
string
必填
meta.formResponse.selections.items.title
string
必填
meta.formResponse.selections.items.type
string
必填
meta.formResponse.selections.items.value
string
必填
meta.formResponse.selections.pageIdentifier
string
必填
meta.formResponse.selections.subtitle
string
必填
meta.formResponse.selections.title
string
必填
meta.formResponse.sessionIdentifier
string
必填
meta.formResponse.template
string
必填
meta.formResponse.version
string
必填
meta.ignoreGlobalHoldout
boolean
meta.ignoreQuietHours
boolean
meta.journey
object
显示子属性
meta.journey.id
string
meta.journey.name
string
meta.journey.runId
string
meta.journey.scheduleExecutionId
string
meta.journey.stepId
string
meta.longToShortLinks
object
meta.metaThreadId
string
meta.navigatorId
string
meta.navigatorMessageId
string
meta.order
object
The order object contains information about the purchase order associated with the message.
显示子属性
meta.order.products
array of object
显示子属性
meta.order.products.externalCatalogId
string
The platform-specific catalog ID of the product.
meta.order.products.externalProductId
string
必填
The platform-specific product ID.
meta.order.products.price
object
必填
显示子属性
meta.order.products.price.amount
integer
必填
meta.order.products.price.currencyCode
string
必填
meta.order.products.price.exponent
integer
必填
meta.order.products.quantity
integer
必填
The number of items purchased.
meta.pushNotifications
object
显示子属性
meta.pushNotifications.gatewayTypeOverride
string
Possible values: firebase, apns, web
meta.referral
object
显示子属性
meta.referral.group
string
meta.referral.metadata
object
显示子属性
meta.referral.metadata.caption
string
meta.referral.metadata.mediaType
string
meta.referral.metadata.mediaUrl
string
meta.referral.metadata.sourceId
string
必填
meta.referral.metadata.sourceUrl
string
meta.referral.metadata.timestamp
string
meta.referral.metadata.trackingId
string
meta.referral.metadata.username
string
meta.referral.source
string
必填
meta.referral.text
string
meta.referral.title
string
meta.referredProduct
object
Referred product in an incoming message (e.g. a product shared in a WhatsApp catalog message).
显示子属性
meta.referredProduct.externalCatalogId
string
The platform-specific catalog ID of the product.
meta.referredProduct.externalProductId
string
必填
The platform-specific product ID.
meta.renderedContentBlocks
array of string
meta.shortToLongLinks
object
meta.skipThisMessage
string
Possible values: campaignHoldout, globalHoldout, journeyHoldout
meta.sms
object
显示子属性
meta.sms.gatewayId
integer
meta.sms.registeredDelivery
string
Possible values: final, intermediate, all, noDlr
meta.sms.smartEncoding
boolean
When enabled, attempts to transliterate Unicode characters to GSM-7 equivalents. If the resulting text is fully GSM-7 compatible, fewer message segments may be required. The original message body is preserved; transliteration is only applied when sending.
meta.sms.smpp
object
显示子属性
meta.sms.smpp.segments
array of object
显示子属性
meta.sms.smpp.segments.id
string
必填
meta.sms.smpp.segments.registeredDelivery
string
必填
Possible values: final, intermediate, all, noDlr
meta.sms.smpp.userId
string
必填
meta.sms.validity
string
meta.useFallback
boolean
parts
array of object
显示子属性
parts.id
string
parts.order
integer
parts.platformReferenceId
string
parts.platformStatusAt
string
parts.rawBody
string
parts.reason
string
parts.status
string
Possible values: accepted, processing, sent, sending_failed, delivered, delivery_failed, deleted, scheduled, skipped, rejected
parts.statusAt
string
platformId
string
platformReferenceId
string
previousMessages
array of object
显示子属性
previousMessages.id
string
必填
previousMessages.useCaseType
string
必填
Possible values: unspecified, marketing, otp, transactional, conversation, test
reason
string
receiver
object
必填
显示子属性
receiver.connector
object
显示子属性
receiver.connector.annotations
object
Annotations add extra information to a sender or receiver. For email messages, the name annotation overrides the display name.
显示子属性
receiver.connector.annotations.name
string
receiver.connector.id
string
必填
receiver.connector.identifierValue
string
The identifier value of the sender or receiver connector (e.g. email address or phone number).
receiver.connector.types
array of string
receiver.contacts
array of object
显示子属性
receiver.contacts.contactAnnotation
object
Annotations add extra information to a sender or receiver. For email messages, the name annotation overrides the display name.
显示子属性
receiver.contacts.contactAnnotation.name
string
receiver.contacts.countryCode
string
receiver.contacts.id
string
The ID of the contact.
receiver.contacts.identifierKey
string
The identifier key for finding the contact (e.g. emailaddress, phonenumber). For WhatsApp channels with BSUID support, use whatsappbsuid to send to a contact by their Business-Scoped User ID.
receiver.contacts.identifierValue
string
The identifier value for finding the contact.
receiver.contacts.identifiers
array of object
Additional identifiers to augment the contact during resolution.
显示子属性
receiver.contacts.identifiers.identifierKey
string
必填
The identifier key for finding the contact (e.g. emailaddress, phonenumber).
receiver.contacts.identifiers.identifierValue
string
必填
The identifier value for finding the contact.
receiver.contacts.platformAddress
string
The resolved platform address used to deliver the message (e.g. phone number or email address).
receiver.contacts.platformAddressSelector
string
An expression that defines how we resolve the platform address from a contact. Optional override for the default resolution logic.
receiver.contacts.receiverExpression
string
receiver.contacts.receiverValue
string
receiver.contacts.type
string
The type of the receiver (e.g. to, cc, bcc for email).
receiver.device
object
显示子属性
receiver.device.gateway
string
必填
Possible values: firebase, apns, web
receiver.device.id
string
必填
receiver.device.identifierValue
string
必填
receiver.inbox
object
显示子属性
receiver.inbox.emailRecipientType
string
receiver.inbox.id
string
必填
receiver.inbox.identifierKey
string
必填
receiver.inbox.identifierValue
string
必填
receiver.inbox.type
string
必填
Possible values: user, group
receiver.userContacts
array of object
显示子属性
receiver.userContacts.id
string
必填
receiver.userContacts.identifierKey
string
必填
receiver.userContacts.identifierValue
string
必填
receiver.userContacts.type
string
reference
string
A reference to the message. This can be used to identify the message in the channel.
replyTo
object
显示子属性
replyTo.id
string
The ID of the message that is being replied to.
replyTo.order
integer
The order of the message part in the conversation.
replyTo.platformReference
string
replyTo.type
string
Possible values: message, click
schedule
object
显示子属性
schedule.reason
string
必填
schedule.scheduledAt
string
必填
scheduledFor
string
Scheduled message send time (RFC3339). Messages scheduled within 10 minutes may be sent immediately; messages scheduled more than 35 days out will be rejected.
sendAt
string
sender
object
必填
显示子属性
sender.connector
object
显示子属性
sender.connector.annotations
object
Annotations add extra information to a sender or receiver. For email messages, the name annotation overrides the display name.
显示子属性
sender.connector.annotations.name
string
sender.connector.id
string
必填
sender.connector.identifierValue
string
The identifier value of the sender or receiver connector (e.g. email address or phone number).
sender.connector.types
array of string
sender.contact
object
显示子属性
sender.contact.contactAnnotation
object
Annotations add extra information to a sender or receiver. For email messages, the name annotation overrides the display name.
显示子属性
sender.contact.contactAnnotation.name
string
sender.contact.countryCode
string
sender.contact.id
string
The ID of the contact.
sender.contact.identifierKey
string
The identifier key for finding the contact (e.g. emailaddress, phonenumber). For WhatsApp channels with BSUID support, use whatsappbsuid to send to a contact by their Business-Scoped User ID.
sender.contact.identifierValue
string
The identifier value for finding the contact.
sender.contact.identifiers
array of object
Additional identifiers to augment the contact during resolution.
显示子属性
sender.contact.identifiers.identifierKey
string
必填
The identifier key for finding the contact (e.g. emailaddress, phonenumber).
sender.contact.identifiers.identifierValue
string
必填
The identifier value for finding the contact.
sender.contact.platformAddress
string
The resolved platform address used to deliver the message (e.g. phone number or email address).
sender.contact.platformAddressSelector
string
An expression that defines how we resolve the platform address from a contact. Optional override for the default resolution logic.
sender.contact.receiverExpression
string
sender.contact.receiverValue
string
sender.contact.type
string
The type of the receiver (e.g. to, cc, bcc for email).
sender.inbox
object
显示子属性
sender.inbox.emailRecipientType
string
sender.inbox.id
string
必填
sender.inbox.identifierKey
string
必填
sender.inbox.identifierValue
string
必填
sender.inbox.type
string
必填
Possible values: user, group
sender.userContact
object
显示子属性
sender.userContact.id
string
必填
sender.userContact.identifierKey
string
必填
sender.userContact.identifierValue
string
必填
sender.userContact.type
string
shortLinks
object
显示子属性
shortLinks.domain
string
必填
The domain to use when shortening links. When set to default, uses the default link shortening domain for the workspace.
status
string
必填
Possible values: accepted, processing, sent, sending_failed, delivered, delivery_failed, deleted, scheduled, skipped, rejected
tagIds
array of string
tags
array of string
Tags to associate with the message. Tags are converted to lower case and automatically created if they don't exist. Up to 10 tags per message.
template
object
显示子属性
template.attachments
array of object
显示子属性
template.attachments.content
string
template.attachments.contentType
string
template.attachments.filename
string
必填
template.attachments.inline
boolean
必填
template.attachments.mediaUrl
string
必填
template.deployment
object
template.locale
string
必填
template.name
string
The platform name of the template.
template.parameters
array of object
显示子属性
template.parameters.key
string
必填
template.parameters.sourceUrl
object
显示子属性
template.parameters.sourceUrl.fullyReplaced
boolean
必填
template.parameters.sourceUrl.value
string
必填
template.parameters.type
string
必填
Possible values: string, timeslotList, productSections, productList, number, boolean, sectionList, shippingMethodList, lineItemList, whatsappProductSections, whatsappProductItems, shortLink, object, carouselCards, appleFormPageItems
template.parameters.value
object or array or string or number or boolean
必填
template.projectId
string
必填
The ID of the project from Studio.
template.settings
object
显示子属性
template.settings.disallowMmLite
boolean
template.shortLinks
object
显示子属性
template.shortLinks.domain
string
必填
The domain to use when shortening links. When set to default, uses the default link shortening domain for the workspace.
template.shortLinks.enabled
boolean
必填
Enables link shortening for SMS messages.
template.templateBody
object
显示子属性
template.templateBody.text
object
必填
显示子属性
template.templateBody.text.actions
array of object
显示子属性
template.templateBody.text.actions.link
object
必填
显示子属性
template.templateBody.text.actions.link.metadata
object
显示子属性
template.templateBody.text.actions.link.metadata.description
object
显示子属性
template.templateBody.text.actions.link.metadata.description.label
string
必填
template.templateBody.text.actions.link.text
string
必填
template.templateBody.text.actions.link.url
string
必填
template.templateBody.text.actions.type
string
必填
Possible values: link
template.templateBody.text.attachments
array of object
显示子属性
template.templateBody.text.attachments.content
string
template.templateBody.text.attachments.contentId
string
template.templateBody.text.attachments.contentType
string
template.templateBody.text.attachments.filename
string
必填
template.templateBody.text.attachments.inline
boolean
template.templateBody.text.attachments.mediaUrl
string
必填
template.templateBody.text.metadata
object
显示子属性
template.templateBody.text.metadata.apple
object
显示子属性
template.templateBody.text.metadata.apple.appClipPreview
boolean
template.templateBody.text.metadata.apple.appClipRegion
string
template.templateBody.text.metadata.apple.summaryText
string
template.templateBody.text.metadata.headers
object
template.templateBody.text.metadata.line
object
显示子属性
template.templateBody.text.metadata.line.emoji
object
显示子属性
template.templateBody.text.metadata.line.emoji.items
array of object
显示子属性
template.templateBody.text.metadata.line.emoji.items.emojiId
string
必填
template.templateBody.text.metadata.line.emoji.items.index
integer
必填
template.templateBody.text.metadata.line.emoji.items.length
integer
template.templateBody.text.metadata.line.emoji.items.productId
string
必填
template.templateBody.text.metadata.paymentDetails
object
显示子属性
template.templateBody.text.metadata.paymentDetails.amount
string
必填
template.templateBody.text.metadata.paymentDetails.currency
string
必填
template.templateBody.text.metadata.paymentDetails.sessionIdentifier
string
template.templateBody.text.metadata.paymentDetails.state
string
必填
template.templateBody.text.metadata.subject
string
template.templateBody.text.metadata.telegram
object
显示子属性
template.templateBody.text.metadata.telegram.parseMode
string
template.templateBody.text.metadata.whatsapp
object
显示子属性
template.templateBody.text.metadata.whatsapp.callPermissionExpiration
string
template.templateBody.text.metadata.whatsapp.callPermissionResponse
string
Possible values: accept, reject
template.templateBody.text.metadata.whatsapp.previewUrl
boolean
必填
template.templateBody.text.metadata.whatsapp.sharedContacts
array of object
显示子属性
template.templateBody.text.metadata.whatsapp.sharedContacts.origin
string
必填
template.templateBody.text.metadata.whatsapp.sharedContacts.phones
array of object
显示子属性
template.templateBody.text.metadata.whatsapp.sharedContacts.phones.phone
string
必填
template.templateBody.text.metadata.whatsapp.sharedContacts.phones.type
string
必填
template.templateBody.text.metadata.whatsapp.sharedContacts.phones.waId
string
必填
template.templateBody.text.metadata.whatsapp.sharedContacts.vcard
string
template.templateBody.text.text
string
必填
template.templateBody.type
string
必填
Possible values: text
template.utmParameters
array of object
显示子属性
template.utmParameters.key
string
必填
template.utmParameters.value
string
必填
template.variables
object
template.version
string
必填
The version of the template.
updatedAt
string
必填
代码示例
curl -X POST 'https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/messages' \
  -H 'Authorization: AccessKey YOUR_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:
Google RCS API typeChannels API
basic messagetext
imageimage
videofile
locationlocation
rich messages + suggestionstext + action / image + actions / list
rich cardcarousel
carouselcarousel
Supported file types
Content TypeMIME typeChannels API
Imageimage/jpeg, image/jpg, image/gif, image/pngimage
Videovideo/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webmfile
Fileapplication/pdffile

Outbound messages

Text

Text message

{
"type": "text",
"text": {
"text": "Single text message"
}
}

Text message with reply buttons

{
"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"
}
}
]
}
}

Text message with postback actions

{
"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"
}
}
]
}
}

Text message with reply and postback actions

{
"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"
}
}
]
}
}

Image

Single image message

Single image message with text

{
"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"
}
}

Multiple image message

Single image message with postback actions

{
"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"
}
]
}
}

Single image message with label and reply actions

{
"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"
}
}
]
}
}

Single image message with label, postback and reply actions

{
"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"
}
}
]
}
}

Multiple images message with labels and postback actions

{
"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"
}
]
}
}

Multiple images message with reply actions

{
"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"
}
]
}
}

Multiple images message with labels, postback and reply actions

{
"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"
}
]
}
}

File

Single file message

{
"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"
}
]
}
}

Multiple files message

Location

With Coordinates

{
"type": "location",
"location": {
"coordinates": {
"latitude": 52.37164323041201,
"longitude": 4.884335169232767
},
"location": {
"label": "MessageBird Amsterdam office"
}
}
}

Single card with title, description and actions

{
"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"
}
}
]
}
]
}
}

Single card with image, title, description and actions

{
"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"
}
}
]
}
]
}
}

Multiple cards with title, description and actions

{
"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"
}
}
]
}
]
}
}

Multiple cards with image title, description and actions

{
"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"
}
}
]
}
]
}
}

Template

Basic text template with variable

{ "projectId":"ce6a2fd6-b2fa-4f5a-a2cd-f3bd15883318",
"version":"latest",
"locale":"en",
"parameters":[
{
"type":"string",
"key":"name",
"value":"Robert"
}
]
}

Rich card template with button and variables

{ "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"
}
]
}