HTTP API
1. Authentication Endpoint
This endpoint allows you to obtain an authentication token. The authentication token is essential for using the Notifly server API. The issued authentication token has a validity period of 1 hour. It is recommended to obtain a token with each API call as often as possible.
Endpoint
POST https://api.notifly.tech/authenticate
Specifications
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
accessKey | String | Yes | Can be found on Notifly's settings page. Each project has one Access Key. For inquiries, please email contact@notifly.tech. |
secretKey | String | Yes | Can be found on Notifly's settings page. Each project has one Secret Key. For inquiries, please email contact@notifly.tech. |
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Response (Example)
Parameter | Value |
---|---|
Status code | 200 OK |
Content-Type | application/json |
json | {"data":"some-token","error":null} |
Example code
// Endpoint
const url = "https://api.notifly.tech/authenticate";
// Headers
const headers = {
"Content-Type": "application/json",
};
// Body
const body = {
accessKey: "your-access_key",
secretKey: "your-secret-key",
};
const encodedBody = JSON.stringify(body);
// Fetch call
fetch(url, {
method: "POST",
headers: headers,
body: encodedBody,
})
.then((response) => response.json())
.then((data) => {
// Get response data
console.log(data);
})
.catch((err) => {
console.log(err);
});
/**
* Response data example
{
data: 'some-token',
error: null
}
**/
2. Track Event Endpoint
This endpoint allows you to send event data to the Notifly engine. The Notifly engine collects and analyzes the received event data, preparing it for use in setting message delivery timing, user segments, etc., during campaign execution.
Endpoint
POST https://api.notifly.tech/track-event
Specifications
Parameter | Type | Required | Description |
---|---|---|---|
projectID | String | Yes | The project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech. |
eventName | String | Yes | The name of the event. |
isGlobalEvent | Boolean | Yes | Whether the event occurs at the service level rather than being specific to a user. |
eventParams | Object | No | The event parameters. |
segmentationEventParamKeys | List | No | Notifly engine specially processes certain parameters for sophisticated campaign execution. For inquiries, please email contact@notifly.tech. |
userID | String | No | The user ID. |
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response (Example)
Parameter | Value |
---|---|
Status code | 200 OK |
Content-Type | application/json |
json | {"data":"some-success-response-from-notifly-engine","error":null} |
Example Code
Node.js
// Endpoint
const url = "https://api.notifly.tech/track-event";
// Headers
const headers = {
"Content-Type": "application/json",
Authorization: "some-token", // retrieve this from authorization endpoint
};
// Body
const body = {
projectID: "provided_project_id",
eventName: "show_end",
isGlobalEvent: true, // true if the event is not associated with a specific user
eventParams: {},
segmentationEventParamKeys: [],
userID: null, // null if global event but should be specified otherwise
};
const encodedBody = JSON.stringify(body);
// Fetch call
fetch(url, {
method: "POST",
headers: headers,
body: encodedBody,
})
.then((response) => response.json())
.then((data) => {
// Get response data
console.log(data);
})
.catch((err) => {
console.log(err);
});
/**
* Response data example
{
data: 'some-success-response-from-notifly-engine',
error: null
}
**/
3. Set User Properties Endpoint
This endpoint allows you to register user properties with the Notifly engine. The registered property values can be used to set user segments during campaign execution, enabling more efficient marketing.
Endpoint
POST https://api.notifly.tech/set-user-properties
Specifications
Parameter | Type | Required | Description |
---|---|---|---|
projectID | String | Yes | The project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech. |
userProperties | Object | Yes | The user property values to update. |
userID | String | Yes | The user ID. |
- It is also possible to update the information of multiple users at once. You can call the same format of Objects in an Array form.
- A maximum of 1,000 users can be updated per call.
- Important: Email and phone number information must be defined in the userProperties Object with the key values $email and $phone_number, respectively, to be utilized during campaign delivery! Please refer to the example code.
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response (Example)
Parameter | Value |
---|---|
Status code | 200 OK |
Content-Type | application/json |
json | {"data":"updated row count","error":null} |
Example Code
Node.js
// Endpoint
const url = "https://api.notifly.tech/set-user-properties";
// Headers
const headers = {
"Content-Type": "application/json",
Authorization: "some-token", // retrieve this from authorization endpoint
};
// Body (Single User)
const body = {
projectID: "provided_project_id",
userProperties: {
$email: "email@example.com",
$phone_number: "010-7777-7777",
// ... more properties
},
userID: "some-user-id",
};
const encodedBody = JSON.stringify(body);
// Body (Multple Users)
const user1 = {
projectID: "provided_project_id",
userProperties: {
$email: "user1@example.com",
$phone_number: "010-5555-5555",
// ... more properties
},
userID: "some-user-id-1",
};
const user2 = {
projectID: "provided_project_id",
userProperties: {
$email: "user2@example.com",
$phone_number: "010-7777-7777",
// ... more properties
},
userID: "some-user-id-2",
};
const encodedBody = JSON.stringify([user1, user2]);
// Fetch call
fetch(url, {
method: "POST",
headers: headers,
body: encodedBody,
})
.then((response) => response.json())
.then((data) => {
// Get response data
console.log(data);
})
.catch((err) => {
console.log(err);
});
/**
* Response data example
{
data: 2,
error: null
}
**/
4. Delete Users Endpoint
This endpoint allows you to delete users registered in Notifly.
Endpoint
DELETE https://api.notifly.tech/users
Specifications
Parameter | Type | Required | Description |
---|---|---|---|
projectID | String | Yes | The project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech. |
userID | String | No | The ID of the user to be deleted. |
userProperties | Object | No | The properties of the user to be deleted. |
String | No | The email address of the user to be deleted. | |
- $phone_number | String | No | The phone number of the user to be deleted. |
- It is also possible to delete the information of multiple users at once. You can call the same format of Objects in an Array form.
- A maximum of 1,000 users can be deleted per call.
- Users can be deleted based on user ID, email, and phone number.
- The phone number must match exactly. (010-1234-1234 != 01012341234)
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response (Example)
Parameter | Value |
---|---|
Status code | 200 OK |
Content-Type | application/json |
json | {"data":"deleted row count","error":null} |
Example Code
Node.js
// Endpoint
const url = "https://api.notifly.tech/users";
// Headers
const headers = {
"Content-Type": "application/json",
Authorization: "some-token", // retrieve this from authorization endpoint
};
// Body (Single User)
const body = {
projectID: "provided_project_id",
userID: "some-user-id",
// if you want to delete by email or phone number.
// userProperties: {
// $email: "email@example.com",
// $phone_number: "010-7777-7777",
// },
};
const encodedBody = JSON.stringify(body);
// Body (Multple Users)
const user1 = {
projectID: "provided_project_id",
userID: "some-user-id-1",
};
const user2 = {
projectID: "provided_project_id",
userID: "some-user-id-2",
};
const encodedBody = JSON.stringify([user1, user2]);
// Fetch call
fetch(url, {
method: "DELETE",
headers: headers,
body: encodedBody,
})
.then((response) => response.json())
.then((data) => {
// Get response data
console.log(data);
})
.catch((err) => {
console.log(err);
});
/**
* Response data example
{
data: 2,
error: null
}
**/
5. Campaign Triggering Endpoint
This endpoint allows you to trigger campaigns. You can personalize messages using not only registered user and device attributes but also parameters from the API Request Body.
Caution
- For campaign dispatch via HTTP API, the campaign must be set to API-based dispatch.
Endpoint
POST https://api.notifly.tech/campaign/{projectId}/{campaignId}/send
Specifications
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
projectId | String | Yes | Can be found on Notifly's settings page. |
campaignId | String | Yes | Can be found by clicking on a campaign in the campaign list to view the details in the popup at the top. |
Request
Parameter | Type | Required | Description |
---|---|---|---|
recipients | List | Yes | Information about the message recipients. |
- type | String | No | Type of recipient (default: user-id ). Currently supports user-id phone-number , and email . |
- userId | String | No | ID of the user to whom the message will be sent. Required if type is user-id . |
- phoneNumber | String | No | Phone number of the user to whom the message will be sent. Required if type is phone-number . |
String | No | Email address of the user to whom the message will be sent. Required if type is email . | |
- eventParams | Object | No | An object containing event parameters to personalize the message. |
The supported recipient types may vary depending on the campaign's dispatch channel. If the campaign uses a recipient type that is not supported by the dispatch channel, a 400 Bad Request will be returned in the API response.
- Push Notifications: Only
user-id
type recipients are supported. - Web Push Notifications: Only
user-id
type recipients are supported. - Kakao Alimtalk: Supports both
user-id
andphone-number
type recipients. - SMS: Supports both
user-id
andphone-number
type recipients. - Email: Supports both
user-id
andemail
type recipients.
When the recipient type is not user-id
, the Notifly server attempts to send the message based solely on the information specified in the request payload without fetching user data from the user database. Therefore, user-based message personalization is not available when the recipient type is not user-id
. For example, if the campaign message contains Hello {{ user["name"] }}
, the personalization will fail, and the message Hello
will be sent.
Event parameters are available for all recipient types. For more detailed examples of API-based dispatch campaigns, please refer to this section.
API-based dispatch checks for duplicate recipients to prevent duplicate messages from being sent. If the same recipient is included multiple times, the message will be sent only once. The following are the deduplication rules per channel:
- Push Notifications: If it's the same device token, the message will be sent to only one device token.
- Web Push Notifications: If it's the same device token, the message will be sent to only one device token.
- Kakao Alimtalk: If it's the same phone number, the message will be sent to only one phone number.
- SMS: If it's the same phone number, the message will be sent to only one phone number.
- Email: If it's the same email address, the message will be sent to only one email address.
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response
Status Code | Content-Type | Description | Example Response |
---|---|---|---|
200 OK | application/json | The campaign was triggered successfully. | {"code": 200, "success":true,"error":null} |
400 Bad Request | application/json | The request is incorrect. | {"code": 400, "success":false,"error":"Bad request: some-error-message"} |
401 Unauthorized | application/json | The token has expired, or the authentication information is invalid. | {"code": 401, "success":false,"error":"Unauthorized: Invalid token"} |
405 Method Not Allowed | application/json | Unsupported HTTP Method. | {"code": 405, "success":false,"error":"Method not allowed: some-error-message"} |
413 Payload Too Large | application/json | The request payload is too large. | {"code": 413, "success":false,"error":"Payload too large: some-error-message"} |
500 Internal Server Error | application/json | Notifly server error. If 500 errors persist, please contact the Notifly team. | {"code": 500, "success":false,"error":"some-error-message"} |
501 Not Implemented | application/json | The feature is not yet supported. | {"code": 501, "success":false,"error":"Not implemented: some-error-message"} |
Example Code
Node.js
async function triggerCampaign(projectId, campaignId) {
// Retrieve authToken from authorization endpoint
const authResponse = await fetch("https://api.notifly.tech/authenticate", {
method: "POST",
body: JSON.stringify({
accessKey: "your-access-key",
secretKey: "your-secret-key",
}),
});
const { data: authToken } = await authResponse.json();
// Endpoint
const url = `https://api.notifly.tech/campaign/${projectId}/${campaignId}/send`;
// Request header
const headers = {
"Content-Type": "application/json",
Authorization: authToken,
};
// Request body
const body = {
recipients: [
{
userId: "alice",
eventParams: {
messageTitle: "Hello Alice!",
messageBody: "How are you?",
// ... more event params
},
},
{
userId: "bob",
eventParams: {
messageTitle: "Hello Bob!",
messageBody: "How are you?",
// ... more event params
},
},
// ... more recipients
],
};
const response = await fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
});
const result = await response.json();
if (!result.success) {
console.error(result);
} else {
console.log("Campaign triggered successfully");
}
}
6. Send Text Message Endpoint
This endpoint allows you to send text messages (SMS, LMS, MMS).
Caution
- Text message dispatch via HTTP REST API is only possible when Notifly text message self-dispatch settings are configured.
- The sender number used will be the one entered in the self-dispatch settings.
- Statistics on the dispatch results via API are not yet provided in the UI. If you need information, please email contact@notifly.tech.
Endpoint
POST https://api.notifly.tech/messages/text-message
Specifications
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectId | String | Yes | Can be found on Notifly's settings page. |
type | String | Yes | Message type (sms or mms ). |
title | String | No | The title of the message body (used only for mms). |
body | String | Yes | The content of the message body. |
recipientList | List | Yes | List of recipients (up to 1000). |
- recipientNo | String | Yes | Recipient number. |
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response
Status Code | Content-Type | Example Response |
---|---|---|
200 OK | application/json | {"success":true} |
400 Bad Request | application/json | {"error":"some-error-message"} |
405 Method Not Allowed | application/json | {"error":"Method not allowed"} |
413 Payload Too Large | application/json | {"error":"Payload Too Large"} |
500 Internal Server Error | application/json | {"error":"Internal Server Error"} |
Example Code
Node.js
// Retrieve authToken from authorization endpoint
const authResponse = await fetch("https://api.notifly.tech/authenticate", {
method: "POST",
body: JSON.stringify({
accessKey: "your-access-key",
secretKey: "your-secret-key",
}),
});
const { data: authToken } = await authResponse.json();
// Endpoint
const url = `https://api.notifly.tech/messages/text-message`;
// Request header
const headers = {
"Content-Type": "application/json",
Authorization: authToken, // retrieve this authToken from authorization endpoint
};
// Request body
const body = {
projectId: projectId,
type: "sms",
body: "Message Body",
recipientList: [
{
recipientNo: "01012345678",
},
{
recipientNo: "01045671234",
},
// ... more recipients
],
};
const response = await fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
});
const result = await response.json();
if (!result.success) {
console.error(result);
} else {
console.log("SMS Message sent successfully");
}
7. Send Kakao Alimtalk Message Endpoint
This endpoint allows you to send Kakao Alimtalk messages. Messages are sent using the Alimtalk template code and a list of recipients.
Caution
- Kakao Alimtalk dispatch via HTTP REST API is only possible when Notifly KakaoTalk self-dispatch settings are configured.
- Statistics on the dispatch results via API are not yet provided in the UI. If you need information, please email contact@notifly.tech.
Endpoint
POST https://api.notifly.tech/messages/kakao-alimtalk
Specifications
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectId | String | Yes | Can be found on Notifly's settings page. |
templateId | String | Yes | The registered dispatch template ID (can be found in the Alimtalk Template List) |
recipientList | List | Yes | List of recipients (up to 1000). |
- recipientNo | String | Yes | Recipient number. |
- templateParameter | Object | No | Template parameters, required if there are variables to replace. |
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response
Status Code | Content-Type | Example Response |
---|---|---|
200 OK | application/json | {"success":true} |
400 Bad Request | application/json | {"error":"some-error-message"} |
405 Method Not Allowed | application/json | {"error":"Method not allowed"} |
413 Payload Too Large | application/json | {"error":"Payload Too Large"} |
500 Internal Server Error | application/json | {"error":"Internal Server Error"} |
Example Code
Node.js
// Retrieve authToken from authorization endpoint
const authResponse = await fetch("https://api.notifly.tech/authenticate", {
method: "POST",
body: JSON.stringify({
accessKey: "your-access-key",
secretKey: "your-secret-key",
}),
});
const { data: authToken } = await authResponse.json();
// Endpoint
const url = `https://api.notifly.tech/messages/kakao-alimtalk`;
// Request header
const headers = {
"Content-Type": "application/json",
Authorization: authToken, // retrieve this authToken from authorization endpoint
};
// Request body
const body = {
projectId: projectId,
templateId: templateId,
recipientList: [
{
recipientNo: "01012345678",
templateParameter: {
user_name: "Notifly User",
},
},
{
recipientNo: "01056781234",
templateParameter: {
user_name: "Notifly Customer",
},
},
],
};
const response = await fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
});
const result = await response.json();
if (!result.success) {
console.error(result);
} else {
console.log("Kakao Alimtalk Message sent successfully");
}
8. Send Kakao Friendtalk Message Endpoint
This endpoint allows you to send Kakao Friendtalk messages. Friendtalk messages are sent by setting the recipient list, advertisement flag, and message type.
Caution
- Kakao Friendtalk dispatch via HTTP REST API is only possible when Notifly KakaoTalk self-dispatch settings are configured.
- Statistics on the dispatch results via API are not yet provided in the UI. If you need information, please email contact@notifly.tech.
Endpoint
POST https://api.notifly.tech/messages/kakao-friendtalk
Specifications
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectId | String | Yes | Can be found on Notifly's settings page. |
messageType | String | Yes | Message type. (Currently only text type is supported.) |
isAd | Boolean | No | Advertisement flag. |
recipientList | List | Yes | List of recipients (up to 1000). |
- recipientNo | String | Yes | Recipient number. |
- content.text | String | Yes | Body content. |
Headers
Parameter | Value | Description |
---|---|---|
Content-Type | application/json | MIME Type of the request body |
Authorization | some-token | The authentication token obtained through the Authorization endpoint |
Response
Status Code | Content-Type | Example Response |
---|---|---|
200 OK | application/json | {"success":true} |
400 Bad Request | application/json | {"error":"some-error-message"} |
405 Method Not Allowed | application/json | {"error":"Method not allowed"} |
413 Payload Too Large | application/json | {"error":"Payload Too Large"} |
500 Internal Server Error | application/json | {"error":"Internal Server Error"} |
Code Example
Node.js
// Example usage of sendFriendtalk function
// Retrieve authToken from authorization endpoint
const authResponse = await fetch("https://api.notifly.tech/authenticate", {
method: "POST",
body: JSON.stringify({
accessKey: "your-access-key",
secretKey: "your-secret-key",
}),
});
const { data: authToken } = await authResponse.json();
// Endpoint
const url = `https://api.notifly.tech/messages/kakao-friendtalk`;
// Request header
const headers = {
"Content-Type": "application/json",
Authorization: authToken, // retrieve this authToken from authorization endpoint
};
// Request body
const body = {
projectId: projectId,
messageType: "text",
isAd: false,
recipientList: [
{
recipientNo: "01012345678",
content: {
text: "test",
},
},
],
};
const response = await fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
});
const result = await response.json();
if (!result.success) {
console.error(result);
} else {
console.log("Kakao Friendtalk Message sent successfully");
}