Skip to main content
Scheduler API
Karan avatar
Written by Karan
Updated over a week ago

Overview:

The Schedule Message function allows authenticated users within your organization to schedule messages. This API checks the user's organization membership, ensures that all required message details are provided, and handles permission issues before scheduling a message.

Note: Please use this API responsibly. Avoid using it for spam or bulk messaging, as it could result in your number being banned.


API Usage:

Endpoint:

POST /schedule-message

Payload Structure:

Field

Description

from

Sender’s email address (user must be part of the organization).

to

Receiver's phone number (in international format).

message

The text content of the message to be sent.

name

The receiver’s name (for notification purposes).

time

Scheduled time to send the message.

Example Payload:

{ 
"from": "[email protected]",
"to": "919876543210",
"message": "Hello World",
"name": "Vats",
"time": "2024-03-01T17:25:00.000Z"
}

Sample Request Code (Node.js with Axios):

const axios = require('axios');
let data = JSON.stringify({
"from": "[email protected]",
"to": "919876543210",
"message": "Hello World",
"name": "Vats",
"time": "2024-03-01T17:25:00.000Z"
});

let config = {
method: 'post',
maxBodyLength: Infinity,
url: '',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
data : data
};

axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Response:

Status

Description

Success

Indicates the message has been successfully scheduled.

Failure

Possible errors include invalid email, missing fields, or permission issues.


Best Practices:

  • Ensure that the from email is a valid email address that belongs to the organization.

  • Avoid using this API for mass messaging or spam to prevent your number from being banned.


We hope this article has helped you better understand how EazyBe works! If you have any questions or need further assistance, feel free to reach out to us at [email protected]. We're happy to help!


Did this answer your question?