סוכני RCS for Business מתקשרים עם משתמשים על ידי שליחה וקבלת הודעות. כדי לשלוח הודעות למשתמשים, הסוכן שלך שולח בקשות הודעה לממשק ה-API של RCS Business Messaging. בקשה אחת יכולה לכלול טקסט , כרטיסי Rich Card , קבצי מדיה וקובצי PDF , הצעות לתשובות והצעות לפעולות .
פלטפורמת RCS for Business מחזירה שגיאות במצבים מסוימים כדי לעזור לך לנהל את מסירת ההודעות:
- אם תשלחו הודעה למשתמש שהמכשיר שלו אינו תומך ב-RCS או ש-RCS אינו מופעל בו, פלטפורמת RCS for Business תחזיר שגיאת 404 NOT_FOUND. במקרה זה, תוכלו לנסות להגיע למשתמש באמצעות שיטות החלפה המוגדרות בתשתית שלכם.
- אם אתה שולח הודעה למשתמש RCS ברשת שבה הסוכן שלך עדיין לא הופעל, או ברשת שלא הפעילה תעבורת RCS, פלטפורמת RCS for Business מחזירה שגיאת 404 NOT_FOUND.
- אם תשלחו הודעה עם תכונות שהמכשיר של משתמש אינו תומך בהן, פלטפורמת RCS for Business תחזיר שגיאת 400 INVALID_ARGUMENT ולא תעביר את ההודעה שלכם.
כחלק מאסטרטגיית המסרים הרב-ערוצית שלך, עדיף לבטל הודעות שלא נמסרו לאחר זמן סביר ולשלוח אותן דרך ערוץ אחר. כדי לבטל הודעות באופן אוטומטי בזמן מוגדר מראש, הגדר תאריך תפוגה להודעה .
הנמען לא מקוון
פלטפורמת RCS for Business עדיין מקבלת הודעה למשלוח גם אם הנמען אינו מחובר. תקבלו תגובה של 200 OK, ופלטפורמת RCS for Business שומרת את ההודעה ומנסה לשלוח אותה מחדש למשך 30 יום. אין צורך לבקש מ-RCS for Business לשלוח את ההודעה שוב.
RCS לעסקים מוחק הודעות שלא נמסרו 30 יום לאחר שליחתן.
בהתאם לשימוש של הסוכן שלך, ייתכן שתרצה לבטל הודעה שלא נמסרה לפני פסק הזמן הזה של 30 יום. ביטול יכול למנוע ממשתמשים לא מקוונים לקבל הודעה מיושנת כשהם חוזרים למצב מקוון. ישנן מספר דרכים לבטל הודעה:
- שלח בקשת ביטול כדי להפעיל את הביטול.
- הגדר תאריך תפוגה של הודעה כדי לבטל אותה באופן אוטומטי בזמן המתאים.
הגדרת תוקף הודעה
האם הודעות הסוכן שלכם רגישות לזמן? לדוגמה, קוד OTP תקף לתקופה קצרה בלבד. הצעות לזמן מוגבל פגות תוקף. ותזכורות לפגישות אינן רלוונטיות לאחר תאריך הפגישה. כדי לשמור על הודעות עדכניות ורלוונטיות, הגדר תאריך תפוגה להודעה. זה יכול למנוע ממשתמשים לא מקוונים לקבל תוכן מיושן כשהם חוזרים לאינטרנט. תאריך תפוגה הוא גם רמז טוב להפעלת אסטרטגיית העברת ההודעות שלך כדי שמשתמשים יקבלו את המידע הדרוש להם בזמן.
כדי להגדיר תפוגת הודעה, ציין אחד מהשדות הבאים בהודעת הסוכן:
-
expireTime: הזמן המדויק ב-UTC בו פג תוקף ההודעה. -
ttl(זמן לחיות): משך הזמן עד שיפוג תוקף ההודעה.
לאפשרויות עיצוב וערך, ראה AgentMessage .
הערך המקסימלי עבור ttl ו- expireTime הוא 15 ימים לאחר שליחת ההודעה.
למרות שאין ערך מינימלי של ttl ו- expireTime , מומלץ לפחות 10 שניות לאחר שליחת ההודעה כדי להפחית משמעותית את הסיכוי לקבל הודעה על ביטול ומסירה.
זמן לחיות (TTL) למסר
כאשר מגדירים TTL עבור הודעת RCS for Business, מציין כמה זמן ההודעה צריכה להיחשב תקפה וניתנת למסירה. אם ההודעה לא נמסרה בהצלחה למכשיר המשתמש בתוך תקופת TTL זו, פלטפורמת RCS for Business מנסה אוטומטית לבטל אותה.
כאשר אתה יוזם ביטול הודעה, אתה מבקש מפלטפורמת RCS for Business להפסיק את ניסיונות המסירה של הודעה ספציפית זו. עם זאת, פעולה זו משפיעה רק על ניסיונות מסירה עתידיים. אם מכשיר של משתמש כבר אחזור בהצלחה את ההודעה, ההודעה מעובדת, ופלטפורמת RCS for Business אינה יכולה לבטל את ההודעה ממכשיר המשתמש.
הנה מה לצפות בנוגע להתראות:
הודעה נמסרה בתוך TTL: אם המכשיר של המשתמש מתחבר לאינטרנט ומקבל את ההודעה לפני ש-TTL פג, תקבלו הודעת
DELIVERED. לא תישלח הודעת ביטול, מכיוון שההודעה נמסרה בהצלחה. זהו התרחיש הנפוץ והצפוי ביותר.הודעה לא נמסרה לפני פקיעת תוקף ה-TTL: אם תוקף ה-TTL פג לפני שההודעה מגיעה למכשיר המשתמש (לדוגמה, המכשיר אינו מקוון), פלטפורמת RCS for Business תנסה לבטל את ההודעה. תקבלו הודעה
TTL_EXPIRATION_REVOKED, המציינת שההודעה הוסרה בהצלחה מתור המסירה. במקרה זה, המשתמש לא יקבל את ההודעה.
המלצות לטיפול במקרי קצה
המערכת שלנו מעבדת מסירת הודעות RCS for Business ותוקף TTL במקביל. מסיבה זו, לעיתים רחוקות מאוד, ייתכן שתראו מקרים קצה שבהם תזמון ההתראות אינו צפוי. לדוגמה, ייתכן שתקבלו גם הודעת מסירה וגם הודעת TTL, או שלא תקבלו אף אחת מהן.
הנה ההמלצות שלנו לטיפול בהתראות הודעות של RCS for Business:
הודעת
DELIVERED: אם אתם מקבלים הודעתDELIVEREDעבור הודעה, היא מאשרת שההודעה הגיעה למשתמש. אתם יכולים להתעלם בבטחה מכל התראות TTL עוקבות עבור הודעה ספציפית זו.הודעת
TTL_EXPIRATION_REVOKED: אם קיבלתם הודעת TTL עם הסטטוסTTL_EXPIRATION_REVOKED, פירוש הדבר שמערכת RCS for Business מפסיקה לנסות לשלוח את ההודעה הספציפית הזו. עליכם להתייחס להודעה זו כלא נמסרה ולהמשיך באסטרטגיית החלופה שלכם במידת הצורך.הודעת TTL עם כל סטטוס אחר: אם קיבלת הודעת TTL עם כל סטטוס אחר, זה מצביע על ניסיון ביטול לא חד משמעי.
- עבור הודעות קריטיות, כגון סיסמאות חד-פעמיות (OTP), הפעל את שיטת החלפה שלך.
- עבור הודעות לא קריטיות, החליטו אם להפעיל את הפתרון החלופי או לא.
- אין התראות: במקרים נדירים בקצה הרשת, המערכת עלולה להיכשל בשליחת הודעת TTL והלקוח עלול גם להיכשל ביצירת הודעת מסירה. זהו מקרה נדיר ביותר.
הגדר את סוג תעבורת ההודעות
ממשק ה-API של RBM כולל שדה messageTrafficType לסיווג הודעות. בעוד שמקרי שימוש של סוכנים עדיין מגדירים את התנהגות הסוכנים ואת כללי העסק החלים, messageTrafficType מאפשר סיווג מפורט יותר של תוכן ההודעות. בסופו של דבר, זה מאפשר לסוכן יחיד לטפל במקרי שימוש מרובים. אין כרגע השפעה על מקרי שימוש קיימים של סוכנים או על כללי עסקים.
שדה זה הוא אופציונלי, אך מומלץ להגדיר אותו כעת כדי שלא תקבלו הודעת שגיאה כאשר השדה הופך לחובה.
כדי להגדיר את סוג תעבורת ההודעה, הקצה את סוג התעבורה המתאים messageTrafficType לכל הודעה בהתבסס על תוכנה. RCS for Business תומך בסוגי התעבורה הבאים.
| סוג התנועה | תוכן ההודעה | מקרה שימוש של סוכן |
|---|---|---|
AUTHENTICATION | עבור הודעות אימות. | OTP |
TRANSACTION | להודעות בנוגע לשירותים או מוצרים קיימים של משתמש. לדוגמה: אישורים, קבלות תשלום או פרטי הזמנה. | עסקאות או שימושים מרובים |
PROMOTION | עבור מסרים פרסומיים כמו מבצעים, הנחות, הכרזות או תוכן פרסומי אחר. | קידום מכירות או רב שימושי |
SERVICEREQUEST | עבור הודעות בנוגע לשירותים שהמשתמש ביקש במפורש. | OTP, עסקאות, קידום מכירות או שימוש מרובה |
ACKNOWLEDGEMENT | עבור הודעות המשמשות לאישור פעולה של משתמש - במיוחד בקשת ביטול רישום. זה מאשר שבקשת המשתמש התקבלה ונמצאת בעיבוד. | OTP, עסקאות, קידום מכירות או שימוש מרובה |
אם לא מוגדר סוג תעבורה, המערכת מקצה את סוג ברירת המחדל עבור מקרה השימוש של הסוכן .
| מקרה שימוש של סוכן | סוג תנועה ברירת מחדל |
|---|---|
| OTP | AUTHENTICATION |
| עסקאות | TRANSACTION |
| קידום מכירות | PROMOTION |
| רב-שימושי | MESSAGE_TRAFFIC_TYPE_UNSPECIFIED |
לסוכנים מרובי שימושים אין סוג תעבורה המוגדר כברירת מחדל. עליך להגדיר את סוג התעבורה במפורש עבור כל הודעה בהתבסס על תוכנה. אם לא תחליף את הערך MESSAGE_TRAFFIC_TYPE_UNSPECIFIED , תופיע שגיאה.
מגבלות גודל הודעה
הגודל המרבי של כל AgentMessage במחרוזת הוא 250 KB. לחלק הטקסט של ההודעה יש מגבלה משלו של 3072 תווים.
כדי למנוע צריכת נתונים בלתי צפויה עבור משתמשים, הגודל המרבי של קובץ שניתן לשלוח דרך RCS for Business הוא 100 מגה-בייט, והגודל הכולל המשולב של כל הקבצים המצורפים למדיה ו-PDF בהודעת RCS for Business אחת לא יעלה על 100 מגה-בייט. (1 מגה-בייט = 1,048,576 בתים). למידע נוסף, עיין בקבצי מדיה ו-PDF .
טֶקסט
ההודעות הפשוטות ביותר עשויות מטקסט. הודעות טקסט מתאימות ביותר להעברת מידע ללא צורך באמצעים חזותיים, אינטראקציה מורכבת או תגובה.
דוּגמָה
הקוד הבא שולח הודעת טקסט רגילה. לאפשרויות עיצוב וערך, ראה phones.agentMessages.create .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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", );
תוכן הודעה בסיסי - המרת SMS
ספקיות תקשורת הציגו מודלים של חיוב כדי לתמוך בהעברת הודעות SMS ל-RCS for Business. הודעת RCS for Business המכילה עד 160 תווים בפורמט UTF-8 נקראת הודעה בסיסית.
בעת בניית בקשה לשליחת הודעה בסיסית, זכרו שתווים נחשבים כ-1 בייט (UTF-8). אם אתם שולחים הודעה המכילה תווים מיוחדים כגון אמוג'י או קבוצת תווים מרובת בייט, כל תו נחשב כ-2-4 תווי UTF-8 או יותר.
הזן טקסט כלשהו בתיבה כדי לבדוק את אורכו:
תוכן הודעות טקסט ותצוגות מקדימות של קישורים
לקוחות RCS עשויים ליישם תצוגות מקדימות של קישורים. אם הודעת RCS for Business בפורמט טקסטואלי בלבד כוללת כתובת URL לאתר אינטרנט עם תגי openGraph , הלקוח יכול ליצור תצוגה מקדימה (תמונה, כותרת וכו'), מה שמספק חוויה עשירה יותר. לדוגמה, ראה הודעה בסיסית עם תצוגה מקדימה של כתובת URL .
שימו לב שייתכן שלקוח RCS יאפשר למשתמש להשבית תצוגות מקדימות של קישורים.
סיסמאות חד פעמיות לאימות משתמש
ניתן להשתמש ב-RCS for Business כדי לשלוח סיסמאות חד-פעמיות (OTP) לאימות משתמש אוטומטי באמצעות ממשק ה-API של SMS Retriever. אין ממשק API ייעודי לקריאת OTP המגיעים דרך RCS for Business.
איך זה עובד עבור אנדרואיד
עבור אפליקציות אנדרואיד שנרשמו ב- SMS Retriever API , ה-API מאזין להודעת RCS for Business בפורמט נכון. הודעה זו חייבת להכיל גם את ה-OTP וגם קוד גיבוב ייחודי שמזהה את האפליקציה שלך.
כאשר מתקבלת הודעת RCS for Business בפורמט הנכון, ממשק ה-API של SMS Retriever מעבד אותה בדיוק כמו קוד OTP של SMS. לאחר התאמת ה-hash לאפליקציה שלך, ה-OTP מחולק ומועבר לאפליקציה שלך לאימות משתמש אוטומטי.
- הודעת טקסט לדוגמה של RCS לעסקים לאימות משתמש:
Your code is <OTP><app hash>. - דוגמה:
Your code is 123456 M8tue43FGT.
למידע נוסף על SMS Retriever וממשקי API קשורים, עיין בתיעוד של SMS Retriever . לפרטים על אימות משתמשים אוטומטי באפליקציות הרשומות ב-SMS Retriever API, עיין בתרשים זרימה זה.
איך זה עובד עבור iOS
עבור iOS, טיפול ה-OTP המובנה של המערכת מזהה ומציע אוטומטית קוד OTP של RCS for Business למילוי אוטומטי, בדומה לקוד OTP של SMS. לא נדרשת שילוב API ספציפי כדי שאפליקציית iOS תקרא את ה-OTP.
קבצי מדיה ו-PDF
כשאתה שולח הודעה עם תמונה, וידאו, אודיו או קובץ PDF, הסוכן שלך חייב לספק כתובת URL נגישה לציבור עבור התוכן או להעלות את הקובץ ישירות.
הגודל המרבי של קובץ שניתן לשלוח הוא 100 מילי-בייט, והגודל הכולל המשולב של כל המדיה וקבצי ה-PDF המצורפים בהודעה אחת לא יעלה על 100 מילי-בייט.
דחיסת מדיה וטרנסקידוד
פלטפורמת RCS for Business מבצעת קידוד ודוחסת אוטומטית של קבצי מדיה (כגון תמונות וסרטונים) לפני שליחתם, כדי לוודא שהם נטענים במהירות ויפעלו היטב ברשתות ובמכשירים שונים.
דחיסה מבוססת על איכות מדיית הקלט ולא אך ורק על מגבלות גודל הקובץ. משמעות הדבר היא שניתן לדחוס קובץ גם אם גודלו נמוך בהרבה מהמגבלה המקסימלית של 100 מגה-בייט. תקני קידוד מחדש משתנים כל הזמן, כך שאין מגבלת גודל קובץ קבועה הקובעת מתי עקיפת קידוד מחדש מתבצעת. נסו פורמטים, ממדים וקצבי דחיסה שונים של מדיה כדי למצוא את האיזון האופטימלי עבור המטענים שלכם.
מפרט תמונה ממוזערת
עבור קבצי מדיה, ניתן גם לציין תמונה ממוזערת המאפשרת למשתמשים להציג תצוגה מקדימה של התוכן לפני לחיצה עליו. עבור קבצי שמע, ווידג'ט השמע המוגדר כברירת מחדל משמש כמציין מיקום.
- גודל הקובץ המרבי של תמונה ממוזערת הוא 100 קילו-בייט. לחוויית משתמש אופטימלית, אנו ממליצים על 50 קילו-בייט או פחות.
- יחס הגובה-רוחב של התמונה הממוזערת צריך להתאים ליחס הגובה-רוחב של הקובץ המקורי.
ניהול מטמון וכתובות URL
פלטפורמת RCS for Business שומרת קבצים במטמון למשך 60 יום, וה-API מחזיר מזהה קובץ שהסוכן שלך יכול לכלול בהודעות למשתמשים. לאחר 60 יום, RCS for Business מסיר קבצים מהמטמון.
בעת ציון קבצים לפי כתובת URL, מומלץ להגדיר contentMessage.forceRefresh ל- false . הגדרת contentMessage.forceRefresh ל- true מאלצת את RCS for Business לאחזר תוכן חדש מכתובת ה-URL שצוינה, גם אם תוכן כתובת ה-URL מאוחסן במטמון, מה שמאריך את זמני מסירת ההודעות עבור המשתמשים.
דוגמה לכתובת URL של קובץ
הקוד הבא שולח תמונה. לאפשרויות עיצוב וערך, ראה AgentContentMessage .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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");
לחלופין, ניתן להעלות מדיה לפני שליחתה בהודעה באמצעות files.create .
דוגמה להעלאת קובץ
הקוד הבא מעלה קובץ וידאו וקובץ תמונה ממוזערת, ולאחר מכן שולח את שני הקבצים בהודעה. לאפשרויות עיצוב וערך, ראו files.create ו- AgentContentMessage .
סִלְסוּל
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" } } }'
סוגי מדיה נתמכים
RCS לעסקים תומך בסוגי המדיה הבאים. עבור תמונות ממוזערות, נתמכים רק image/jpeg, image/jpg, image/gif ו-image/png.
| סוג מדיה | סוג המסמך | הַרחָבָה | עובד עם כרטיסים עשירים |
|---|---|---|---|
| אפליקציה/ogg | אודיו OGG | .ogx | לֹא |
| יישום/קובץ PDF | קובץ PDF | קובץ .pdf | כן (רק עבור גוגל מסרים בהודו) |
| אודיו/aac | אודיו AAC | .aac | לֹא |
| אודיו/mp3 | אודיו MP3 | .mp3 | לֹא |
| אודיו/mpeg | אודיו MPEG | .mpeg | לֹא |
| אודיו/mpg | אודיו MPG | .mp3 | לֹא |
| אודיו/mp4 | אודיו MP4 | .mp4 | לֹא |
| אודיו/mp4-latm | אודיו MP4-latm | .mp4 | לֹא |
| אודיו/3gpp | אודיו 3GPP | .3gp | לֹא |
| תמונה/jpeg | JPEG | .jpeg, .jpg | כֵּן |
| תמונה/GIF | GIF | .gif | כֵּן |
| תמונה/png | PNG | .png | כֵּן |
| וידאו/h263 | וידאו H263 | .h263 | כֵּן |
| וידאו/m4v | סרטון M4V | .m4v | כֵּן |
| וידאו/mp4 | וידאו MP4 | .mp4 | כֵּן |
| וידאו/mpeg4 | וידאו MPEG-4 | .mp4, .m4p | כֵּן |
| וידאו/mpeg | וידאו MPEG | .mpeg | כֵּן |
| וידאו/webm | סרטון WEBM | .webm | כֵּן |
הצעות
הסוכן שלך שולח הצעות (תשובות מוצעות ופעולות מוצעות) ברשימות שבבי הצעות או בכרטיסים עשירים .
תשובות מוצעות
הצעות לתשובות מנחות את המשתמשים בשיחות על ידי מתן תשובות שהסוכן שלך יודע כיצד להגיב אליהן.
כאשר משתמש מקיש על הצעה לתשובה, הסוכן שלך מקבל אירוע המכיל את טקסט התשובה ואת נתוני הפוסט-חוזר . המטען מכיל עד 2048 תווים.
דוּגמָה
הקוד הבא שולח טקסט עם שתי תשובות מוצעות. לאפשרויות עיצוב וערך, ראה SuggestedReply .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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 );
פעולות מוצעות
פעולות מוצעות מנחות משתמשים בשיחות על ידי מינוף הפונקציונליות המובנית של המכשירים שלהם. הסוכן שלך יכול להציע למשתמשים לחייג מספר, לפתוח מיקום על גבי מפה, לשתף מיקום, לפתוח כתובת URL או ליצור אירוע בלוח שנה.
עבור כל פעולה מוצעת, ניתן לספק כתובת URL חלופית (מקסימום 2048 תווים). כתובת URL זו תיפתח בחלון דפדפן חדש אם מכשיר המשתמש אינו תומך בפעולה המוצעת.
כאשר משתמש מקיש על פעולה מוצעת, הסוכן שלך מקבל אירוע המכיל את נתוני ה-postback של הפעולה .
לאפשרויות עיצוב וערך, ראה SuggestedAction .
תצוגת הצעות
ישנן שתי דרכים להציג הצעות:
- קבוע : פעולות או תשובות מוצעות המוצגות בתוך בועת ההודעה ונשארות קבועות לאורך כל השיחה.
- חולף : הצעות המוצגות מחוץ לבועת ההודעה ונעלמות כאשר השיחה נמשכת.
פורמטי הודעות נתמכים
- הצעות מתמשכות: עבודה עם הודעות טקסט עצמאיות וכרטיסים עשירים.
- הצעות זמניות: עבודה עם הודעות טקסט עצמאיות, הודעות מדיה וכרטיסים עשירים.
שלב הצעות
ניתן לשלב הצעות מתמשכות וחולפות באותה הודעה או כרטיס עשיר.
- הודעות טקסט: הצעות הן זמניות כברירת מחדל. כדי שהן יישארו בתוך הבועה, עליך להגדיר אותן כקבועות.
- כרטיסים עשירים: אלה תומכים בעד ארבע הצעות קבועות כברירת מחדל. לאחר מכן ניתן להוסיף הצעות חולפות כ"רשימת שבבים" מתחת לכרטיס.
מגבלות הצעות
הודעת טקסט אחת תומכת ב-11 הצעות לכל היותר בסך הכל. כל הצעה קבועה שתכלול נחשבת למגבלה כוללת זו. לדוגמה, אם תכלול 4 הצעות קבועות, תוכל להוסיף עד 7 הצעות חולפות.
| סוג הצעה | לְהַגבִּיל | היכן הם מופיעים |
|---|---|---|
| מַתְמִיד | עד 4 | בתוך בועת ההודעה |
| חוֹלֵף | עד 11 | מחוץ לבועה (כשבבים) |
מגבלת תווים
כל הצעה מכילה עד 25 תווים.
שקיפות כתובות URL בפעולות המוצעות
כדי לבנות אמון משתמשים, כתובת ה-URL הבסיסית מוצגת כשורת טקסט שנייה בתוך כפתור ההצעה עבור פעולות מוצעות מסוג "פתח כתובת URL". התנהגות עקבית זו חלה על הודעות טקסט עצמאיות, כרטיסי רישום עשירים וקרוסלות.
תמכתי בלקוחות עבור הצעות מתמשכות
- נתמך: הודעות גוגל (גרסה
20260225.00ואילך). - לא נתמך: גרסאות קודמות של Google Messages מ
20260225.00, iOS ו-Samsung Messages.
חייג מספר
פעולת החיוג מנחה את המשתמש לחייג למספר טלפון שצוין על ידי הסוכן שלך. מספרי טלפון יכולים לכלול רק ספרות ( 0-9 ), סימן פלוס ( + ), כוכבית ( * ) וסימן מספר ( # ). הפורמט הבינלאומי E.164 (לדוגמה, +14155555555 ) נתמך אך אינו נדרש. כלומר, גם +14155555555 וגם 1011 הם ערכים תקינים.
דוּגמָה
הקוד הבא שולח פעולת חיוג. לאפשרויות עיצוב וערך, ראה DialAction .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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 );
הצג מיקום
הפעולה "הצג מיקום" מציגה מיקום באפליקציית המפות המוגדרת כברירת מחדל של המשתמש. ניתן לציין את המיקום לפי קו רוחב ואורך או באמצעות שאילתה המבוססת על המיקום הנוכחי של המשתמש. ניתן גם להגדיר תווית מותאמת אישית עבור הנעץ המוצג באפליקציית המפות.
דוּגמָה
הקוד הבא שולח פעולת view location. לאפשרויות עיצוב וערך, ראה ViewLocationAction .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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 );
שיתוף מיקום
פעולת שיתוף מיקום מאפשרת למשתמש לשתף מיקום עם הסוכן שלך. המשתמש יכול לשתף את המיקום הנוכחי שלו או מיקום שנבחר ידנית מאפליקציית המפות.
דוּגמָה
הקוד הבא שולח פעולת שיתוף מיקום. לאפשרויות עיצוב וערך, ראה ShareLocationAction .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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
הפעולה פתיחת כתובת URL מאפשרת לך להנחות משתמשים לדף אינטרנט שצוין על ידי הסוכן שלך. כברירת מחדל, דף האינטרנט נפתח בדפדפן של המשתמש. ניתן גם להגדיר את דף האינטרנט להיפתח בתצוגת אינטרנט. ראה פתיחת כתובת URL עם תצוגת אינטרנט לפרטים.
רק ב-Google Messages
הצגת כתובת ה-URL הבסיסית : לשיפור השקיפות בהודעות A2P, Google Messages מציג את כתובת ה-URL הבסיסית בתוך הפעולות המוצעות של 'פתח כתובת URL'. שינוי זה משפיע על פעולות מוצעות בכרטיסי Rich Card סטנדרטיים ובקרוסלות של כרטיסי Rich Card .

