Base URL
เราแนะนำให้เรียกใช้งานทุก Request มาที่ Base URL ผ่าน HTTP POST, GET method
Base URL: https://app-{{domain_app}}.nipamail.com/
Authorization
ระบบรองรับ basic authorization ด้วย username และ password กับ Base64 encoding RFC2045-MIME.
ตัวอย่าง Authorization header สร้างได้ดังนี้
การส่ง SMS นั้นสามารถส่งได้หลากหลายรูปแบบโดยกำหนดค่าต่างๆด้วย parameter โดยมีปัจจัย 3 หัวข้อหลักๆดังนี้
ท่านสามารถเริ่มสร้าง HTTP POST Request โดยต้องระบุ Header authorization และ content type
JSON การส่ง SMS ไปยังหมายเลขปลายทาง
POST https://app-{{ domain_app }}.nipamail.com/v1.0/sms/multipostPOST /sms/post HTTP/1.1 Host: app-{{domain_app}}.nipamail.com Authorization: Basic QWxhZGRpbjpvcGVuc2VzYW1l== { "from":"NIPA", "to":"66917748500", "text":"ร่วมฉลอง ครบรอบการก่อตั้ง บริษัท Nipa technology วันนี้ เวลา 18:00 น.", }
{ "bulkId": "bulkotp-60d9bbee4f5e960faca91b6a1c7fc93", "details": [ { "messageId": "9c5667a7a669c2a6b3e4a10178e0c680", "mobile": "66917748500", "to": "66917748500", "from":"NIPA", "credit":"1.00", "shorturl":"N", "status": { "code":"101", "name": "PENDING", "description": "Pending -Message has been accepted by the system" } } ] }
POST /sms/multipost HTTP/1.1 Host: app-{{domain_app}}.nipamail.com Authorization: Basic QWxhZGRpbjpvcGVuc2VzYW1l== [ { "from":"NIPA", "to":"66985659329", "text":"ร่วมฉลอง ครบรอบการก่อตั้ง บริษัท Nipa technology วันนี้ เวลา 18:00 น.", } { "from":"NIPA", "to":"66917748500", "text":"ร่วมลุ้นรับรางวัลใหญ่กับกิจกรรมพิเศษวันวาเลนไทน์.", } ... ]
{ "bulkId":"5028e2d42f19-42f1-4656-351e-a42c191e5fd2", "details": [ { "messageId": "140e22833c06036ccf07e77413dcc57a", "mobile": "66985659329", "to": "66985659329", "from":"NIPA", "credit":"1.00", "shorturl":"N", "status": { "code":"101", "name": "PENDING", "description": "Pending -Message has been accepted by the system" } }, { "messageId": "7aa8a61e04757d1c08c5a50136566a53", "mobile": "66917748500", "to": "66917748500", "from":"NIPA", "credit":"1.00", "shorturl":"N", "status": { "code":"101", "name": "PENDING", "description": "Pending -Message has been accepted by the system" } } ] }
GET /sms/{messageid} HTTP/1.1 Host: app-{{domain_app}}.nipamail.com Authorization: Basic QWxhZGRpbjpvcGVuc2VzYW1l==
{ "status": 200, "bulkId":"bulkotp-9324a1acc128b87c4d339372bc5753e5", "total": 2, "page": 1, "data": [ { "to": "66985659329", "resource": { "sender": "NIPA", "to": "66985659329", "text": "สวัสดี." }, "send_days": "2021-22-03", "send_date": "2021-22-03 12:25:34", "logtime": 1635917134, "bulkId": "bulkotp-9324a1acc128b87c4d339372bc5753e5", "messageId": "140e22833c06036ccf07e77413dcc57a", "status": "DELIVERED", "smsCount": 1, "sentAt": "2021-22-03T12:25:00", "doneAt": "2021-22-03T12:25:48.533", "price": 1, }, { "to": "66917748500", "resource": { "sender": "NIPA", "to": "66917748500", "text": "สวัสดี." }, "send_days": "2021-22-03", "send_date": "2021-22-03 12:25:34", "logtime": 1635917134, "bulkId": "bulkotp-9324a1acc128b87c4d339372bc5753e5", "messageId": "7aa8a61e04757d1c08c5a50136566a53", "status": "DELIVERED", "smsCount": 1, "sentAt": "2021-22-03T12:25:00", "doneAt": "2021-22-03T12:25:48.52", "price": 1, } ], "date": "2021-11-03 16:46:59" }
ให้สังเกตุว่าหาก Respond header HTTP status code แสดวงค่าเป็น 200 OK แสดงว่าข้อความจะถูกส่งตาม Request body ถูกต้อง
Code | Name | Remark |
---|---|---|
0 | ACCEPTED | Message is accepted. |
1 | PENDING | Message is in pending status. |
2 | UNDELIVERABLE | Message is undeliverable. |
3 | DELIVERED | Message is delivered. |
4 | EXPIRED | Message is expired. |
5 | REJECTED | Message is rejected. |
6 | COMPLETED | Message has successfully send to operator. |
{ "code": "000", "name": "DELIVERED", "description": "Successfully sent to phone" }
Message has been processed and sent to the next instance i.e mobile operator.
Code | Description |
---|---|
000 | Success |
000 | Message acknowledged by SMSC. |
101 | Pending - Message has been accepted by system. |
Message has not been delivered.
Code | Description |
---|---|
204 | Error - The request has been rejected due to an expected system error please retry submission or contact our technical support team for more details. |
205 | Content-Type not XML. |
206 | Malformed XML. |
207 | Authentication failed. |
208 | Service blocked. |
209 | Non-Trumove recipient found Charged party is not Truemove/Realmove. |
210 | No service found. |
211 | Congestion or Quota exceed. |
213 | RTEC error" meaning The reserve credit system has connection error. |
214 | Message rejected by SMSC. |
215 | Malform. |
218 | No operator configured type. |
219 | Internal Error. Please try later |
220 | Undefined Error. |
221 | PSA Connection failed. |
222 | LDAP returns "Record not found . |
223 | No response from LDAP/No connection to LDAP. |
224 | First time calling. |
226 | Diameter - Command unsupported. |
227 | Diameter - Unable to deliver. |
228 | Diameter - Realm not served. |
229 | Diameter - Too busy. |
230 | Diameter - Loop detected. |
231 | Diameter - Redirect indication. |
232 | Diameter - Application unsupported. |
233 | Diameter - Unknown peer. |
234 | Diameter - Authentication rejected. |
235 | Diameter - Out of space. |
236 | Election lost. |
237 | Diameter - End user service denied. |
238 | Diameter - Credit control not applicable. |
239 | Diameter - Insufficient balance. |
240 | Diameter - INACT negative balance. |
241 | Diameter - Insufficient balance roaming. |
242 | Diameter - INACT positive balance. |
243 | User never open. |
244 | Never used. |
245 | User missing claim. |
246 | User locked. |
247 | Voice service stopped. |
251 | Member account frozen. |
252 | Member account reached monthly limit. |
253 | Called member account frozen. |
254 | Called member account reached monthly limit. |
255 | Diameter dealt. |
259 | Diameter invalid AVP bit combo. |
260 | Diameter mo common security. |
261 | Diameter usser unknown. |
262 | Diameter rating failed. |
263 | Diameter link down and let go. |
265 | Connection time out (BS Access Failed). |
266 | Other error. |
267 | Message has been blocked AntiSpam. |
268 | Memory capacity exceed. |
269 | Subscriber error or not support. |
270 | Unknown subscriber. |
271 | Subscriber barring. |
272 | Undefined subscriber. |
273 | Telecommunication Service Not Supported. |
274 | Admin ไม่ได้กำหนด Gateway. |
412 | Invalid user. |
Message has successfully been processed and delivered.
Code | Description |
---|---|
000 | Successfully sent to phone. |
000 | Complete - Message has been successfuuly processed and delivered to recipient processed and delivered to recipient. |
Message has been sent, and has either expired due to being pending pas its validity period (our platform default is 48 hours), or the delivery report from the operator has revered the expired as a final status.
Code | Description |
---|---|
300 | Expire - The message was received and sent to the operator , however it has been pending until the validity period has expired , or the opertor returned expired status in the meantime. |
301 | The subcription period to the associated service is already expired. |
302 | User will expire. |
303 | Balance have little money and User will expired. |
304 | User expired. |
305 | Absent subscriber or Subscriber unreachable. |
306 | Mobile Switched Off. |
Message has been received, but has either been rejected by ANTS, or the operator has reverted Rejected as final status.
Code | Description |
---|---|
200 | Credit not enough - Your account is out fo credits for further submission - please top up your account. For further assistance in topping up or applying for online account topup service you may contact your account manager. |
201 | Blacklist - Number is blacklisted on ANTS account. |
202 | Duplicate - Request rejected due to duplicate. |
203 | Cancle - Cancel reauests by user. |
212 | No enough credit meaning Your number has not enough credit. Please topup. |
216 | The recipient has no credit. |
217 | Charged failed. |
225 | Balance have little money. |
239 | Diameter - Insufficient balance. |
240 | Diameter - INACT negative balance. |
241 | Diameter - Insufficient balance roaming. |
248 | User invalid. |
249 | Blacklist. |
250 | Balance is zero. |
256 | Diameter user blocked. |
257 | Diameter user block activation. |
258 | Diameter call destination blocked. |
264 | Diameter link down and block. |
400 | INVALID Acct" meaning Your number has expire date and change to inactive stat. |
402 | Invalid number - phone number formatted incorrectly. |
403 | Invalid service id from the request. |
404 | Invalid MSISDN number. |
405 | Format Error. |
406 | Invalid input format. |
407 | Message rejected by SMSC. Note: 256 means PSA+ Let Go |
408 | Diameter invalid HDR bits. |
409 | Diameter invalid AVP bits. |
410 | Message rejected by SMSC. |
411 | Invalid sender. |
Message has been successfully send to operator.
Code | Description |
---|---|
COMPLETED | Send to operator success. |