require "dotenv/load"
require "rcs"
client = Pinnacle::Client.new(api_key: ENV["PINNACLE_API_KEY"])
# Send a rich text message with quick reply button
text_message_res = client.messages.rcs.send_(
text: "Want to build on Pinnacle? Check out our docs below.",
quick_replies: [
{
type: "openUrl",
payload: "https://docs.pinnacle.sh",
title: "See our docs"
}
],
options: { validate: true },
from: ENV["AGENT_ID"],
to: "+18708977103"
)
puts "Text message response:"
puts text_message_res
# Send a rich card message with media and buttons
card_message_res = client.messages.rcs.send_(
cards: [
{
media: "https://server.trypinnacle.app/storage/v1/object/sign/vault/142/bea70540-0596-4f9e-af6a-5b6ad7fa6c00/Golden_Hour_Over_Rural_Landscape_1.png?token=eyJraWQiOiJzdG9yYWdlLXVybC1zaWduaW5nLWtleV9hOGI0YTI0NC00NzY4LTRhOTktYWI4MS1iNmZhNTZhNGQyZWYiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJ2YXVsdC8xNDIvYmVhNzA1NDAtMDU5Ni00ZjllLWFmNmEtNWI2YWQ3ZmE2YzAwL0dvbGRlbl9Ib3VyX092ZXJfUnVyYWxfTGFuZHNjYXBlXzEucG5nIiwiaWF0IjoxNzYwOTAyMjQ0LCJleHAiOjMxNzEyMDkwMjI0NH0.l0CNvb4Z-tXXEwnGA6vNWnRb4XYxvWVUUSziuqq2TLA",
title: "Did you know you can send an RCS message in less than 5 minutes?",
subtitle: "Learn how by tapping an option below",
buttons: [
{
type: "openUrl",
payload: "https://docs.pinnacle.sh/quickstart/rcs",
title: "RCS Quickstart Guide"
},
{
type: "openUrl",
payload: "https://docs.pinnacle.sh/api-reference/messages/send-rcs",
title: "RCS API Reference"
}
]
}
],
quick_replies: [],
options: { validate: true },
from: ENV["AGENT_ID"],
to: "+18708977103"
)
puts "\nCard message response:"
puts card_message_res