Nomsa Guide
  • 👋About Nomsa
  • Campaign Guide - General
    • 🚀How to send a campaign?
  • Campaign Guide - Email
    • 📧Email Campaigns - Basics
      • Scheduled Sending
      • Bounced Emails and Halted Campaigns
      • Email Statistics
      • Formatting your Message Template
      • Variable Fields
      • Unique URL Link per Recipient
      • Pasting Content from Microsoft Word
      • Manage your Unsubscriptions
      • Understanding Unsubscriptions
    • 🔐Sending Password-Protected Emails
      • Tutorial
  • Campaign Guide - SMS
    • 📲SMS Campaigns - Basics
    • SMS Onboarding Overview
      • How do I send SMS
  • Campaign Guide - Telegram
    • 🤖Telegram Campaigns - Basics
      • Add Telegram Bot Token in Nomsa
      • Instructions for Recipient Onboarding
      • Use the Bot in the Campaign
      • Telegram Formatting
      • Telegram Bot Statistics
  • Api Guide
    • 📖Overview
      • API Response Formats
      • Bearer Authentication
      • Generate your API Key
      • Rotate your API Key
    • 📨Programmatic Email API
      • Custom From Address
      • Tracking Email Status
      • Send Email API
        • From Name and From Address
        • CC and BCC
        • Recipient Blacklist
        • Email Tagging and Classification
        • Email Body
          • Embedding Images
            • Linked Images
            • Content-ID Images
        • Attachments
        • Rate Limit
      • Get Email by ID API
      • List Emails API
    • 📬Programmatic SMS API
Powered by GitBook
On this page
  • 1. How to send demo SMS via our API
  • Rate Limit
  • 2. How to send SMS
  • 3. GET SMS by ID
  • 4. List all SMS
  1. Api Guide

Programmatic SMS API

PreviousList Emails API

Last updated 1 year ago

If you would like to use our programmatic SMS API, do note that set-up with Nomsa team will need to be done. Please contact us .

1. How to send demo SMS via our API

If you want to test sending demo SMS via our API please follow instruction below.

1. Visit Nomsa.gov.kh and register with your .gov.kh mail 2. Create your API Key: visit this for more information Generate your API Key

It's almost done, now you can send demo SMS via by using our demo credential below

Demo credential Label: nomsa-sms-demo

curl --location --request POST 'https://api.nomsa.gov.kh/v1/transactional/sms/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{apikey}}
--data '{
  "body": "Demo OTP: 1234",
  "recipient": "+8559123511",
  "label": "nomsa-sms-demo"
}'

Response

{
    "id": "145",
    "credentialsLabel": "nomsa-sms-demo",
    "recipient": "855961234567",
    "body": "Demo OTP: 1234",
    "message_id": "NOMSA-TEST@IwSs5KCQMNBUQNEnh-93CptNyqBBOm",
    "created_at": "2024-01-18T07:26:55.989Z",
    "updated_at": "2024-01-18T07:26:56.775Z",
    "status": "UNSENT",
    "error_code": null,
    "accepted_at": "2024-01-18T07:26:56.774Z",
    "sent_at": null,
    "delivered_at": null,
    "errored_at": null,
    "remainingMessage": "You have SMS demo 9 left"
}

Please kindly note that we allow testing demo SMS via API only for our UAT environment

Rate Limit

If you have sent out 10 message you will reach out rate limit.

{
    "code": "rate_limit",
    "message": "You are reach out of SMS demo rate limit, Please contact Nomsa team For more information"
}

We allow only 10 message for each user to testing demo SMS via API on our UAT environment if you want to send SMS via API and setup your own credential please reach out to us to set up Nomsa SMS credential.

2. How to send SMS

curl --location 'https://api.nomsa.gov.kh/v1/transactional/sms/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{apikey}} \
--data '{
  "body": "Greeting from MCS",
  "recipient": "+8559123511",
  "label": "credentail-name"
}'

Response

{
    "id": "26",
    "credentialsLabel": "credentail-name",
    "recipient": "+8559123511",
    "body": "Greeting from DGC",
    "message_id": "MTPCXua0l_66aGE8j2zlrftKuPhPwXHkW2",
    "created_at": "2023-10-04T04:33:56.247Z",
    "updated_at": "2023-10-04T04:33:56.615Z",
    "status": "SENT",
    "error_code": null,
    "accepted_at": "2023-10-04T04:33:56.615Z",
    "sent_at": null,
    "delivered_at": null,
    "errored_at": null
}

3. GET SMS by ID

curl --location 'https://api.nomsa.gov.kh/v1/transactional/sms/{{smsId}}' \
--header 'Authorization: Bearer {{apikey}}' \

Response

{
    "id": "26",
    "credentialsLabel": "credentail-name",
    "recipient": "+8559123511",
    "body": "Greeting from DGC",
    "message_id": "MTPCXua0l_66aGE8j2zlrftKuPhPwXHkW2",
    "created_at": "2023-10-04T04:33:56.247Z",
    "updated_at": "2023-10-04T04:33:56.615Z",
    "status": "DELIVERED",
    "error_code": null,
    "accepted_at": "2023-10-04T04:33:56.615Z",
    "sent_at": null,
    "delivered_at": null,
    "errored_at": null
}

4. List all SMS

curl --location 'https://api.nomsa.gov.kh/v1/transactional/sms' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json'

Response

{
    "has_more": false,
    "data": [
        {
            "id": "27",
            "credentialsLabel": "credentail-name",
            "recipient": "+855962234519",
            "body": "Greeting from MCS",
            "message_id": "MTPC3VrS-c5Vm-2AjtVhNKi8VhKj9fbSyZ",
            "created_at": "2023-10-04T04:36:49.400Z",
            "updated_at": "2023-10-04T04:36:49.839Z",
            "status": "UNSENT",
            "error_code": null,
            "accepted_at": "2023-10-04T04:36:49.839Z",
            "sent_at": null,
            "delivered_at": null,
            "errored_at": null
        },
        {
            "id": "26",
            "credentialsLabel": "credentail-name",
            "recipient": "+8559123511",
            "body": "Greeting from MCS",
            "message_id": "MTPCXua0l_66aGE8j2zlrWlKuPhPwXHkW2",
            "created_at": "2023-10-04T04:33:56.247Z",
            "updated_at": "2023-10-04T04:33:56.615Z",
            "status": "UNSENT",
            "error_code": null,
            "accepted_at": "2023-10-04T04:33:56.615Z",
            "sent_at": null,
            "delivered_at": null,
            "errored_at": null
        }
}
📬
here
here