RCS for Business 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 istekte metin, rich card'lar, medya ve PDF dosyaları, önerilen yanıtlar ve önerilen işlemler bulunabilir.
RCS for Business platformu, mesaj teslimini 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 RCS for Business platformu
404 NOT_FOUNDhatası döndürür. Bu durumda, altyapınızda tanımlanan yedek yöntemler aracılığıyla kullanıcıya ulaşmayı deneyebilirsiniz. - Temsilcinizin henüz kullanıma sunulmadığı bir ağdaki veya RCS trafiğini etkinleştirmemiş bir ağdaki RCS kullanıcısına mesaj gönderirseniz RCS for Business platformu
404 NOT_FOUNDhatası döndürür. - Kullanıcının cihazının desteklemediği özellikler içeren bir mesaj gönderirseniz RCS for Business platformu
400 INVALID_ARGUMENThatası döndürür ve mesajınızı teslim etmez.
Çok kanallı mesajlaşma stratejiniz kapsamında, makul bir süre geçmesine rağmen teslim edilmeyen mesajları iptal etmek ve farklı bir kanal üzerinden göndermek en iyi yöntemdir. Mesajları önceden tanımlanmış bir zamanda otomatik olarak iptal etmek için mesaj geçerlilik süresi ayarlayın.
Alıcı internete bağlı değil
Alıcı çevrimdışıysa RCS for Business platformu, mesajı teslim edilmek üzere kabul etmeye devam eder. 200 OK yanıtı alırsınız ve RCS for Business platformu mesajı bekletip 30 gün boyunca yeniden göndermeyi dener. RCS for Business'tan mesajı tekrar göndermesini istemenize gerek yoktur.
RCS for Business, gönderildikten 30 gün sonra teslim edilmeyen mesajları siler.
Temsilcinizin kullanım alanına bağlı olarak, bu 30 günlük zaman aşımından önce teslim edilmeyen bir mesajı iptal etmek isteyebilirsiniz. Geri alma işlemi, çevrimdışı kullanıcıların tekrar internete bağlandıklarında eski bir mesajı almasını önleyebilir. Bir mesajı iptal etmenin birden fazla yolu vardır:
- İptal işlemini tetiklemek için iptal isteği gönderin.
- Mesajın uygun zamanda otomatik olarak iptal edilmesi için mesaj geçerlilik bitiş tarihi belirleyin.
İleti için geçerlilik bitiş tarihi belirleme
Temsilcinizin mesajı zamana duyarlı mı? Örneğin, OTP'ler 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ı da randevu tarihinden sonra geçerli olmaz. Mesajların güncel ve alakalı kalması için mesaj geçerlilik bitiş tarihi ayarlayın. Bu sayede, çevrimdışı kullanıcıların tekrar internete bağlandıklarında eski içerikleri görmeleri önlenebilir. Süre sonu, yedek mesajlaşma stratejinizi devreye sokmak için de iyi bir işarettir. Böylece kullanıcılar ihtiyaç duydukları bilgileri zamanında alır.
İleti geçerlilik süresi ayarlamak için temsilci mesajında aşağıdaki alanlardan birini belirtin:
expireTime: Mesajın süresinin dolduğu tam UTC saati.ttl(geçerlilik süresi): Mesajın süresi dolmadan önceki süre.
Biçimlendirme ve değer seçenekleri için AgentMessage başlıklı makaleyi inceleyin.
ttl ve expireTime için maksimum değer, mesaj gönderildikten sonra 15 gündür.
ttl ve expireTime için minimum değer, mesaj gönderildikten altı saniye sonradır.
Mesajların geçerlilik bitiş tarihini ayarlamayla ilgili öneriler
Kimlik doğrulama (OTP) mesajları için: Teslimat ve iptal yarışma durumlarının olasılığını önemli ölçüde azaltmak için mesaj gönderildikten sonra
ttldeğerini 15 saniye veya daha uzun bir süreye ayarlayın.İşlem ve tanıtım mesajları için: Cihazların mesajları taramak ve rich media içeriğini indirmek veya işlemek için ek süreye ihtiyacı olduğundan ve kullanıcılar kısa süreli bağlantı kesintileri yaşayabileceğinden (ör. asansörde veya tünelde) daha uzun geçerlilik süreleri (en az 60 saniye veya kullanım alanına bağlı olarak dakikalar ya da saatler) ayarlayın.
Mesajın geçerlilik süresi (TTL)
RCS for Business mesajı için TTL ayarladığınızda, mesajın ne kadar süre boyunca geçerli ve teslim edilebilir olarak kabul edilmesi gerektiğini belirtirsiniz. Mesaj, bu TTL süresi içinde kullanıcının cihazına başarıyla teslim edilmezse RCS for Business platformu mesajı otomatik olarak iptal etmeye çalışır.
Mesaj iptali başlattığınızda, RCS for Business platformundan söz konusu mesajı teslim etmeye çalışmayı durdurmasını istersiniz. Ancak bu işlem yalnızca gelecekteki teslim denemelerini etkiler. Kullanıcının cihazı mesajı başarıyla aldıysa mesaj işlenir ve RCS for Business platformu, mesajı kullanıcının cihazından iptal edemez.
Bildirimlerle ilgili olarak şunları bekleyebilirsiniz:
İleti TTL süresi içinde teslim edildi: Kullanıcının cihazı internete bağlanır ve iletiyi TTL süresi dolmadan alırsa
DELIVEREDbildirimi alırsınız. İleti başarıyla teslim edildiğinden iptal bildirimi gönderilmez. Bu, en yaygın ve beklenen senaryodur.Mesaj, TTL süresi dolmadan önce teslim edilmedi: Mesaj, kullanıcının cihazına ulaşmadan önce TTL süresi dolarsa (ör. cihaz çevrimdışıysa) RCS for Business platformu mesajı iptal etmeye çalışır. İletinin teslimat sırasından başarıyla kaldırıldığını belirten bir
TTL_EXPIRATION_REVOKEDbildirimi alırsınız. Bu durumda kullanıcı mesajı almaz.
Uç durumları ele almaya yönelik öneriler
Sistemimiz, RCS for Business mesaj teslimini ve TTL süre sonlarını paralel olarak işler. Bu nedenle, çok nadir durumlarda bildirimlerin zamanlamasının beklenmedik olduğu uç durumlar görebilirsiniz. Örneğin, hem teslimat hem de TTL bildirimi alabilir veya hiçbirini almayabilirsiniz.
RCS for Business mesaj bildirimlerini yönetmeyle ilgili önerilerimiz şunlardır:
DELIVEREDbildirimi: Bir ileti içinDELIVEREDbildirimi alırsanız bu, iletinin kullanıcıya ulaştığını doğrular. Bu mesaj için daha sonra gönderilen TTL bildirimlerini güvenle yok sayabilirsiniz.TTL_EXPIRATION_REVOKEDbildirimi:TTL_EXPIRATION_REVOKEDdurumuna sahip bir TTL bildirimi alırsanız bu, RCS for Business sisteminin ilgili mesajı teslim etme girişimlerini durdurduğu anlamına gelir. Bu mesajı teslim edilmemiş olarak kabul etmeli ve gerekirse yedek stratejinizi uygulamalısınız.Başka bir durum içeren TTL bildirimi: Başka bir durum içeren TTL bildirimi alırsanız bu, sonuçsuz bir iptal girişimini gösterir.
- Tek kullanımlık şifreler (OTP'ler) gibi kritik mesajlar için yedek yönteminizi başlatın.
- Kritik olmayan mesajlar için yedek mesajın başlatılıp başlatılmayacağına karar verin.
- Bildirim yok: Nadir görülen uç durumlarda sistem, TTL bildirimi gönderemeyebilir ve istemci de teslim bildirimi oluşturamayabilir. Bu son derece nadir görülen bir durumdur.
Mesaj trafiği türünü ayarlama
RBM API, mesajları kategorilere ayırmak için bir messageTrafficType alanı içerir.
Temsilci kullanım alanları, temsilci davranışını ve hangi işletme kurallarının geçerli olduğunu tanımlamaya devam ederken messageTrafficType, mesaj içeriğinin daha ayrıntılı bir şekilde kategorize edilmesine olanak tanır. Bu sayede tek bir temsilci birden fazla kullanım alanını yönetebilir. Bu durumun mevcut temsilci kullanım alanları veya iş kuralları üzerinde herhangi bir etkisi yoktur.
Bu alan isteğe bağlıdır ancak alan zorunlu hale geldiğinde hata almamak için şimdi ayarlamanız önerilir.
Mesaj trafiği türünü ayarlamak için her mesaja içeriğine göre uygun messageTrafficType atayın. Aşağıdaki tabloda, desteklenen trafik türleri ve beklenen temsilci kullanım alanları listelenmiştir. Bu eşleme, beklenen kullanımla ilgili önerilen bir kılavuzdur ve şu anda API tarafından uygulanan bir kısıtlama değildir.
| Trafik türü | Mesaj içeriği | Önerilen temsilci kullanım alanı |
|---|---|---|
AUTHENTICATION |
Kimlik doğrulama mesajları 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ı. | İşlem veya çoklu kullanım |
PROMOTION |
Fırsatlar, indirimler, duyurular veya diğer tanıtım amaçlı içerikler gibi tanıtım mesajları için kullanılır. | Promosyon amaçlı veya çoklu kullanım |
SERVICEREQUEST |
Kullanıcının açıkça talep ettiği hizmetlerle ilgili mesajlar için. | OTP, İşlem Amaçlı, Tanıtım Amaçlı veya Çok Amaçlı |
ACKNOWLEDGEMENT |
Kullanıcının bir işlemini (özellikle de e-posta listesinden çıkma isteğini) onaylamak için kullanılan mesajlar. Bu, kullanıcının isteğinin alındığını ve işlendiğini onaylar. | OTP, İşlem Amaçlı, Tanıtım Amaçlı veya Çok Amaçlı |
Trafik türü ayarlanmamışsa sistem, temsilcinin kullanım alanına göre varsayılan türü atar.
| Temsilci kullanım alanı | Varsayılan trafik türü |
|---|---|
| OTP | AUTHENTICATION |
| İşlemle ilgili | 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ü, içeriğine göre her mesaj için açıkça ayarlamanız gerekir. MESSAGE_TRAFFIC_TYPE_UNSPECIFIED değerini değiştirmezseniz mesaj yine de kabul edilir ve belirli bir trafik türü sınıflandırması olmadan teslim edilir.
İleti boyutu sınırları
Dizeye dönüştürülmüş AgentMessage'ın tamamının maksimum boyutu 250 KB'tır. Mesajın metin kısmının kendi sınırı 3.072 karakterdir.
Kullanıcıların beklenmedik veri tüketimiyle karşılaşmasını önlemek için RCS for Business üzerinden gönderilebilecek maksimum dosya boyutu 100 MiB'dir. Tek bir RCS for Business mesajındaki tüm medya ve PDF eklerinin toplam boyutu 100 MiB'yi aşmamalıdır. (1 MiB = 1.048.576 bayt). Daha fazla bilgi için medya ve PDF dosyaları bölümüne bakın.
Metin
En basit mesajlar metinden oluşur. Kısa mesajlar, görsel, karmaşık etkileşim veya yanıt gerektirmeyen bilgileri iletmek için en uygun yöntemdir.
Örnek
Aşağıdaki kod, düz metin kısa 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'in dönüştürülmesi
Operatörler, SMS mesajlarının RCS for Business'a geçişini desteklemek için faturalandırma modelleri kullanmaya başladı. En fazla 160 UTF-8 karakter içeren RCS for Business mesajlarına "temel mesaj" denir.
Temel Mesaj göndermek için istek oluştururken karakterlerin 1 bayt (UTF-8) olarak sayıldığını unutmayın. Emoji veya çok baytlı karakter kümesi gibi özel karakterler içeren bir mesaj gönderirseniz her karakter 2-4 UTF-8 karakteri veya daha fazla sayılır.
Uzunluğunu kontrol etmek için kutuya metin girin:
Kısa mesaj içeriği ve bağlantı önizlemeleri
RCS istemcileri bağlantı önizlemeleri uygulayabilir. Yalnızca metin içeren bir RCS for Business mesajında openGraph etiketleri içeren bir web sitesinin URL'si varsa istemci, önizleme (resim, başlık vb.) oluşturarak daha zengin bir deneyim sunabilir. Örneğin, URL önizlemesi içeren temel bir mesajı inceleyin.
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 kullanımlık şifreler
SMS Retriever API ile otomatik kullanıcı doğrulaması için tek kullanımlık şifreler (OTP) göndermek üzere RCS for Business'ı kullanabilirsiniz. RCS for Business üzerinden gelen OTP'leri okumak için özel bir API yoktur.
Android'de işleyiş şekli
SMS Retriever API'ye kaydolan Android uygulamaları için API, doğru biçimlendirilmiş bir RCS for Business mesajını dinler. Bu mesajda hem OTP hem de uygulamanızı tanımlayan benzersiz bir karma değer bulunmalıdır.
RCS for Business mesajı doğru biçimde alındığında SMS Retriever API, mesajı SMS OTP gibi işler. Karma, uygulamanızla eşleştirildikten sonra OTP çıkarılır ve otomatik kullanıcı doğrulaması için uygulamanıza yönlendirilir.
- Kullanıcı doğrulaması için örnek RCS for Business 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 belgelerini inceleyin. 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'te işleyiş şekli
iOS'te, sistemin yerleşik OTP işleme özelliği, SMS OTP'lerinde olduğu gibi RCS for Business OTP'lerini otomatik olarak algılar ve otomatik doldurma için önerir. iOS uygulamasının OTP'yi okuması için belirli bir API entegrasyonu gerekmez.
Medya ve PDF dosyaları
Resim, video, ses veya PDF dosyası içeren bir mesaj gönderdiğinizde temsilciniz, içerik için herkese açık bir URL sağlamalı veya dosyayı doğrudan yüklemelidir.
Gönderilebilecek bir dosyanın maksimum boyutu 100 MiB'dir ve tek bir mesajdaki tüm medya ve PDF eklerinin toplam boyutu 100 MiB'yi aşmamalıdır.
Medya sıkıştırma ve kod dönüştürme
RCS for Business platformu, medya dosyalarını (ör. resimler ve videolar) göndermeden önce otomatik olarak dönüştürür ve sıkıştırır. Böylece dosyaların hızlı yüklenmesini ve farklı ağlarda ve cihazlarda sorunsuz çalışmasını sağlar.
Sıkıştırma, dosya boyutu sınırlarından ziyade giriş medyasının kalitesine göre yapılır. Bu, boyutu 100 MiB olan maksimum sınırın çok altında olsa bile bir dosyanın sıkıştırılabileceği anlamına gelir. Kod dönüştürme standartları sürekli değiştiğinden, kod dönüştürmenin ne zaman atlanacağını belirleyen sabit bir dosya boyutu sınırı yoktur. Yükleriniz için en uygun dengeyi bulmak amacıyla farklı medya biçimleri, boyutlar ve sıkıştırma oranlarıyla denemeler yapın.
Küçük resim özellikleri
Medya dosyaları için, kullanıcıların tıklamadan önce içeriği önizlemesine olanak tanıyan bir küçük resim de belirtebilirsiniz. Ses dosyaları için varsayılan ses widget'ı yer tutucu olarak kullanılır.
- Küçük resmin maksimum dosya boyutu 100 kB'tır. En iyi kullanıcı deneyimi için 50 kB veya daha az olmasını öneririz.
- Küçük resmin en boy oranı, orijinal dosyanın oranıyla eşleşmelidir.
Önbelleğe alma ve URL yönetimi
RCS for Business platformu, dosyaları 60 gün boyunca önbelleğe alır ve API, temsilcinizin kullanıcılara gönderdiği mesajlara ekleyebileceği bir dosya kimliği döndürür. RCS for Business, 60 gün sonra dosyaları önbellekten kaldırır.
Dosyaları URL ile belirtirken contentMessage.forceRefresh değerini false olarak ayarlamak en iyi uygulamadır. contentMessage.forceRefresh ayarını true olarak belirlemek, URL içeriği önbelleğe alınmış olsa bile RCS for Business'ı belirtilen URL'den yeni içerik almaya zorlar. Bu da kullanıcılar için mesaj teslimat sürelerini uzatır.
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, medyayı mesajla göndermeden önce files.create ile 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 JSONcurl -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 JSONcurl -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
RCS for Business 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 | Evet (yalnızca Hindistan'daki Google Mesajlar için) | ||
| audio/aac | AAC ses | .aac | Hayır |
| audio/mp3 | MP3 ses | .mp3 | Hayır |
| audio/mpeg | MPEG ses | .mpeg | Hayır |
| audio/mpg | MPG ses | .mp3 | Hayır |
| audio/mp4 | MP4 ses | .mp4 | Hayır |
| audio/mp4-latm | MP4-latm ses | .mp4 | Hayır |
| audio/3gpp | 3GPP ses | .3gp | Hayır |
| image/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 video | .webm | Evet |
Öneriler
Temsilciniz, önerileri (önerilen yanıtlar ve önerilen işlemler) öneri çipi listelerinde veya rich card'larda gönderir.
Önerilen yanıtlar
Önerilen yanıtlar, temsilcinizin nasıl tepki vereceğini bildiği yanıtlar sağlayarak kullanıcıları sohbetlerde yönlendirir.
Kullanıcı Önerilen Yanıtlar'a dokunduğunda temsilciniz, yanıtın metnini ve geri gönderme verilerini içeren bir etkinlik alır. Yük en fazla 2.048 karakterden oluşur.
Örnek
Aşağıdaki kod, iki Önerilen Yanıtla birlikte 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 eylemler
Önerilen eylemler, cihazların yerleşik işlevlerinden yararlanarak kullanıcıları görüşmelerde yönlendirir. Temsilciniz, kullanıcılara bir numara çevirmelerini, haritada bir konum açmalarını, bir konum paylaşmalarını, bir URL açmalarını veya bir takvim etkinliği oluşturmalarını önerebilir.
Önerilen her eylem için isteğe bağlı olarak bir yedek URL (en fazla 2.048 karakter) sağlayabilirsiniz. Kullanıcının cihazı önerilen eylemi desteklemiyorsa bu URL yeni bir tarayıcı penceresinde açılır.
Kullanıcı önerilen bir eyleme dokunduğunda temsilciniz, eylemin geri gönderme verilerini içeren bir etkinlik alır.
Biçimlendirme ve değer seçenekleri için SuggestedAction başlıklı makaleyi inceleyin.
Öneri ekranı
Önerileri göstermenin iki yolu vardır:
- Persistent: Mesaj balonunun içinde gösterilen ve görüşme boyunca sabit kalan önerilen eylemler veya yanıtlar.
- Geçici: Mesaj balonunun dışında gösterilen ve görüşme devam ettiğinde kaybolan öneriler.
Desteklenen mesaj biçimleri
- Kalıcı öneriler: Bağımsız kısa mesajlar ve zengin kartlarla çalışır.
- Geçici öneriler: Bağımsız kısa mesajlar, medya mesajları ve zengin kartlarla çalışır.
Önerileri birleştirme
Kalıcı ve geçici önerileri aynı mesajda veya zengin kartta bir arada kullanabilirsiniz.
- Kısa mesajlar: Öneriler varsayılan olarak geçicidir. Balonun içinde kalmalarını sağlamak için bunları kalıcı olarak yapılandırmanız gerekir.
- Zengin kartlar: Bunlar varsayılan olarak en fazla dört kalıcı öneriyi destekler. Ardından, geçici önerileri kartın altına "çip listesi" olarak ekleyebilirsiniz.
Öneri sınırları
Tek bir kısa mesajda toplamda en fazla 11 öneri desteklenir. Dahil ettiğiniz tüm kalıcı öneriler bu toplam sınıra dahil edilir. Örneğin, 4 kalıcı öneri eklerseniz en fazla 7 geçici öneri ekleyebilirsiniz.
| Öneri türü | Sınır | Gösterildikleri yerler |
|---|---|---|
| Kalıcı | En fazla 4 | Mesaj balonunun içinde |
| Geçici | En fazla 11 | Balonun dışında (çip olarak) |
Karakter sınırı
Her öneri en fazla 25 karakterden oluşur.
Önerilen işlemlerde URL şeffaflığı
Kullanıcıların güvenini kazanmak için "URL aç" önerilen eylemlerinde, öneri düğmesinin içinde ikinci bir metin satırı olarak temel URL gösterilir. Bu tutarlı davranış; bağımsız kısa mesajlar, zengin kartlar ve bantlar için geçerlidir.
Kalıcı öneriler için desteklenen istemciler
- Desteklenen uygulamalar: Google Mesajlar (sürüm
20260225.00veya sonraki sürümler). - Desteklenmeyenler:
20260225.00sürümünden önceki Google Mesajlar sürümleri, iOS ve Samsung Mesajlar.
Sistem bildirimlerindeki öneriler
Kullanıcı bir mesaj aldığında Google Mesajlar, uygun olan ilk öneriyi doğrudan Android sistem bildiriminde gösterir. Kullanıcılar bu öneriye dokunarak uygulamayı açmaya gerek kalmadan yanıt gönderebilir veya bir işlemi tetikleyebilir.
Mesajlarınızı tasarlarken aşağıdaki davranışları göz önünde bulundurun:
- Sıra önemlidir: Bildirim başına yalnızca bir öneri gösterilir. Etkileşimi en üst düzeye çıkarmak için en yüksek öncelikli önerilen yanıtınızı veya işleminizi öneri listenizin en başına yerleştirin.
- Hariç tutulan işlemler: Konum Paylaş işlemi sistem bildirimlerinde hiçbir zaman gösterilmez. Kullanıcıların konumlarını paylaşmak için görüşmeyi açmaları gerekir.
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ı standardı (ör. +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 );
Konum görüntüleme
Konumu görüntüleme işlemi, kullanıcının varsayılan harita uygulamasında bir konum gösterir. Konumu enlem ve boylamla veya kullanıcının mevcut konumuna dayalı bir sorguyla belirtebilirsiniz. Harita uygulamasında gösterilen raptiye için özel bir etiket de ayarlayabilirsiniz.
Örnek
Aşağıdaki kod, konumu 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şma işlemi, kullanıcının temsilcinizle konum paylaşmasına olanak tanır. Kullanıcı, Haritalar uygulamasından mevcut konumunu veya manuel olarak seçtiği bir konumu paylaşabilir.
Örnek
Aşağıdaki kod, konum paylaşma 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 açma işlemi, kullanıcıları temsilciniz tarafından belirtilen bir web sayfasına yönlendirmenize olanak tanır. Varsayılan olarak, web sayfası kullanıcının tarayıcısında açılır. Web sayfasını bir web görünümünde açılacak şekilde de ayarlayabilirsiniz. Ayrıntılar için URL'leri webview ile açma bölümüne bakın.
Yalnızca Google Mesajlar'da
Temel URL'yi gösterme: A2P mesajlaşmada şeffaflığı artırmak için Google Mesajlar, "URL aç" önerilen eylemlerinde temel URL adresini gösterir. Bu değişiklik, standart zengin kartlar ve zengin kart bantlarındaki önerilen işlemleri etkiler.
Web bağlantıları için uygulama simgesi gösterimi: Kullanıcının web sayfası için yapılandırılmış varsayılan bir uygulaması varsa tarayıcı veya web görünümü yerine bu uygulama açılır ve öneri düğmesinde uygulamanın simgesi gösterilir. Uygulama simgesinin Google Mesajlar'da görünmesi için tam ve doğrudan URL'yi sağlamanız gerekir. Kısaltılmış bir URL kullanırsanız varsayılan URL'yi aç simgesi gösterilir.
Ö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 );
URL'yi webview ile açma
"URL'yi webview ile 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ı, RCS for Business görüşmesinden ayrılmadan web sayfasıyla etkileşim kurabilir. Kullanıcının cihazı web görünümlerini desteklemiyorsa web sayfası kullanıcının tarayıcısında açılır. Web görünümlerini etkinleştirmek için OpenURLApplication başlıklı makaleyi inceleyin.
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.
- Uzun: Web sayfası, ekranın dörtte üçünü kaplar.
Örnek
Aşağıdaki kod, web görünümü işlemiyle bir URL açma isteği 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", "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ştur 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ığı zorunludur. En fazla 100 karakter olabilir. Takvim etkinliği açıklaması isteğe bağlıdır ve en fazla 500 karakterden oluşabilir.
Örnek
Aşağıdaki kod, takvim etkinliği oluşturma işlemi gönderir. Biçimlendirme ve değer seçenekleri için CreateCalendarEventAction sayfasına 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 );
Öneri çipi listesi
Temsilciniz, kullanıcıların sonraki işlemlerine rehberlik etmek için mesajlarla birlikte öneri çipi listeleri gönderir. Çip listesi yalnızca ilişkili mesaj görüşmenin en altındayken gösterilir. Görüşmedeki sonraki mesajlar (kullanıcıdan veya temsilcinizden gelen) çip listesinin üzerine yazılır.
Listedeki çipler, önerilen yanıtlar ve önerilen işlemlerdir.
Çip listeleri en fazla 11 öneri çipi içerir ve her çip etiketinde en fazla 25 karakter bulunabilir.
Biçimlendirme ve değer seçenekleri için AgentContentMessage başlıklı makaleyi inceleyin.
Zengin kartlar
Zengin kartlar; medya, metin ve etkileşimli önerileri tek bir mesajda birleştirir. Alakalı bilgileri sunmak (ör. bir ürünün resmi, adı ve fiyatı) ve "Ayrıntıları görüntüle" önerisi gibi net bir sonraki adımla kullanıcıları yönlendirmek için idealdir.
Zengin kartlar şunları içerebilir:
- Medya (resim, GIF veya video)
- Başlık metni
- Açıklama metni
- Önerilen yanıtlar ve önerilen eylemler (en fazla 4)
Bu alanların her biri isteğe bağlıdır ancak 1-3 numaralı alanlardan en az biri zengin karta dahil edilmelidir.
Yatay olarak kaydırılan bir bantta birden fazla kart birlikte gönderilebilir.
Zengin kartın toplam yükünün 250 KB olduğunu unutmayın.
Tüm teknik ayrıntılar için Zengin kartlar belgelerine bakın.
Kart yüksekliği
Zengin kartlar, içeriklerine sığacak şekilde dikey olarak genişler. Minimum yükseklikleri 112 DP, maksimum yükseklikleri ise 344 DP'dir. Kart içerikleri minimum kart yüksekliğini dolduracak kadar büyük değilse kart genişler ve ek yüksekliği boşlukla doldurur.
Zengin kartlardaki medya, üç yükseklikten birine uymalıdır:
- Kısa: 112 DP
- Orta: 168 DP
- Yüksek: 264 DP
Medya, seçilen yüksekliğe göre karttaki boyutlara sığmıyorsa medya önizlemesi, medya yakınlaştırılıp kırpılarak seçilir.
Örnek
Aşağıdaki kod, resim ve önerilen yanıtlar içeren bir zengin kart gönderir. Biçimlendirme ve değer seçenekleri için RichCard başlıklı makaleyi inceleyin.
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 rulosu
Karuseller, birden fazla zengin kartı bir araya getirerek kullanıcıların öğeleri karşılaştırmasına ve her birine ayrı ayrı tepki vermesine olanak tanır.
Rulolar en az iki, en fazla on zengin kart içerebilir. Dönen öğelerdeki zengin kartlar, Zengin kartlar dokümanlarında açıklandığı gibi içerik ve yükseklik açısından genel zengin kart şartlarına uymalıdır. Döngü düzeni ve teknik özellikleri hakkında daha fazla bilgi için Döngü belgelerine bakın.
Örnek
Aşağıdaki kod, zengin kart rulosu 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/welcome-bot-sample-images/200.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/welcome-bot-sample-images/201.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/welcome-bot-sample-images/200.jpg'; let card2Image = 'https://storage.googleapis.com/welcome-bot-sample-images/201.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/welcome-bot-sample-images/200.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/welcome-bot-sample-images/201.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/welcome-bot-sample-images/200.jpg'; card_image_2 = 'https://storage.googleapis.com/welcome-bot-sample-images/201.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/welcome-bot-sample-images/200.jpg"; string card2Image = "https://storage.googleapis.com/welcome-bot-sample-images/201.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);