RBM temsilcileri, mesaj gönderip alarak kullanıcılarla iletişim kurar. Temsilciniz, kullanıcılara mesaj göndermek için RCS Business Messaging API'ye mesaj istekleri gönderir. Tek bir istek, metin, zengin kartlar, medya ve PDF dosyaları, önerilen yanıtlar ve önerilen işlemler içerebilir.
RBM platformu, mesaj yayınını yönetmenize yardımcı olmak için belirli durumlarda hata döndürür:
- Cihazı RCS'yi desteklemeyen veya RCS'yi etkinleştirmemiş bir kullanıcıya mesaj gönderirseniz RBM platformu 404 NOT_FOUND hatası döndürür. Bu durumda, altyapınızda tanımlanan yedek yöntemler aracılığıyla kullanıcıya ulaşmaya çalışabilirsiniz.
- Temsilcinizi henüz kullanıma sunmadığınız bir ağda veya RCS trafiğini etkinleştirmediğiniz bir ağda bir RCS kullanıcısına mesaj gönderirseniz RBM platformu 404 NOT_FOUND hatası döndürür.
- Kullanıcının cihazının desteklemediği özellikler içeren bir mesaj gönderirseniz RBM platformu 400 INVALID_ARGUMENT hatası döndürür ve mesajınızı teslim etmez.
Çok kanallı mesajlaşma stratejinizin bir parçası olarak, makul bir süre içinde teslim edilmeyen mesajları iptal edip farklı bir kanal üzerinden göndermeniz önerilir. Mesajları önceden tanımlanmış bir zamanda otomatik olarak iptal etmek için ileti geçerlilik süresi ayarlayın.
Alıcı internete bağlı değil
Alıcı çevrimdışı olsa bile RBM platformu, mesajın teslim edilmesi için mesajı kabul eder. 200 OK yanıtı alırsınız ve RBM platformu mesajı tutar ve 30 gün boyunca yeniden göndermeyi dener. RBM'den mesajı tekrar göndermesini istemenize gerek yoktur.
RBM, teslim edilemeyen mesajları gönderildikten 30 gün sonra siler.
Temsilcinizi kullanım alanına bağlı olarak, bu 30 günlük zaman aşımı süresinden önce teslim edilmeyen bir mesajı iptal etmek isteyebilirsiniz. İptal işlemi, çevrimdışı olan kullanıcıların tekrar çevrimiçi olduklarında eski bir mesaj almasını önleyebilir. Bir mesajı iptal etmenin birden çok yolu vardır:
- İptali tetiklemek için iptal isteği gönderin.
- İletiyi uygun zamanda otomatik olarak iptal etmek için ileti için geçerlilik bitiş tarihi belirleyin.
İleti için geçerlilik bitiş tarihi belirleme
Temsilcinizi mesajı zamana duyarlı mı? Örneğin, tek kullanımlık şifreler yalnızca kısa bir süre için geçerlidir. Sınırlı süreli tekliflerin süresi dolar. Randevu hatırlatıcıları, randevu tarihinden sonra geçerliliğini yitirir. Zamanında ve alakalı mesajlar göndermek için ileti için geçerlilik bitiş tarihi ayarlayın. Bu, çevrimdışı olan kullanıcıların tekrar çevrimiçi olduklarında eski içerikler almasını önleyebilir. Son kullanma tarihi, kullanıcıların ihtiyaç duydukları bilgileri zamanında almaları için yedek mesajlaşma stratejinizi tetiklemek için de iyi bir işarettir.
Mesajın geçerlilik süresini ayarlamak için müşteri temsilcisi mesajında aşağıdaki alanlardan birini belirtin:
expireTime
: İletinin geçerlilik süresinin sona erdiği tam saat (UTC).ttl
(geçerlilik süresi): İletinin geçerlilik süresinin sona ermesine kalan süre.
Biçimlendirme ve değer seçenekleri için AgentMessage
bölümüne bakın.
Mesajın süresi dolduktan sonra RBM platformu iletiyi teslim etmeye çalışmayı durdurur ve ileti otomatik olarak iptal edilir. Ancak bu işlem nadiren başarısız olabilir. Örneğin, API, RBM platformu mesajı gönderme sürecindeyken iptal işlemini tetikleyebilir. RBM, süresi dolmuş mesajın başarıyla iptal edilip edilmediğini onaylamak için webhook'ınıza bir bildirim etkinliği gönderir.
ttl
ve expireTime
için maksimum değer, mesaj gönderildikten sonraki 15 gündür.
Mesaj trafiği türünü ayarlama
RBM API, iletileri kategorilere ayırmak için bir messageTrafficType
alanı içerir.
Temsilci kullanım alanları, temsilci davranışını ve geçerli iş kurallarını tanımlamaya devam etse de messageTrafficType
, mesaj içeriğinin daha ayrıntılı bir şekilde sınıflandırılmasına olanak tanır. Sonuç olarak, tek bir temsilcinin birden fazla kullanım alanını yönetmesi mümkün olacaktır. Bu değişiklik, mevcut müşteri temsilcisi kullanım alanları veya iş kuralları üzerinde herhangi bir etkisi olmayacaktır.
Bu alan şu anda isteğe bağlıdır ancak zorunlu hale geldiğinde hata almamak için şimdi ayarlamanızı öneririz.
İleti trafiği türünü ayarlamak için her iletiye içeriğine göre uygun messageTrafficType
atayın. RBM aşağıdaki trafik türlerini destekler.
Trafik türü | Mesaj içeriği | Temsilci kullanım alanı |
---|---|---|
AUTHENTICATION |
Kimlik doğrulama iletileri için. | OTP |
TRANSACTION |
Kullanıcının mevcut hizmetleri veya ürünleriyle ilgili mesajlar için. Örneğin: onaylar, ödeme makbuzları veya rezervasyon ayrıntıları. | İşlemsel veya çoklu kullanım |
PROMOTION |
Teklif, indirim, duyuru veya diğer tanıtım amaçlı içerikler gibi tanıtım amaçlı mesajlar için | Tanıtım amaçlı veya çoklu kullanım |
SERVICEREQUEST |
Kullanıcının açıkça istediği hizmetlerle ilgili mesajlar için. | Tek kullanımlık şifre, işleme yönelik, tanıtım amaçlı veya çok kullanımlı |
ACKNOWLEDGEMENT |
Kullanıcının işlemini (özellikle de abonelikten çıkma isteğini) onaylamak için kullanılan mesajlar. Bu, kullanıcının isteğinizin alındığını ve işleme alındığını onaylar. | Tek kullanımlık şifre, işleme yönelik, tanıtım amaçlı veya çok kullanımlı |
Trafik türü ayarlanmazsa sistem, temsilcinin kullanım alanı için varsayılan türü atar.
Temsilci kullanım alanı | Varsayılan trafik türü |
---|---|
OTP | AUTHENTICATION |
İşlemsel | TRANSACTION |
Tanıtım amaçlı | PROMOTION |
Çoklu kullanım | MESSAGE_TRAFFIC_TYPE_UNSPECIFIED |
Çok amaçlı temsilcilerin varsayılan trafik türü yoktur. Trafik türünü, her ileti için içeriğine göre açıkça ayarlamanız gerekir. MESSAGE_TRAFFIC_TYPE_UNSPECIFIED
değerini değiştirmezseniz hata oluşur.
Mesaj boyutu sınırları
Dize haline getirilmiş AgentMessage öğesinin tamamının maksimum boyutu 250 KB'tır. İletinin metin kısmının kendi 3.072 karakter sınırı vardır.
RBM üzerinden gönderilebilecek maksimum dosya boyutu 100 MB'tır. Daha fazla bilgi için Medya ve PDF dosyaları başlıklı makaleyi inceleyin.
Metin
En basit mesajlar metinden oluşur. Görsel, karmaşık etkileşim veya yanıt gerektirmeden bilgi aktarmak için kısa mesajlar en uygun seçenektir.
Örnek
Aşağıdaki kod, düz metin mesajı gönderir. Biçimlendirme ve değer seçenekleri için phones.agentMessages.create
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!" }, "messageTrafficType": "PROMOTION" }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); let params = { messageText: 'Hello, world!', msisdn: '+12223334444', }; // Send a simple message to the device rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.rbm.RbmApiHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); // Send simple text message to user rbmApiHelper.sendTextMessage( "Hello, world!", "+12223334444" ); } catch(Exception e) { e.printStackTrace(); }
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 simple RBM text message message_text = messages.TextMessage('Hello, world!') # Send text message to the device messages.MessageCluster().append_message(message_text).send_to_msisdn('+12223334444')
C#
using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", );
Temel mesaj içeriği - SMS'nin dönüştürülmesi
Operatörler, SMS mesajlarının RBM'ye taşınmasını desteklemek için faturalandırma modelleri kullanıma sundu. 160 UTF-8 karakteri içeren bir RBM mesajına Temel Mesaj denir.
Temel mesaj içeriği ve bağlantı önizlemeleri
RCS istemcileri bağlantı önizlemelerini uygulayabilir. Yalnızca metin içeren bir RBM mesajı, openGraph etiketleri içeren bir web sitesinin URL'sini içeriyorsa daha zengin içerik izlenimi veren bir önizleme resmi gösterilebilir.
RCS istemcisinin, kullanıcının bağlantı önizlemelerini devre dışı bırakmasına izin verebileceğini unutmayın.
Kullanıcı doğrulaması için tek seferlik şifreler
SMS Retriever API ile otomatik kullanıcı doğrulaması için tek kullanımlık şifreler (OTP'ler) göndermek üzere RBM'yi kullanabilirsiniz. RBM üzerinden gelen OTP'leri okumak için özel bir API yoktur.
Android için işleyiş şekli
SMS Retriever API'ye kayıtlı Android uygulamaları için API, doğru biçimlendirilmiş bir RBM mesajı dinler. Bu mesaj hem OTP'yi hem de uygulamanızı tanımlayan benzersiz bir karma oluşturma işlemini içermelidir.
Doğru biçime sahip bir RBM mesajı alındığında SMS Retriever API, mesajı SMS OTP'si gibi işler. Karma oluşturma işlemi uygulamanızla eşleştirildikten sonra OTP ayıklanır ve otomatik kullanıcı doğrulaması için uygulamanıza yönlendirilir.
- Kullanıcı doğrulaması için örnek RBM kısa mesajı:
Your code is <OTP> <app hash>.
- Örnek:
Your code is 123456 M8tue43FGT.
SMS Retriever ve ilgili API'ler hakkında daha fazla bilgi edinmek için SMS Retriever belgelerine bakın. SMS Retriever API'ye kayıtlı uygulamalarda otomatik kullanıcı doğrulaması hakkında ayrıntılı bilgi için bu akış şemasına bakın.
iOS için işleyiş şekli
iOS için sistemin yerleşik OTP işleme özelliği, SMS OTP'ler gibi otomatik doldurma için RBM OTP'leri otomatik olarak algılar ve önerir. iOS uygulamasının OTP'yi okuması için özel bir API entegrasyonu gerekmez.
Medya ve PDF dosyaları
Resim, video, ses veya PDF dosyası içeren bir mesaj gönderdiğinizde temsilciniz, içeriğin herkese açık bir URL'sini sağlamalıdır ya da dosyayı doğrudan yüklemelidir. Medya dosyaları için, kullanıcıların içeriği tıklamadan önce önizlemesine olanak tanıyan bir küçük resim de belirtebilirsiniz. Ses dosyaları için yer tutucu olarak varsayılan ses widget'ı kullanılır.
RBM platformu dosyaları 60 gün boyunca önbelleğe alır ve API, temsilcinizin kullanıcılara göndereceği mesajlara dahil edebileceği bir dosya kimliği döndürür. RBM, 60 gün sonra dosyaları önbellekten kaldırır.
Dosyaları URL'ye göre belirtirken contentMessage.forceRefresh
değerini false
olarak ayarlamak en iyi uygulamadır. contentMessage.forceRefresh
değerini true
olarak ayarlamak, URL içeriği önbelleğe alınmış olsa bile RBM'nin belirtilen URL'den yeni içerik getirmesini zorunlu kılar. Bu da kullanıcılar için ileti yayınlama sürelerini artırır.
Dosya boyutu önerileri ve sınırları için en iyi uygulamalara bakın.
Dosya URL'si örneği
Aşağıdaki kod bir resim gönderir. Biçimlendirme ve değer seçenekleri için AgentContentMessage
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "contentInfo": { "fileUrl": "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif", "forceRefresh": false } } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); let params = { fileUrl: 'http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif', msisdn: '+12223334444', }; // Send an image/video to a device rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.AgentContentMessage; import com.google.api.services.rcsbusinessmessaging.v1.model.AgentMessage; import com.google.rbm.RbmApiHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); String fileUrl = "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif"; // create media only message AgentContentMessage agentContentMessage = new AgentContentMessage(); agentContentMessage.setContentInfo(new ContentInfo().setFileUrl(fileUrl)); // attach content to message AgentMessage agentMessage = new AgentMessage(); agentMessage.setContentMessage(agentContentMessage); rbmApiHelper.sendAgentMessage(agentMessage, "+12223334444"); } catch(Exception e) { e.printStackTrace(); }
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 media file attachment file_message = messages.FileMessage('http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif') messages.MessageCluster().append_message(file_message).send_to_msisdn('+12223334444')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); string fileUrl = "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif"; // Create content info with the file url ContentInfo contentInfo = new ContentInfo { FileUrl = fileUrl }; // Attach content info to a message AgentContentMessage agentContentMessage = new AgentContentMessage { ContentInfo = contentInfo, }; // Attach content to message AgentMessage agentMessage = new AgentMessage { ContentMessage = agentContentMessage }; rbmApiHelper.SendAgentMessage(agentMessage, "+12223334444");
Alternatif olarak, files.create
ile bir mesajda göndermeden önce medya yükleyebilirsiniz.
Dosya yükleme örneği
Aşağıdaki kod, bir video dosyası ve küçük resim dosyası yükler, ardından her iki dosyayı da bir mesajda gönderir. Biçimlendirme ve değer seçenekleri için files.create
ve AgentContentMessage
bölümlerine bakın.
cURL
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
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "uploadedRbmFile": { "fileName": "SERVER-SPECIFIED_VIDEO_FILE_NAME", "thumbnailName": "SERVER-SPECIFIED_THUMBNAIL_FILE_NAME" } } }'
Desteklenen medya türleri
RBM aşağıdaki medya türlerini destekler. Küçük resimler için yalnızca image/jpeg, image/jpg, image/gif ve image/png desteklenir.
Medya türü | Doküman türü | Uzantı | Zengin kartlarla çalışır |
---|---|---|---|
application/ogg | OGG ses | .ogx | Hayır |
application/pdf | Hayır | ||
audio/aac | AAC ses | .aac | Hayır |
ses/mp3 | MP3 ses biçimi | .mp3 | Hayır |
ses/mpeg | MPEG ses | .mpeg | Hayır |
ses/mpg | MPG ses | .mp3 | Hayır |
ses/mp4 | MP4 ses | .mp4 | Hayır |
ses/mp4-latm | MP4-latm ses | .mp4 | Hayır |
ses/3gpp | 3GPP ses | .3gp | Hayır |
resim/jpeg | JPEG | .jpeg, .jpg | Evet |
image/gif | GIF | .gif | Evet |
image/png | PNG | .png | Evet |
video/h263 | H263 video | .h263 | Evet |
video/m4v | M4V video | .m4v | Evet |
video/mp4 | MP4 video | .mp4 | Evet |
video/mpeg4 | MPEG-4 video | .mp4, .m4p | Evet |
video/mpeg | MPEG video | .mpeg | Evet |
video/webm | WEBM videosu | .webm | Evet |
Öneriler
Temsilciniz, önerileri (önerilen yanıtlar ve önerilen işlemler) öneri çipi listelerinde (en fazla 11 öneri) veya zengin kartlarda (en fazla dört öneri) gönderir.
Her öneri en fazla 25 karakter uzunluğunda olabilir.
Önerilen yanıtlar
Önerilen yanıtlar, temsilcinizin nasıl tepki vereceğini bildiği yanıtlar sağlayarak kullanıcılara sohbetlerde yol gösterir.
Kullanıcı önerilen bir yanıta dokunduğunda temsilciniz, yanıtın metnini ve geri gönderme verilerini içeren bir etkinlik alır. Yük en fazla 2.048 karakter uzunluğunda olabilir.
Örnek
Aşağıdaki kod, iki önerilen yanıt içeren metin gönderir. Biçimlendirme ve değer seçenekleri için SuggestedReply
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "reply": { "text": "Suggestion #1", "postbackData": "suggestion_1" } }, { "reply": { "text": "Suggestion #2", "postbackData": "suggestion_2" } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); let suggestions = [ { reply: { 'text': 'Suggestion #1', 'postbackData': 'suggestion_1', }, }, { reply: { 'text': 'Suggestion #2', 'postbackData': 'suggestion_2', }, }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with suggestion chips to the device rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.Suggestion; import com.google.rbm.RbmApiHelper; import com.google.rbm.SuggestionHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); // Create suggestions for chip list List<Suggestion> suggestions = new ArrayList<Suggestion>(); suggestions.add( new SuggestionHelper("Suggestion #1", "suggestion_1").getSuggestedReply()); suggestions.add( new SuggestionHelper("Suggestion #2", "suggestion_2").getSuggestedReply()); // Send simple text message to user rbmApiHelper.sendTextMessage( "Hello, world!", "+12223334444", suggestions ); } catch(Exception e) { e.printStackTrace(); }
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 text message to send to user text_msg = messages.TextMessage('Hello, world!') cluster = messages.MessageCluster().append_message(text_msg) # Append suggested replies for the message to send to the user cluster.append_suggestion_chip(messages.SuggestedReply('Suggestion #1', 'reply:suggestion_1')) cluster.append_suggestion_chip(messages.SuggestedReply('Suggestion #2', 'reply:suggestion_2')) # Send a simple message with suggestion chips to the device cluster.send_to_msisdn('+12223334444')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); List<Suggestion> suggestions = new List<Suggestion> { // Create suggestion chips new SuggestionHelper("Suggestion #1", "suggestion_1").SuggestedReply(), new SuggestionHelper("Suggestion #2", "suggestion_2").SuggestedReply() }; // Send simple text message with suggestions to user rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
Önerilen işlemler
Önerilen işlemler, cihazlarının yerleşik işlevlerinden yararlanarak kullanıcıları görüşmelerde yönlendirir. Temsilciniz, kullanıcılara bir numara çevirme, harita üzerinde bir konum açma, konum paylaşma, URL açma veya takvim etkinliği oluşturma gibi öneriler sunabilir.
Önerilen her işlem için isteğe bağlı olarak yedek URL (maksimum 2048 karakter) sağlayabilirsiniz. Kullanıcının cihazı önerilen işlemi desteklemiyorsa bu URL yeni bir tarayıcı penceresinde açılır.
Kullanıcı önerilen bir işleme dokunduğunda temsilciniz, işlemin geri gönderme verilerini içeren bir etkinlik alır.
Biçimlendirme ve değer seçenekleri için SuggestedAction
bölümüne bakın.
Numara çevir
Çevirme işlemi, kullanıcıyı temsilciniz tarafından belirtilen bir telefon numarasını çevirmeye yönlendirir.
Telefon numaraları yalnızca rakam (0-9
), artı işareti (+
), yıldız işareti (*
) ve sayı işareti (#
) içerebilir. E.164 uluslararası biçimi (örneğin, +14155555555
) desteklenir ancak zorunlu değildir. Yani hem +14155555555
hem de 1011
geçerli girişlerdir.
Örnek
Aşağıdaki kod, bir arama işlemi gönderir. Biçimlendirme ve değer seçenekleri için DialAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Call", "postbackData": "postback_data_1234", "fallbackUrl": "https://www.google.com/contact/", "dialAction": { "phoneNumber": "+15556667777" } } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define a dial suggested action let suggestions = [ { action: { text: 'Call', postbackData: 'postback_data_1234', dialAction: { phoneNumber: '+15556667777' } } }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with a dial suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.DialAction; 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<Suggestion> suggestions = new ArrayList<Suggestion>(); // creating a dial suggested action DialAction dialAction = new DialAction(); dialAction.setPhoneNumber("+15556667777"); // creating a suggested action based on a dial action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Call"); suggestedAction.setPostbackData("postback_data_1234"); suggestedAction.setDialAction(dialAction); // 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(); }
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 dial suggested action suggestions = [ messages.DialAction('Call', 'reply:postback_data_1234', '+15556667777') ] # 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')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Create a dial an agent suggested action DialAction dialAction = new DialAction { PhoneNumber = "+15556667777" }; // Creating a suggested action based on a dial action SuggestedAction suggestedAction = new SuggestedAction { Text = "Call", PostbackData = "postback_data_1234", DialAction = dialAction }; // Attach action to a suggestion Suggestion suggestion = new Suggestion { Action = suggestedAction }; List<Suggestion> suggestions = new List<Suggestion> { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
Bir konumu görüntüleme
Konumu görüntüle işlemi, kullanıcının varsayılan harita uygulamasında bir konumu gösterir. Konumu enlem ve boylama göre veya kullanıcının mevcut konumuna dayalı bir sorgu ile belirtebilirsiniz. Raptiye için harita uygulamasında gösterilecek özel bir etiket de ayarlayabilirsiniz.
Örnek
Aşağıdaki kod, konum görüntüleme işlemi gönderir. Biçimlendirme ve değer seçenekleri için ViewLocationAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "View map", "postbackData": "postback_data_1234", "fallbackUrl": "https://www.google.com/maps/@37.4220188,-122.0844786,15z", "viewLocationAction": { "latLong": { "latitude": "37.4220188", "longitude": "-122.0844786" }, "label": "Googleplex" } } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define a view location suggested action let suggestions = [ { action: { text: 'View map', postbackData: 'postback_data_1234', viewLocationAction: { latLong: { latitude: 37.4220188, longitude: -122.0844786 }, label: 'Googleplex' } } }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with a view location suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.ViewLocationAction; 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<Suggestion> suggestions = new ArrayList<Suggestion>(); // creating a view location suggested action ViewLocationAction viewLocationAction = new ViewLocationAction(); viewLocationAction.setQuery("Googleplex, Mountain View, CA"); // creating a suggested action based on a view location action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("View map"); suggestedAction.setPostbackData("postback_data_1234"); suggestedAction.setViewLocationAction(viewLocationAction); // 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(); }
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 view location suggested action suggestions = [ messages.ViewLocationAction('View map', 'reply:postback_data_1234', query='Googleplex, Mountain View, CA') ] # 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')
C#
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<Suggestion> suggestions = new List<Suggestion> { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
Konum paylaşın
Konum Paylaş işlemi, kullanıcının bir konumu temsilcinizle paylaşmasına olanak tanır. Kullanıcı, Haritalar uygulamasından mevcut konumunu veya manuel olarak seçilen bir konumu paylaşabilir.
Örnek
Aşağıdaki kod, konum paylaşımı işlemi gönderir. Biçimlendirme ve değer seçenekleri için ShareLocationAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Share your location", "postbackData": "postback_data_1234", "shareLocationAction": {} } } ] } }'
Node.js
// 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); });
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<Suggestion> suggestions = new ArrayList<Suggestion>(); // 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(); }
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')
C#
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<Suggestion> suggestions = new List<Suggestion> { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
URL açma
URL'yi aç işlemi, kullanıcıları temsilciniz tarafından belirtilen bir web sayfasına yönlendirmenize olanak tanır. Web sayfası varsayılan olarak kullanıcının tarayıcısında açılır. Kullanıcının web sayfası için yapılandırılmış bir varsayılan uygulaması varsa bu uygulama açılır. Bu durumda, önerilen işlem düğmesindeki simge uygulamanın simgesi olur.
URL açma işlemi, entegre web görünümlerini de destekler. URL'yi web görünümüyle açma başlıklı makaleyi inceleyin.
Örnek
Aşağıdaki kod, URL açma işlemi gönderir. Biçimlendirme ve değer seçenekleri için OpenUrlAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Open Google", "postbackData": "postback_data_1234", "openUrlAction": { "url": "https://www.google.com" } } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define an open URL suggested action let suggestions = [ { action: { text: 'Open Google', postbackData: 'postback_data_1234', openUrlAction: { url: 'https://www.google.com' } } }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with an open URL suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.OpenUrlAction; 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<Suggestion> suggestions = new ArrayList<Suggestion>(); // creating an open url suggested action OpenUrlAction openUrlAction = new OpenUrlAction(); openUrlAction.setUrl("https://www.google.com"); // creating a suggested action based on an open url action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Open Google"); suggestedAction.setPostbackData("postback_data_1234"); suggestedAction.setOpenUrlAction(openUrlAction); // 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(); }
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') ] # 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')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Create an open url action OpenUrlAction openUrlAction = new OpenUrlAction { Url = "https://www.google.com" }; // Attach the open url action to a suggested action SuggestedAction suggestedAction = new SuggestedAction { OpenUrlAction = openUrlAction, Text = "Open Google", PostbackData = "postback_data_1234" }; // Attach the action to a suggestion object Suggestion suggestion = new Suggestion { Action = suggestedAction }; List<Suggestion> suggestions = new List<Suggestion> { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
Web Görünümü ile URL açma
URL'yi web görünümüyle aç işlemi, belirtilen web sayfasını varsayılan tarayıcınızın oluşturma motoruyla mesajlaşma uygulamasında yükler. Bu sayede kullanıcı, RBM sohbetten ayrılmadan web sayfasıyla etkileşim kurabilir. Kullanıcının cihazı web görünümlerini desteklemiyorsa web sayfası bunun yerine kullanıcının tarayıcısında açılır. Web görünümlerini etkinleştirmek için OpenURLApplication
bölümüne bakın.
Web görünümlerinin üç görüntüleme modu vardır. Biçimlendirme ve değer seçenekleri için WebviewViewMode
bölümüne bakın.
- Tam: Web sayfası tam ekranı kaplar.
- Yarım: Web sayfası ekranın yarısını kaplar.
- Yüksek: Web sayfası ekranın dörtte üçünü kaplar.
Örnek
Aşağıdaki kod, webview işlemiyle bir URL açar. Biçimlendirme ve değer seçenekleri için OpenURLAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Open Google", "postbackData": "postback_data_1234", "openUrlAction": { "url": "https://www.google.com", "application": "WEBVIEW", "webviewViewMode": "FULL", "description": "Accessibility description" } } } ] } }'
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.OpenUrlAction; import com.google.api.services.rcsbusinessmessaging.v1.model.SuggestedAction; import com.google.api.services.rcsbusinessmessaging.v1.model.Suggestion; import com.google.rbm.RbmApiHelper; … try { String URL = "https://www.google.com"; // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); // Create suggestions for chip list List<Suggestion> suggestions = new ArrayList<Suggestion>(); // Create suggestion to view webpage in full mode Suggestion viewInFullMode = getUrlActionInWebview(URL, "FULL") suggestions.add(viewInFullMode); // create suggestion to view webpage in half mode Suggestion viewInHalfMode = getUrlActionInWebview(URL, "HALF") suggestions.add(viewInHalfMode); // create suggestion to view webpage in tall mode Suggestion viewInTallMode = getUrlActionInWebview(URL, "TALL") suggestions.add(viewInTallMode); // Send simple text message with the suggested action rbmApiHelper.sendTextMessage( "Hello, world!", "+12223334444", suggestions ); } catch(Exception e) { e.printStackTrace(); } /** * Creates a suggested action to open URL in webview. * * @return a suggestion object for an open URL in webview action . */ private Suggestion getUrlActionInWebview(String url, String viewMode) { // create an open url action OpenUrlAction openUrlAction = new OpenUrlAction(); openUrlAction.setUrl(url); openUrlAction.setApplication("WEBVIEW"); openUrlAction.setWebviewViewMode(viewMode); openUrlAction.setDescription("Accessibility description"); // attach the open url action to a suggested action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setOpenUrlAction(openUrlAction); suggestedAction.setText('display_text'); suggestedAction.setPostbackData('postback_data_123'); // attach the action to a suggestion object Suggestion suggestion = new Suggestion(); suggestion.setAction(suggestedAction); return suggestion; }
Takvim etkinliği oluşturma
Takvim etkinliği oluşturma işlemi, kullanıcının takvim uygulamasını açar ve belirtilen bilgilerle yeni bir etkinlik oluşturmaya başlar.
Takvim etkinliği başlığı gereklidir. En fazla 100 karakter uzunluğundadır. Takvim etkinliği açıklaması isteğe bağlıdır ve en fazla 500 karakter uzunluğunda olabilir.
Örnek
Aşağıdaki kod, takvim etkinliği oluşturma işlemi gönderir. Biçimlendirme ve değer seçenekleri için CreateCalendarEventAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Save to calendar", "postbackData": "postback_data_1234", "fallbackUrl": "https://www.google.com/calendar", "createCalendarEventAction": { "startTime": "2020-06-30T19:00:00Z", "endTime": "2020-06-30T20:00:00Z", "title": "My calendar event", "description": "Description of the calendar event" } } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define a create calendar event suggested action let suggestions = [ { action: { text: 'Save to calendar', postbackData: 'postback_data_1234', createCalendarEventAction: { startTime: '2020-06-30T19:00:00Z', endTime: '2020-06-30T20:00:00Z', title: 'My calendar event', description: 'Description of the calendar event', }, } }, ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with a create calendar event suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.CreateCalendarEventAction; 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<Suggestion> suggestions = new ArrayList<Suggestion>(); // creating a create calendar event suggested action CreateCalendarEventAction createCalendarEventAction = new CreateCalendarEventAction(); calendarEventAction.setTitle("My calendar event"); calendarEventAction.setDescription("Description of the calendar event"); calendarEventAction.setStartTime("2020-06-30T19:00:00Z"); calendarEventAction.setEndTime("2020-06-30T20:00:00Z"); // creating a suggested action based on a create calendar event action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Save to calendar"); suggestedAction.setPostbackData("postback_data_1234"); suggestedAction.setCreateCalendarEventAction(createCalendarEventAction); // 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(); }
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 calendar event suggested action suggestions = [ messages.CreateCalendarEventAction('Save to Calendar', 'reply:postback_data_1234', '2020-06-30T19:00:00Z', '2020-06-30T20:00:00Z', 'My calendar event', 'Description of the calendar event') ] # 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')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Create a calendar event action CreateCalendarEventAction calendarEventAction = new CreateCalendarEventAction { Title = "My calendar event", Description = "Description of the calendar event", StartTime = "2020-06-30T19:00:00Z", EndTime = "2020-06-30T20:00:00Z" }; // Attach the calendar event action to a suggested action SuggestedAction suggestedAction = new SuggestedAction { CreateCalendarEventAction = calendarEventAction, Text = "Save to calendar", PostbackData = "postback_data_1234" }; // Attach the action to a suggestion object Suggestion suggestion = new Suggestion { Action = suggestedAction }; List<Suggestion> suggestions = new List<Suggestion> { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
İleti oluşturma
Oluştur işlemi, kullanıcının mesajlaşma uygulamasını açar. Böylece kullanıcı, önceden tanımlanmış bir telefon numarasına (ör. müşteri desteği numarası) mesaj gönderebilir.
Üç tür Oluştur işlemi vardır. Görsel örnekler için Metin, ses veya video mesajı oluşturma başlıklı makaleyi inceleyin.
- Kısa mesaj oluşturma: Mesajlaşma uygulamasını, kullanıcının göndermesi için önceden doldurulmuş metinle açar.
- Sesli mesaj oluşturma: Mesajlaşma uygulamasını açar ve kullanıcının ses kaydetmesi için mikrofonu başlatır.
- Video mesaj oluşturma: Mesajlaşma uygulamasını açar ve kullanıcının video kaydedebilmesi için kamerayı başlatır.
Örnek
Aşağıdaki kod, bir oluşturma işlemi gönderir. Biçimlendirme ve değer seçenekleri için ComposeAction
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "text": "Hello, world!", "suggestions": [ { "action": { "text": "Compose a text message", "postbackData": "postback_data_123", "composeAction": { "composeTextMessage": { "phoneNumber": "+15556667777", "text": "Draft to go into the send message text field." } } } },{ "action": { "text": "Compose an audio message", "postbackData": "postback_data_456", "composeAction": { "composeRecordingMessage": { "phoneNumber": "+15556667777", "type": "ACTION_TYPE_AUDIO" } } } },{ "action": { "text": "Compose a video message", "postbackData": "postback_data_789", "composeAction": { "composeRecordingMessage": { "phoneNumber": "+15556667777", "type": "ACTION_TYPE_VIDEO" } } } } ] } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Define a compose suggested action let suggestions = [ { action: { text: 'Compose a text message', postbackData: 'postback_data_123', 'composeAction': { 'composeTextMessage': { 'phoneNumber': '+15556667777' 'text': 'Draft to go into the send message text field.' } } } },{ action: { text: 'Compose an audio message', postbackData: 'postback_data_456', 'composeAction': { 'composeRecordingMessage': { 'phoneNumber': '+15556667777' 'type': 'ACTION_TYPE_AUDIO' } } } },{ action: { text: 'Compose a video message', postbackData: 'postback_data_789', 'composeAction': { 'composeRecordingMessage': { 'phoneNumber': '+15556667777' 'type': 'ACTION_TYPE_VIDEO' } } } } ]; let params = { messageText: 'Hello, world!', msisdn: '+12223334444', suggestions: suggestions, }; // Send a simple message with a dial suggested action rbmApiHelper.sendMessage(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.ComposeAction; import com.google.api.services.rcsbusinessmessaging.v1.model.ComposeRecordingMessage; import com.google.api.services.rcsbusinessmessaging.v1.model.ComposeTextMessage; 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<Suggestion> suggestions = new ArrayList<Suggestion>(); // creating compose text suggested action Suggestion composeTextSuggestion = getComposeTextAction() suggestions.add(composeTextSuggestion); // creating compose audio suggested action Suggestion composeAudioSuggestion = getComposeAudioAction() suggestions.add(composeAudioSuggestion); // Send simple text message with the suggestion action rbmApiHelper.sendTextMessage( "Hello, world!", "+12223334444", suggestions ); } catch(Exception e) { e.printStackTrace(); } /** * Creates a compose text suggested action. * @return A suggestion object for a compose text action. */ private Suggestion getComposeTextAction() { // creating a compose text suggested action ComposeTextMessage message = new ComposeTextMessage(); message.setPhoneNumber("+12223334444"); message.setText("Draft to go into the send message text field."); ComposeAction composeAction = new ComposeAction(); composeAction.setComposeTextMessage(message); // creating a suggested action based on a compose text action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Send a text message"); suggestedAction.setPostbackData("postback_data_123"); suggestedAction.setComposeAction(composeAction); // attaching action to a suggestion Suggestion suggestion = new Suggestion(); suggestion.setAction(suggestedAction); return suggestion; } /** * Creates a compose audio suggested action. * @return A suggestion object for a compose audio action. */ private Suggestion getComposeAudioAction() { // creating a compose audio suggested action ComposeRecordingMessage message = new ComposeRecordingMessage(); message.setPhoneNumber("+12223334444"); message.setType("ACTION_TYPE_AUDIO"); ComposeAction composeAction = new ComposeAction(); composeAction.setComposeRecordingMessage(message); // creating a suggested action based on a compose text action SuggestedAction suggestedAction = new SuggestedAction(); suggestedAction.setText("Send an audio message"); suggestedAction.setPostbackData("postback_data_456"); suggestedAction.setComposeAction(composeAction); // attaching action to a suggestion Suggestion suggestion = new Suggestion(); suggestion.setAction(suggestedAction); return suggestion; }
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 dial suggested action suggestions = [ messages.ComposeTextMessageAction( 'Send a text message', 'postback_data_123', '+15556667777', '') messages.ComposeRecordingMessageAction( 'Send an audio message', 'postback_data_456', '+15556667777', 'ACTION_TYPE_AUDIO') ] # 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')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Create a compose text suggested action ComposeTextMessage composeTextMessage = new ComposeTextMessage{ PhoneNumber = "+15556667777" Text = "Draft to go into the send message text field." }; ComposeAction composeAction = new ComposeAction { ComposeTextMessage = composeTextMessage }; // Creating a suggested action based on a compose action SuggestedAction suggestedAction = new SuggestedAction { Text = "Send a text message", PostbackData = "postback_data_123", ComposeAction = composeAction }; // Attach action to a suggestion Suggestion suggestion = new Suggestion { Action = suggestedAction }; Listsuggestions = new List { suggestion }; rbmApiHelper.SendTextMessage( "Hello, world!", "+12223334444", suggestions );
Öneri çipi listesi
Temsilciniz, kullanıcıların sonraki işlemlerine rehberlik etmek için mesajlar içeren öneri çipi listeleri gönderir. Çip listesi yalnızca ilişkili mesaj ileti dizisinin en altında olduğunda gösterilir. Görüşmede daha sonra gönderilen mesajlar (kullanıcıdan veya temsilcinizden gelenler) çip listesinin üzerine yazılır.
Listede önerilen yanıtlar ve önerilen işlemler bulunur.
Çip listeleri en fazla 11 öneri çipi içerir ve her çip etiketi en fazla 25 karakterden oluşabilir.
Biçimlendirme ve değer seçenekleri için AgentContentMessage
bölümüne bakın.
Zengin kartlar
İlgili bir bilgi, medya veya öneri grubu göndermeniz gerektiğinde zengin kart göndermeniz gerekir. Zengin kartlar, temsilcinizin tek bir mesajda birden fazla bilgi birimi göndermesine olanak tanır.
Zengin kartlar aşağıdaki öğeleri içerebilir:
- Resim veya video
- Başlık metni
- Açıklama metni
- Önerilen yanıtlar ve önerilen işlemler (en fazla 4)
Zengin kartlar listelenen öğelerin tümünü içerebilir ancak geçerli olması için en az bir resim, video veya başlık içermelidir. Zengin kartlar en fazla dört önerilen işlem ve önerilen yanıt içerebilir.
Temsilciniz, zengin kart bandında birden fazla zengin kart gönderebilir.
Zengin kart yükü maksimum 250 KB olabilir. Medya dosyası boyutu önerileri ve sınırları için en iyi uygulamalara göz atın.
Zengin kart özelliklerini Zengin kartlar bölümünde bulabilirsiniz.
Kart yüksekliği
Kartlar, içeriklerine sığacak şekilde dikey olarak genişler. Zengin kartların minimum yüksekliği 112 DP, maksimum yüksekliği ise 344 DP'dir. Bir kartın içeriği minimum kart yüksekliğini dolduracak kadar büyük değilse kart genişler ve fazla yüksekliği boşlukla doldurur.
Zengin kartlardaki medyalar üç yükseklikten birine uygun olmalıdır:
- Kısa: 112 piksel
- Orta: 168 DP
- Yüksek: 264 DP
Medya, seçilen yükseklik dikkate alındığında karttaki boyutlara sığmazsa medya yakınlaştırılıp kırpılarak medya önizlemesi seçilir.
Örnek
Aşağıdaki kod, bir resim ve önerilen yanıtlar içeren zengin bir kart gönderir. Biçimlendirme ve değer seçenekleri için RichCard
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "richCard": { "standaloneCard": { "thumbnailImageAlignment": "RIGHT", "cardOrientation": "VERTICAL", "cardContent": { "title": "Hello, world!", "description": "RBM is awesome!", "media": { "height": "TALL", "contentInfo":{ "fileUrl": "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif", "forceRefresh": false } }, "suggestions": [ { "reply": { "text": "Suggestion #1", "postbackData": "suggestion_1" } }, { "reply": { "text": "Suggestion #2", "postbackData": "suggestion_2" } } ] } } } } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Suggested replies to be used in the card let suggestions = [ { reply: { 'text': 'Suggestion #1', 'postbackData': 'suggestion_1', }, }, { reply: { 'text': 'Suggestion #2', 'postbackData': 'suggestion_2', }, }, ]; // Image to be displayed by the card let imageUrl = 'http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif'; // Definition of the card parameters let params = { messageText: 'Hello, world!', messageDescription: 'RBM is awesome!', msisdn: '+12223334444', suggestions: suggestions, imageUrl: imageUrl, height: 'TALL', }; // Send rich card to device rbmApiHelper.sendRichCard(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.StandaloneCard; import com.google.api.services.rcsbusinessmessaging.v1.model.Suggestion; import com.google.rbm.cards.CardOrientation; import com.google.rbm.cards.MediaHeight; import com.google.rbm.RbmApiHelper; import com.google.rbm.SuggestionHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); // Create suggestions for chip list List<Suggestion> suggestions = new ArrayList<Suggestion>(); suggestions.add( new SuggestionHelper("Suggestion #1", "suggestion_1").getSuggestedReply()); suggestions.add( new SuggestionHelper("Suggestion #2", "suggestion_2").getSuggestedReply()); String imageUrl = "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif"; // Create a standalone rich card to send to the user StandaloneCard standaloneCard = rbmApiHelper.createStandaloneCard( "Hello, world!", "RBM is awesome!", imageUrl, MediaHeight.MEDIUM, CardOrientation.VERTICAL, suggestions ); rbmApiHelper.sendStandaloneCard(standaloneCard, "+12223334444"); } catch(Exception e) { e.printStackTrace(); }
Python
# Reference to RBM Python client helper and messaging object structure from rcs_business_messaging import rbm_service from rcs_business_messaging import messages # Suggested replies to be used in the card suggestions = [ messages.SuggestedReply('Suggestion #1', 'reply:suggestion_1'), messages.SuggestedReply('Suggestion #2', 'reply:suggestion_2') ] # Image to be displayed by the card image_url = 'http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif'; # Define rich card structure rich_card = messages.StandaloneCard('VERTICAL', 'Hello, world!', 'RBM is awesome!', suggestions, image_url, None, None, 'MEDIUM') # Append rich card and send to the user cluster = messages.MessageCluster().append_message(rich_card) cluster.send_to_msisdn('+12223334444')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; using RCSBusinessMessaging.Cards; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); List<Suggestion> suggestions = new List<Suggestion> { // Create suggestion chips new SuggestionHelper("Suggestion #1", "suggestion_1").SuggestedReply(), new SuggestionHelper("Suggestion #2", "suggestion_2").SuggestedReply() }; string imageUrl = "http://www.google.com/logos/doodles/2015/googles-new-logo-5078286822539264.3-hp2x.gif"; // Create rich card with suggestions StandaloneCard standaloneCard = rbmApiHelper.CreateStandaloneCard( "Hello, world!", "RBM is awesome", imageUrl, MediaHeight.TALL, CardOrientation.VERTICAL, suggestions ); // Send rich card to user rbmApiHelper.SendStandaloneCard(standaloneCard, "+12223334444");
Zengin kart bantları
Kullanıcılara aralarından seçim yapabilecekleri birden fazla seçenek sunmanız gerektiğinde zengin kart bandı kullanın. Bantlar, birden fazla zengin kartı birbirine bağlayarak kullanıcıların öğeleri karşılaştırmasına ve her birine ayrı ayrı tepki vermesine olanak tanır.
Bantlar en az iki, en fazla on zengin kart içerebilir. Bantlardaki zengin kartlar, içerik ve yükseklik için genel zengin kart koşullarına uygun olmalıdır. Bant özelliklerini Zengin kartlar bölümünde bulabilirsiniz.
Zengin kart rulosu yükü maksimum 250 KB olabilir. Medya dosyası boyutu önerileri ve sınırları için en iyi uygulamalara göz atın.
Kısaltma
Zengin kartlar gibi kartların son kullanıcılara nasıl göründüğü birçok faktöre (ör. ekran çözünürlüğü, piksel yoğunluğu ve kullanıcı tercihleri) bağlıdır. Ancak bantta, ilk birkaç kartın yüksekliği banttaki tüm kartların yüksekliğini belirler. Kart yüksekliği, başlığı, açıklamayı ve önerilerin kısaltılmasını etkiler.
Bir cihaz, ekran kısıtlamaları veya kart yüksekliği nedeniyle kartın tüm öğelerini görüntüleyemiyorsa RBM, aşağıdaki mantığı kullanarak kartı cihazda görüntülenebilene kadar kısaltır:
- Açıklamayı bir satıra indirin.
- Başlığı bir satıra indirin.
- Tanımlanmış listenin sonundan başlayarak karta sığmayan önerileri çıkarın.
- Açıklamayı çıkarın.
- Başlığı çıkarın.
Başlıkları ve açıklamaları kısaltılmaması için mümkün olduğunca kısa tutun. Dikey medya için bir başlık ve açıklama veya bir öneri kullanın. Orta medya için en fazla iki öneri kullanın. Kısa medyalarda en fazla üç öneri kullanın. Dört öneriyi sığdırmak için karta medya eklemeyin.
Kartların içerik boyutu ve uzunluğu açısından birbirine yakın olmasını sağlayın. Gerekirse, sonraki kartların kısaltılmasını önlemek için bandı daha büyük kartlarla doldurun.
Örnek
Aşağıdaki kod, zengin kart bandı gönderir. Biçimlendirme ve değer seçenekleri için RichCard
bölümüne bakın.
cURL
curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentMessages?messageId=MESSAGE_ID&agentId=AGENT_ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/rcs-business-messaging" \ -H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \ -d '{ "contentMessage": { "richCard": { "carouselCard": { "cardWidth": "MEDIUM", "cardContents": [ { "title": "Card #1", "description": "The description for card #1", "suggestions": [ { "reply": { "text": "Card #1", "postbackData": "card_1" } } ], "media": { "height": "MEDIUM", "contentInfo": { "fileUrl": "https://storage.googleapis.com/kitchen-sink-sample-images/cute-dog.jpg", "forceRefresh": false } } }, { "title": "Card #2", "description": "The description for card #2", "suggestions": [ { "reply": { "text": "Card #2", "postbackData": "card_2" } } ], "media": { "height": "MEDIUM", "contentInfo": { "fileUrl": "https://storage.googleapis.com/kitchen-sink-sample-images/elephant.jpg", "forceRefresh": false } } } ] } } } }'
Node.js
// Reference to RBM API helper const rbmApiHelper = require('@google/rcsbusinessmessaging'); // Images for the carousel cards let card1Image = 'https://storage.googleapis.com/kitchen-sink-sample-images/cute-dog.jpg'; let card2Image = 'https://storage.googleapis.com/kitchen-sink-sample-images/elephant.jpg'; // Define the card contents for a carousel with two cards, each with one suggested reply let cardContents = [ { title: 'Card #1', description: 'The description for card #1', suggestions: [ { reply: { text: 'Card #1', postbackData: 'card_1', } } ], media: { height: 'MEDIUM', contentInfo: { fileUrl: card1Image, forceRefresh: false, }, }, }, { title: 'Card #2', description: 'The description for card #2', suggestions: [ { reply: { text: 'Card #2', postbackData: 'card_2', } } ], media: { height: 'MEDIUM', contentInfo: { fileUrl: card2Image, forceRefresh: false, }, }, }, ]; // Definition of carousel card let params = { msisdn: '+12223334444', cardContents: cardContents, }; // Send the device the carousel card defined above rbmApiHelper.sendCarouselCard(params, function(response) { console.log(response); });
Java
import com.google.api.services.rcsbusinessmessaging.v1.model.CardContent; import com.google.api.services.rcsbusinessmessaging.v1.model.Suggestion; import com.google.rbm.cards.CardOrientation; import com.google.rbm.cards.CardWidth; import com.google.rbm.cards.MediaHeight; import com.google.rbm.RbmApiHelper; import com.google.rbm.SuggestionHelper; … try { // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(); List cardContents = new ArrayList(); // Images for the carousel cards String card1Image = "https://storage.googleapis.com/kitchen-sink-sample-images/cute-dog.jpg"; // Create suggestions for first carousel card List card1Suggestions = new ArrayList(); card1Suggestions.add( new SuggestionHelper("Card #1", "card_1")); cardContents.add( new StandaloneCardHelper( "Card #1", "The description for card #1", card1Image, card1Suggestions) .getCardContent(MediaHeight.SHORT) ); // Images for the carousel cards String card2Image = "https://storage.googleapis.com/kitchen-sink-sample-images/elephant.jpg"; // Create suggestions for second carousel card List card2Suggestions = new ArrayList(); card2Suggestions.add( new SuggestionHelper("Card #2", "card_2")); cardContents.add( new StandaloneCardHelper( "Card #2", "The description for card #2", card2Image, card2Suggestions) .getCardContent(MediaHeight.SHORT) ); // Send the carousel to the user rbmApiHelper.sendCarouselCards(cardContents, CardWidth.MEDIUM, "+12223334444"); } catch(Exception e) { e.printStackTrace(); }
Python
# Reference to RBM Python client helper and messaging object structure from rcs_business_messaging import rbm_service from rcs_business_messaging import messages # Images for the carousel cards card_image_1 = 'https://storage.googleapis.com/kitchen-sink-sample-images/cute-dog.jpg'; card_image_2 = 'https://storage.googleapis.com/kitchen-sink-sample-images/elephant.jpg'; # Suggested replies to be used in the cards suggestions1 = [ messages.SuggestedReply('Card #1', 'reply:card_1') ] suggestions2 = [ messages.SuggestedReply('Card #2', 'reply:card_2') ] # Define the card contents for a carousel with two cards, # each with one suggested reply card_contents = [] card_contents.append(messages.CardContent('Card #1', 'The description for card #1', card_image_1, 'MEDIUM', suggestions1)) card_contents.append(messages.CardContent('Card #2', 'The description for card #2', card_image_2, 'MEDIUM', suggestions2)) # Send the device the carousel card defined above carousel_card = messages.CarouselCard('MEDIUM', card_contents) cluster = messages.MessageCluster().append_message(carousel_card) cluster.send_to_msisdn('+12223334444')
C#
using Google.Apis.RCSBusinessMessaging.v1.Data; using RCSBusinessMessaging; using RCSBusinessMessaging.Cards; … // Create an instance of the RBM API helper RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation, projectId); // Image references to be used in the carousel cards string card1Image = "https://storage.googleapis.com/kitchen-sink-sample-images/cute-dog.jpg"; string card2Image = "https://storage.googleapis.com/kitchen-sink-sample-images/elephant.jpg"; // Suggestion chip lists to be used in carousel cards List<Suggestion> suggestions1 = new List<Suggestion> { new SuggestionHelper("Card #1", "card_1").SuggestedReply() }; List<Suggestion> suggestions2 = new List<Suggestion> { new SuggestionHelper("Card #2", "card_2").SuggestedReply() }; // Create the card content for the carousel List<CardContent> cardContents = new List<CardContent> { // Add items as card content new StandaloneCardHelper( "Card #1", "The description for card #1", card1Image, suggestions1).GetCardContent(), new StandaloneCardHelper( "Card #2", "The description for card #2", card2Image, suggestions2).GetCardContent() }; // Send the carousel to the user rbmApiHelper.SendCarouselCards(cardContents, CardWidth.MEDIUM, msisdn);