Skip to main content

MessagingSendResult

Properties

code
stringrequired

Numeric error or success code.

message
stringrequired

Error or success message.

messageId
stringrequired

The unique identifier of the message.

Example

Sending an SMS and handling the result:

import { SignalWire } from "@signalwire/realtime-api";

const client = await SignalWire({ project: "your-project-id", token: "your-api-token" });

const result = await client.messaging.send({
from: "+1xxxxxxxxxx",
to: "+1yyyyyyyyyy",
body: "Hello from SignalWire!"
});

console.log("Message ID:", result.messageId);
console.log("Code:", result.code);
console.log("Message:", result.message);

Sending an MMS with media:

const result = await client.messaging.send({
from: "+1xxxxxxxxxx",
to: "+1yyyyyyyyyy",
body: "Check out this image!",
media: ["https://example.com/image.jpg"]
});

console.log("MMS sent with ID:", result.messageId);