Skip to main content

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

ParameterTypeRequiredDescription
accessKeyStringYesCan be found on Notifly's settings page. Each project has one Access Key. For inquiries, please email contact@notifly.tech.
secretKeyStringYesCan be found on Notifly's settings page. Each project has one Secret Key. For inquiries, please email contact@notifly.tech.

Headers

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body

Response (Example)

ParameterValue
Status code200 OK
Content-Typeapplication/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

ParameterTypeRequiredDescription
projectIDStringYesThe project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech.
eventNameStringYesThe name of the event.
isGlobalEventBooleanYesWhether the event occurs at the service level rather than being specific to a user.
eventParamsObjectNoThe event parameters.
segmentationEventParamKeysListNoNotifly engine specially processes certain parameters for sophisticated campaign execution. For inquiries, please email contact@notifly.tech.
userIDStringNoThe user ID.

Headers

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response (Example)

ParameterValue
Status code200 OK
Content-Typeapplication/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

ParameterTypeRequiredDescription
projectIDStringYesThe project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech.
userPropertiesObjectYesThe user property values to update.
userIDStringYesThe 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

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response (Example)

ParameterValue
Status code200 OK
Content-Typeapplication/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

ParameterTypeRequiredDescription
projectIDStringYesThe project ID provided by the Notifly team. For inquiries, please email contact@notifly.tech.
userIDStringNoThe ID of the user to be deleted.
userPropertiesObjectNoThe properties of the user to be deleted.
- $emailStringNoThe email address of the user to be deleted.
- $phone_numberStringNoThe 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

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response (Example)

ParameterValue
Status code200 OK
Content-Typeapplication/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

ParameterTypeRequiredDescription
projectIdStringYesCan be found on Notifly's settings page.
campaignIdStringYesCan be found by clicking on a campaign in the campaign list to view the details in the popup at the top.

Request

ParameterTypeRequiredDescription
recipientsListYesInformation about the message recipients.
- typeStringNoType of recipient (default: user-id). Currently supports user-id phone-number, and email.
- userIdStringNoID of the user to whom the message will be sent. Required if type is user-id.
- phoneNumberStringNoPhone number of the user to whom the message will be sent. Required if type is phone-number.
- emailStringNoEmail address of the user to whom the message will be sent. Required if type is email.
- eventParamsObjectNoAn object containing event parameters to personalize the message.
Recipient Type Support and Message Personalization

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 and phone-number type recipients.
  • SMS: Supports both user-id and phone-number type recipients.
  • Email: Supports both user-id and email 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.

Deduplication

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

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response

Status CodeContent-TypeDescriptionExample Response
200 OKapplication/jsonThe campaign was triggered successfully.{"code": 200, "success":true,"error":null}
400 Bad Requestapplication/jsonThe request is incorrect.{"code": 400, "success":false,"error":"Bad request: some-error-message"}
401 Unauthorizedapplication/jsonThe token has expired, or the authentication information is invalid.{"code": 401, "success":false,"error":"Unauthorized: Invalid token"}
405 Method Not Allowedapplication/jsonUnsupported HTTP Method.{"code": 405, "success":false,"error":"Method not allowed: some-error-message"}
413 Payload Too Largeapplication/jsonThe request payload is too large.{"code": 413, "success":false,"error":"Payload too large: some-error-message"}
500 Internal Server Errorapplication/jsonNotifly server error. If 500 errors persist, please contact the Notifly team.{"code": 500, "success":false,"error":"some-error-message"}
501 Not Implementedapplication/jsonThe 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

ParameterTypeRequiredDescription
projectIdStringYesCan be found on Notifly's settings page.
typeStringYesMessage type (sms or mms).
titleStringNoThe title of the message body (used only for mms).
bodyStringYesThe content of the message body.
recipientListListYesList of recipients (up to 1000).
- recipientNoStringYesRecipient number.

Headers

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response

Status CodeContent-TypeExample Response
200 OKapplication/json{"success":true}
400 Bad Requestapplication/json{"error":"some-error-message"}
405 Method Not Allowedapplication/json{"error":"Method not allowed"}
413 Payload Too Largeapplication/json{"error":"Payload Too Large"}
500 Internal Server Errorapplication/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

ParameterTypeRequiredDescription
projectIdStringYesCan be found on Notifly's settings page.
templateIdStringYesThe registered dispatch template ID (can be found in the Alimtalk Template List)
recipientListListYesList of recipients (up to 1000).
- recipientNoStringYesRecipient number.
- templateParameterObjectNoTemplate parameters, required if there are variables to replace.

Headers

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response

Status CodeContent-TypeExample Response
200 OKapplication/json{"success":true}
400 Bad Requestapplication/json{"error":"some-error-message"}
405 Method Not Allowedapplication/json{"error":"Method not allowed"}
413 Payload Too Largeapplication/json{"error":"Payload Too Large"}
500 Internal Server Errorapplication/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

ParameterTypeRequiredDescription
projectIdStringYesCan be found on Notifly's settings page.
messageTypeStringYesMessage type. (Currently only text type is supported.)
isAdBooleanNoAdvertisement flag.
recipientListListYesList of recipients (up to 1000).
- recipientNoStringYesRecipient number.
- content.textStringYesBody content.

Headers

ParameterValueDescription
Content-Typeapplication/jsonMIME Type of the request body
Authorizationsome-tokenThe authentication token obtained through the Authorization endpoint

Response

Status CodeContent-TypeExample Response
200 OKapplication/json{"success":true}
400 Bad Requestapplication/json{"error":"some-error-message"}
405 Method Not Allowedapplication/json{"error":"Method not allowed"}
413 Payload Too Largeapplication/json{"error":"Payload Too Large"}
500 Internal Server Errorapplication/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");
}