תצוגת סמל אפליקציה עבור קישורי אינטרנט : אם למשתמש יש אפליקציה המוגדרת כברירת מחדל עבור דף האינטרנט, אפליקציה זו נפתחת במקום הדפדפן או תצוגת האינטרנט, וכפתור ההצעה מציג את סמל האפליקציה. כדי שסמל האפליקציה יופיע ב-Google Messages, עליך לספק את כתובת האתר המלאה והישירה. אם אתה משתמש בכתובת אתר מקוצרת, סמל פתיחת כתובת האתר המוגדר כברירת מחדל מוצג במקום זאת.

דוּגמָה
הקוד הבא שולח פעולת פתיחת URL. לאפשרויות עיצוב וערך, ראה OpenUrlAction .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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 עם תצוגת אינטרנט
הפעולה "פתח כתובת URL עם תצוגת אינטרנט" טוענת את דף האינטרנט שצוין בתוך אפליקציית המסרים באמצעות מנוע הרינדור של דפדפן ברירת המחדל שלך. פעולה זו מאפשרת למשתמש לקיים אינטראקציה עם דף האינטרנט מבלי לצאת משיחת RCS for Business. אם המכשיר של המשתמש אינו תומך בתצוגות אינטרנט, דף האינטרנט נפתח בדפדפן של המשתמש במקום זאת. כדי להפעיל תצוגות אינטרנט, ראה OpenURLApplication .
לתצוגות אינטרנט יש שלושה מצבי תצוגה. לאפשרויות עיצוב וערך, ראה WebviewViewMode .
- מלא: דף האינטרנט תופס את כל המסך
- חצי: דף האינטרנט תופס חצי מהמסך
- גבוה: דף האינטרנט תופס שלושה רבעים מהמסך
דוּגמָה
הקוד הבא שולח פעולת Open URL עם תצוגת אינטרנט. לאפשרויות עיצוב וערך, ראה OpenURLAction .
סִלְסוּל
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" } } } ] } }'
ג'אווה
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; }
צור אירוע בלוח שנה
הפעולה יצירת אירוע בלוח שנה פותחת את אפליקציית לוח השנה של המשתמש ומתחילה ליצור אירוע חדש עם המידע שצוין.
נדרשת כותרת לאירוע בלוח השנה. היא יכולה להכיל עד 100 תווים. תיאור אירוע לוח השנה הוא אופציונלי ומכיל עד 500 תווים.
דוּגמָה
הקוד הבא שולח פעולה של יצירת אירוע בלוח שנה. לאפשרויות עיצוב וערך, ראה CreateCalendarEventAction .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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 );
רשימת שבבי הצעות
הסוכן שלך שולח רשימות של שבבי הצעות עם הודעות שידריכו את פעולות המשתמשים לאחר מכן. רשימת השבבים מוצגת רק כאשר ההודעה המשויכת נמצאת בתחתית השיחה. כל הודעה נוספת בשיחה (ממשתמש או מהסוכן שלך) דורסת את רשימת השבבים.
הצ'יפים ברשימה הם תשובות מוצעות ופעולות מוצעות .
רשימות צ'יפים מכילות מקסימום 11 צ'יפים להצעות, וכל תווית צ'יפ יכולה להכיל מקסימום 25 תווים.
לאפשרויות עיצוב וערך, ראה AgentContentMessage .
כרטיסי ריץ'
כרטיסי Rich Card משלבים מדיה, טקסט והצעות אינטראקטיביות להודעה אחת. הם אידיאליים להצגת מידע קשור (לדוגמה, מוצר עם תמונה, שם ומחיר) והנחיית משתמשים בצעדים ברורים להמשך, כמו הצעה של "הצג פרטים".
כרטיס עשיר יכול להכיל את הדברים הבאים:
- מדיה (תמונה, GIF או וידאו)
- טקסט כותרת
- טקסט תיאור
- הצעות לתשובות והצעות לפעולות (מקסימום 4)
כל אחד מהשדות הללו הוא אופציונלי, אך לפחות אחד מהשדות 1-3 חייב להיכלל בכרטיס העשיר.
ניתן לשלוח מספר כרטיסים יחד בקרוסלה גוללת אופקית.
שים לב שכמות המטען הכוללת עבור כרטיס עשיר היא 250 KB.
לפרטים טכניים מלאים, עיין בתיעוד של Rich Cards .
גובה הכרטיס
כרטיסי ריקים (Rich Cards) מתרחבים אנכית כדי להתאים לתוכנם. גובהם המינימלי הוא 112 DP וגובהם המרבי הוא 344 DP. אם תוכן הכרטיס אינו גדול מספיק כדי למלא את גובה הכרטיס המינימלי, הכרטיס מתרחב וממלא את הגובה הנוסף ברווחים לבנים.
מדיה בכרטיסי Rich חייבת להתאים לאחד משלושה גבהים:
- קצר: 112 DP
- בינוני: 168 DP
- גובה: 264 DP
אם המדיה אינה מתאימה למידות בתוך הכרטיס כפי שצוין בגובה שנבחר, התצוגה המקדימה של המדיה נבחרת על ידי הגדלה וחיתוך של המדיה.
דוּגמָה
הקוד הבא שולח כרטיס עשיר (rich card) עם תמונה והצעות לתשובות. לאפשרויות עיצוב וערך, ראה RichCard .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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");
קרוסלות של כרטיסי ריץ'
קרוסלות מחברות מספר כרטיסי רישום עשירים , ומאפשרות למשתמשים להשוות פריטים ולהגיב לכל אחד בנפרד.
קרוסלות יכולות להכיל מינימום של שניים ומקסימום של עשרה כרטיסי Rich. כרטיסי Rich בתוך קרוסלות חייבים לעמוד בדרישות הכלליות של כרטיסי Rich לתוכן וגובה, כמתואר בתיעוד של כרטיסי Rich . למידע נוסף על פריסת הקרוסלה ומפרטיה, עיין בתיעוד הקרוסלה .
דוּגמָה
הקוד הבא שולח קרוסלה של כרטיסי Rich. לאפשרויות עיצוב וערך, ראה RichCard .
סִלְסוּל
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); });
ג'אווה
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(); }
פִּיתוֹן
# 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);