send-text-message
curl --request POST \
--url https://api.notifly.tech/messages/text-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "example_project_1234567890abcdef",
"type": "sms",
"body": "Message Body",
"recipientList": [
{
"recipientNo": "01012345678"
}
]
}
'import requests
url = "https://api.notifly.tech/messages/text-message"
payload = {
"projectId": "example_project_1234567890abcdef",
"type": "sms",
"body": "Message Body",
"recipientList": [{ "recipientNo": "01012345678" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: 'example_project_1234567890abcdef',
type: 'sms',
body: JSON.stringify('Message Body'),
recipientList: [{recipientNo: '01012345678'}]
})
};
fetch('https://api.notifly.tech/messages/text-message', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notifly.tech/messages/text-message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'example_project_1234567890abcdef',
'type' => 'sms',
'body' => 'Message Body',
'recipientList' => [
[
'recipientNo' => '01012345678'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifly.tech/messages/text-message"
payload := strings.NewReader("{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notifly.tech/messages/text-message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifly.tech/messages/text-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"data": null,
"error": "Sender info is not registered."
}{
"success": false,
"error": "Internal Server Error"
}메시징
문자 메시지 발송
문자 메시지(SMS, LMS, MMS)를 발송합니다.
POST
/
messages
/
text-message
send-text-message
curl --request POST \
--url https://api.notifly.tech/messages/text-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "example_project_1234567890abcdef",
"type": "sms",
"body": "Message Body",
"recipientList": [
{
"recipientNo": "01012345678"
}
]
}
'import requests
url = "https://api.notifly.tech/messages/text-message"
payload = {
"projectId": "example_project_1234567890abcdef",
"type": "sms",
"body": "Message Body",
"recipientList": [{ "recipientNo": "01012345678" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: 'example_project_1234567890abcdef',
type: 'sms',
body: JSON.stringify('Message Body'),
recipientList: [{recipientNo: '01012345678'}]
})
};
fetch('https://api.notifly.tech/messages/text-message', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notifly.tech/messages/text-message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'example_project_1234567890abcdef',
'type' => 'sms',
'body' => 'Message Body',
'recipientList' => [
[
'recipientNo' => '01012345678'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifly.tech/messages/text-message"
payload := strings.NewReader("{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.notifly.tech/messages/text-message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifly.tech/messages/text-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"example_project_1234567890abcdef\",\n \"type\": \"sms\",\n \"body\": \"Message Body\",\n \"recipientList\": [\n {\n \"recipientNo\": \"01012345678\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"data": null,
"error": "Sender info is not registered."
}{
"success": false,
"error": "Internal Server Error"
}주의 사항
- API를 이용한 문자 발송은 노티플라이 문자 자체 발송 설정이 되어있을 경우에만 가능합니다.
- 발신 번호는 자체 발송 설정에 입력된 번호가 사용됩니다.
- 아직 API를 이용한 발송 결과에 대한 통계는 UI로 제공되지 않습니다. 정보가 필요하실 경우 contact@notifly.tech으로 문의해주세요.
인증
POST /authenticate로 발급받은 인증 토큰을 Bearer 형식으로 전달합니다.
본문
application/json
응답
성공적인 메시지 발송입니다
⌘I
