Quick Start Guide

Send your first message and create your first workflow

Prerequisites

Before you begin, you need to complete the Brand Setup & Configuration process. This includes:

  • Registering your brand
  • Adding your personal phone number as a test number
  • Retrieving your API key

Important: Make sure to add your personal phone number as a test number during brand setup. This allows you to test messages and workflows without affecting real customers.

Step 1: Send Your First Message

Let’s start by sending a simple message to your personal number using our TypeScript SDK.

Install the SDK

$npm install smobi

Send a Message

Create a new file called send-first-message.ts:

1import { SmobiClient } from "smobi";
2
3async function sendFirstMessage() {
4 // Initialize the client with your API key
5 const client = new SmobiClient({
6 apiKey: "your-api-key-here", // Replace with your actual API key
7 });
8
9 try {
10 // Send a simple text message
11 const result = await client.messages.send({
12 clientRef: "first-message-test",
13 recipientPhoneNumber: "your-phone-number", // Replace with your number
14 content: {
15 rcs: {
16 content: {
17 type: "TEXT",
18 content: "Hello from Smobi! This is your first RCS message.",
19 globalSuggestions: [
20 {
21 id: "reply-1",
22 text: "Hello!",
23 type: "REPLY"
24 }
25 ]
26 }
27 },
28 sms: {
29 content: "Hello from Smobi! This is your first SMS message."
30 }
31 }
32 });
33
34 console.log("Message sent successfully!");
35 console.log("Message ID:", result.smobiMessageId);
36 console.log("Status:", result.status);
37 } catch (error) {
38 console.error("Error sending message:", error);
39 }
40}
41
42sendFirstMessage();

What Happens

  1. The message is sent to your phone number
  2. If your phone supports RCS, you’ll receive the rich message with an interactive button
  3. If RCS isn’t available, you’ll receive the SMS fallback
  4. Status webhooks are sent to your webhook URL (you can configure this in the webhook settings)
  5. You can check the message status using the returned smobiMessageId

Responding to the Message

  1. Respond to the message with a button click or text reply
  2. An inbound webhook is sent to your webhook URL (you can configure this in the webhook settings)

Step 2: Create Your First Workflow

Now let’s create a simple welcome workflow that sends a series of messages to your test number.

Access the Workflow Builder

  1. Log into your Smobi dashboard
  2. Navigate to the Flows section in the sidebar
  3. Click Create New Workflow

Build a Simple Welcome Flow

The trigger node is always included and represents the start of the workflow.

  1. Add a Message Node:
    • Drag a “Send Message” node from the left panel
    • Connect it to the trigger node
    • Configure the message content (similar to what we sent in Step 1)
  2. Add a Delay Node:
    • Add a delay of 30 seconds
    • Connect it after the message node
  3. Add Another Message Node:
    • Add a follow-up message
    • Connect it after the delay

Publish Your Workflow

  1. Click Save to save your workflow
  2. Click Publish to make it active
  3. Your workflow is now ready to be executed via the UI (Test button) or via API

Test Your Workflow

  1. Click the Test button in the workflow builder
  2. Enter your personal phone number
  3. Click Execute to run the workflow
  4. Watch as the messages are sent to your phone with the specified delays

Step 3: Execute Your Workflow via API

Now let’s trigger your workflow programmatically:

1import { SmobiClient } from "smobi";
2
3async function executeWorkflow() {
4 const client = new SmobiClient({
5 apiKey: "your-api-key-here",
6 });
7
8 try {
9 const result = await client.workflows.executeWorkflowSingle(
10 "your-workflow-id", // Replace with your actual workflow ID
11 "your-phone-number" // Replace with your number
12 );
13
14 console.log("Workflow executed successfully!");
15 console.log("Execution ID:", result.workflowExecutionId);
16 console.log("Success:", result.success);
17 } catch (error) {
18 console.error("Error executing workflow:", error);
19 }
20}
21
22executeWorkflow();

What You’ve Accomplished

Sent your first RCS/SMS message
Created an automated workflow
Tested workflow execution
Triggered workflows via API

Next Steps

Now that you’ve experienced the basics, explore these areas:

Need Help?

If you encounter any issues during setup, check our Troubleshooting guide or contact our support team.