Send RCS Card Message
Send a rich card message (title, description, image, optional buttons) to a recipient via the Sinch Conversation API. Best supported on RCS; other channels may receive a transcoded version.
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--to / -t: Recipient phone number (E.164) - required
--title / -T: Card title - required
--description / -d: Card description text - optional
--image-url / -i: URL of card image - optional
--choices / -C: Comma-separated button labels (e.g., "Learn More,Contact Us") - optional
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask for recipient, title, description, image URL, and optional choices. Otherwise parse arguments.
Validate: --to (E.164), --title (non-empty). Optional: description, image-url (HTTPS), choices (comma-separated strings).
Try MCP tool for sending card/rich message if available (e.g. send-card or equivalent). On success display result and exit.
If MCP not available: get CONVERSATION_* env vars. If missing, report "Sinch API is not configured."
Build message.card_message: title, description (if provided), media_message with url (if image-url), choices array from --choices (each: text_message.text, postback_data). Recipient via channel_identities (channel RCS or as specified).
POST https://{region}.conversation.api.sinch.com/v1/projects/{projectId}/messages:send with OAuth2, body: app_id, recipient, message.
On success: "✅ Card message sent!" with message ID. Handle errors with clear messages.
Handle all errors gracefully.
Examples
/sinch-api-messages-send-card --to=+14155551234 --title="Welcome" --description="Thanks for signing up" --image-url=https://example.com/promo.jpg
/sinch-api-messages-send-card -t +14155551234 -T "Sale" -d "50% off" -C "Shop Now,Details"
API Reference
Notes
- RCS channel recommended for full card display. SMS/other channels may get text fallback.
- Choices become clickable buttons; postback_data can be derived from label (e.g. slug).
1---2name: sinch-api-messages-send-card3description: Send an RCS rich card message via Sinch Conversation API4---56# Send RCS Card Message78Send a rich card message (title, description, image, optional buttons) to a recipient via the Sinch Conversation API. Best supported on RCS; other channels may receive a transcoded version.910**IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.**1112## Input1314- `--to` / `-t`: Recipient phone number (E.164) - required15- `--title` / `-T`: Card title - required16- `--description` / `-d`: Card description text - optional17- `--image-url` / `-i`: URL of card image - optional18- `--choices` / `-C`: Comma-separated button labels (e.g., "Learn More,Contact Us") - optional1920Arguments: $ARGUMENTS2122## Instructions2324**Execute these steps directly - do not write code or scripts:**25260. If $ARGUMENTS empty: ask for recipient, title, description, image URL, and optional choices. Otherwise parse arguments.27281. Validate: --to (E.164), --title (non-empty). Optional: description, image-url (HTTPS), choices (comma-separated strings).29302. Try MCP tool for sending card/rich message if available (e.g. send-card or equivalent). On success display result and exit.31323. If MCP not available: get CONVERSATION_* env vars. If missing, report "Sinch API is not configured."33344. Build message.card_message: title, description (if provided), media_message with url (if image-url), choices array from --choices (each: text_message.text, postback_data). Recipient via channel_identities (channel RCS or as specified).35365. POST https://{region}.conversation.api.sinch.com/v1/projects/{projectId}/messages:send with OAuth2, body: app_id, recipient, message.37386. On success: "✅ Card message sent!" with message ID. Handle errors with clear messages.39407. Handle all errors gracefully.4142## Examples4344```45/sinch-api-messages-send-card --to=+14155551234 --title="Welcome" --description="Thanks for signing up" --image-url=https://example.com/promo.jpg46/sinch-api-messages-send-card -t +14155551234 -T "Sale" -d "50% off" -C "Shop Now,Details"47```4849## API Reference5051- **API Endpoint**: POST /v1/projects/{projectId}/messages:send52- **Message type**: card_message (title, description, media_message, choices)53- **Documentation**: https://developers.sinch.com/docs/conversation/message-types5455## Notes5657- RCS channel recommended for full card display. SMS/other channels may get text fallback.58- Choices become clickable buttons; postback_data can be derived from label (e.g. slug).