NAV Navbar
shell php python
  • Introduction
  • Authentication
  • Request
  • Response
  • Message Template
  • Group
  • Contact
  • Campaign
  • Reports and Stats
  • Response Codes
  • Introduction

    Welcome to the mNotify API v2.0! You can use our API to access mNotify API endpoints, which can get information from your account as well as sending data to your account.

    We have language bindings in Curl, PHP, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    Authentication

    mNotify uses API keys to allow access to the API. You can register or login for a new mNotify API key by clicking here.

    mNotify expects for the API key to be included in all API requests to the server as a GET parameter:

    Example

    https://api.mnotify.com/api/template?key=YOUR_API_KEY

    Request

    This API is built with REST and it uses HTTP verbs.

    Meaning every request made to the api must be RESTful with HTTP verbs such as GET, POST, PUT and DELETE requests.

    Response

    All HTTP responses are of JSON format.

    Message Template

    Message templates are custom messages that you can create in your account so that you can reuse it to send messages

    to your recipients at any time.

    Get all Message Templates

    curl -X GET "https://api.mnotify.com/api/template?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/template';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>    
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/template'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json();
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "template_list": [
            {
                "_id": 1,
                "title": "Testing Message",
                "content": "Just trying to test the message"
            },
            {
                "_id": 2,
                "title": "HAPPY BIRTHDAY",
                "content": "This day we would like to wish you a happy birthday."
            }
        ]
    }
    

    This endpoint retrieves all your message templates.

    HTTP Request

    GET https://api.mnotify.com/api/template

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key

    Get a Specific Message Template

    curl -X GET "https://api.mnotify.com/api/template/1?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/template';
        $apiKey = 'YOUR_API_KEY';
        $id = 1;
        $url = $endPoint . '/' . $id . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/template'
    apiKey = 'YOUR_API_KEY'
    id = 1
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "template": {
            "_id": 1,
            "title": "Testing Message",
            "content": "Just trying to test the message"
        }
    }
    

    Retrieve a specific message template with id as a parameter.

    HTTP Request

    GET https://api.mnotify.com/api/template/<id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of specified message template

    Add Message Template

    curl -X POST "https://api.mnotify.com/api/template?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"title":"API testing","content":"Best message template"}'
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/template';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $data = [
           'title' => 'API testing',
           'content' => 'Best message template' 
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/template'
    apiKey = 'YOUR_API_KEY'
    data = {
       'title': 'API testing',
       'content': 'Best message template'
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "_id": "3"
    }
    

    Add a message template with data.

    HTTP Request

    POST https://api.mnotify.com/api/template

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    title Yes string Title of message template
    content Yes text Content of message template

    Update a Message Template

    curl -X PUT  "https://api.mnotify.com/api/template/3?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"title":"API testing","content":"Best message template","id":"3"}'
    
     <?php
         $endPoint = 'https://api.mnotify.com/api/template';
         $apiKey = 'YOUR_API_KEY';
         $id = 3;
         $url = $endPoint . '/' . $id . '?key=' . $apiKey;
         $data = [
            'title' => 'API testing',
            'content' => 'Best message template' ,
            'id' => 3
         ];
    
         $ch = curl_init();
         $headers = array();
         $headers[] = "Content-Type: application/json";
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         $result = curl_exec($ch);
         $result = json_decode($result, TRUE);
         curl_close($ch);
     ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/template'
    apiKey = 'YOUR_API_KEY'
    id = 3
    data = {
       'title': 'API testing',
       'content': 'Best message template',
       'id': 3
    }
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.put(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "template updated"
    }
    

    This endpoint updates a specific message template

    HTTP Request

    PUT https://api.mnotify.com/api/template/<id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    title Yes string Title of message template
    content Yes text Content of message template
    id Yes int id of message template to update

    Delete Message Template

    curl -X DELETE "https://api.mnotify.com/api/template/3?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/template';
        $apiKey = 'YOUR_API_KEY';
        $id = 3;
        $url = $endPoint . '/' . $id . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/template'
    apiKey = 'YOUR_API_KEY'
    id = 3
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.delete(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "template deleted"
    }
    

    Delete a specific message template with id as parameter

    HTTP Request

    DELETE https://api.mnotify.com/api/template/<id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of specified message template

    Group

    Groups are created in your account to store your contacts in a more organized way.

    Get all Groups

    curl -X GET "https://api.mnotify.com/api/group?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/group';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>    
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "group_list": [
            {
                "_id": 1,
                "group_name": "Test Group",
                "total_contacts": 10
            },
            {
                "_id": 1,
                "group_name": "mNotify Staff",
                "total_contacts": 200
            }
        ]
    }
    

    This endpoint retrieves all your groups.

    HTTP Request

    GET https://api.mnotify.com/api/group

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key

    Get a Specific Group

    curl -X GET "https://api.mnotify.com/api/group/1?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/group';
        $apiKey = 'YOUR_API_KEY';
        $id = 1;
        $url = $endPoint . '/' . $id . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    id = 1
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "template": {
            "_id": 1,
            "group_name": "Test Group",
            "total_contacts": 10
        }
    }
    

    Retrieve a specific group with id as a parameter.

    HTTP Request

    GET https://api.mnotify.com/api/group/<id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of specified group

    Add a Group

    curl -X POST "https://api.mnotify.com/api/group?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"group_name":"Group Testing"}'
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/group';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $data = [
           'group_name' => 'Group Testing'
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    data = {
       'group_name': 'Group Testing'
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "_id": "3"
    }
    

    Add a group with data.

    HTTP Request

    POST https://api.mnotify.com/api/group

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    group_name Yes string Name of group

    Update a Group

    curl -X PUT  "https://api.mnotify.com/api/group/3?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"group_name":"Group testing","id":"3"}'
    
     <?php
         $endPoint = 'https://api.mnotify.com/api/group';
         $apiKey = 'YOUR_API_KEY';
         $id = 3;
         $url = $endPoint . '/' . $id . '?key=' . $apiKey;
         $data = [
            'title' => 'Group testing',
            'id' => 3
         ];
    
         $ch = curl_init();
         $headers = array();
         $headers[] = "Content-Type: application/json";
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         $result = curl_exec($ch);
         $result = json_decode($result, TRUE);
         curl_close($ch);
     ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    id = 3
    data = {
       'title': 'Group testing',
       'id': 3
    }
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.put(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "group updated"
    }
    

    This endpoint updates a specific group

    HTTP Request

    PUT https://api.mnotify.com/api/group/<id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    group_name Yes string Group name
    id Yes int id of group to update

    Delete Group

    curl -X DELETE "https://api.mnotify.com/api/group/3?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/group';
        $apiKey = 'YOUR_API_KEY';
        $id = 3;
        $url = $endPoint . '/' . $id . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    id = 3
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.delete(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "group and associated contacts deleted"
    }
    

    Delete a specific group with id as parameter

    HTTP Request

    DELETE https://api.mnotify.com/api/group/<id>

    URL Parameters

    Parameter Required Description Description
    key Yes string Your enabled api key
    id Yes int id of specified group

    Contact

    Add contacts to your groups in order to send message to them

    Get all Contacts

    curl -X GET "https://api.mnotify.com/api/contact?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/contact';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>    
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/contact'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "contacts_list": [
            {
                "_id": 1,
                "phone": "0203xxxxxx",
                "title": "Mr",
                "firstname": "Bruce",
                "lastname": "Wayne",
                "email": "bruce.wayne@domain.com",
                "dob": "2017-11-25"
            },
            {
                "_id": 2,
                "phone": "0249xxxxxx",
                "title": "Mr",
                "firstname": "Clark",
                "lastname": "Kent",
                "email": "clark.kent@domain.com",
                "dob": "2017-11-25"
            }
        ]
    }
    

    This endpoint retrieves all your contacts.

    HTTP Request

    GET https://api.mnotify.com/api/contact

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key

    Get Group Contacts

    curl -X GET "https://api.mnotify.com/api/contact/group/1?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/contact/group';
        $apiKey = 'YOUR_API_KEY';
        $groupId = 1;
        $url = $endPoint . '/' . $groupId . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/contact/group'
    apiKey = 'YOUR_API_KEY'
    groupId = 1
    url = endPoint + '/' + groupId + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "contact": {
            "_id": 2,
            "group_id": 1,
            "phone": "0249xxxxxx",
            "title": "Mr",
            "firstname": "Clark",
            "lastname": "Kent",
            "email": "clark.kent@domain.com",
            "dob": "2017-11-25"
        }
    }
    

    Retrieves contacts which belongs to a particular group with group id as a parameter.

    HTTP Request

    GET https://api.mnotify.com/api/contact/group/<group_id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    group_id Yes int id of specified group

    Get a Contact

    curl -X GET "https://api.mnotify.com/api/contact/1?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/contact';
        $apiKey = 'YOUR_API_KEY';
        $id = 1;
        $url = $endPoint . '/' . $id . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/contact'
    apiKey = 'YOUR_API_KEY'
    id = 1
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "contact": {
            "_id": 1,
            "phone": "0203xxxxxx",
            "title": "Mr",
            "firstname": "Bruce",
            "lastname": "Wayne",
            "email": "bruce.wayne@domain.com",
            "dob": "2017-11-25"
        }
    }
    

    Retrieve a specific contact with id as a parameter.

    HTTP Request

    GET https://api.mnotify.com/api/contact/<id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of specified contact

    Add a Contact

    curl -X POST "https://api.mnotify.com/api/contact/1?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"phone":"0244698970", "title":"Dr", "firstname":"Stephen", "lastname":"Strange", "email": "strange.smart@gmail.com", "dob": "1979-01-01"}'
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/contact';
        $apiKey = 'YOUR_API_KEY';
        $groupId = 1;
        $url = $endPoint . '/' . $groupId . '?key=' . $apiKey;
        $data = [
           'phone' => '0244698970',
           'title' => 'Dr',
           'firstname' => 'Stephen',
           'lastname' => 'Strange',
           'email' => 'strange.smart@gmail.com',
           'dob' => '1979-01-01'
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/group'
    apiKey = 'YOUR_API_KEY'
    groupId = 1
    data = {
       'phone': '0244698970',
       'title': 'Dr',
       'firstname': 'Stephen',
       'lastname': 'Strange',
       'email': 'strange.smart@gmail.com',
       'dob': '1979-01-01',
    }
    url = endPoint + '/' + groupId + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "_id": 4,
        "_group_id": "1"
    }
    

    Add a contact to a group with data.

    HTTP Request

    POST https://api.mnotify.com/api/contact/<group_id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    group_id Yes int id of group you want to save contact to
    phone Yes string Phone number of contact
    title Yes string Title of contact eg Mr, Dr, Miss etc
    firstname Yes string First name of contact
    lastname No string Last name of contact
    email No string Email name of contact
    dob No date Date of birth of contact in YYYY-MM-DD format

    Update a Contact

    curl -X PUT  "https://api.mnotify.com/api/contact/4?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"id":"4", "group_id":"1", "phone":"0244698970", "title":"Dr", "firstname":"Stephen", "lastname":"Strange", "email": "strange.smart@gmail.com", "dob": "1979-01-01"}'
    
     <?php
         $endPoint = 'https://api.mnotify.com/api/contact';
         $apiKey = 'YOUR_API_KEY';
         $id = 4;
         $url = $endPoint . '/' . $id . '?key=' . $apiKey;
          $data = [
            'id' => 4,
            'group_id' => 1,
            'phone' => '0244698970',
            'title' => 'Dr',
            'firstname' => 'Stephen',
            'lastname' => 'Strange',
            'email' => 'strange.smart@gmail.com',
            'dob' => '1979-01-01'
          ];
    
         $ch = curl_init();
         $headers = array();
         $headers[] = "Content-Type: application/json";
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         $result = curl_exec($ch);
         $result = json_decode($result, TRUE);
         curl_close($ch);
     ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/contact'
    apiKey = 'YOUR_API_KEY'
    id = 4
    data = {
       'id': 4,
       'group_id': 1,
       'phone': '0244698970',
       'title': 'Dr',
       'firstname': 'Stephen',
       'lastname': 'Strange',
       'email': 'strange.smart@gmail.com',
       'dob': '1979-01-01',
    }
    url = endPoint + '/' + id + '?key=' + apiKey
    response = requests.put(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "contact updated"
    }
    

    This endpoint updates a specific contact

    HTTP Request

    PUT https://api.mnotify.com/api/contact/<id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of contact
    group_id Yes int id of group you want to save contact to
    phone Yes string Phone number of contact
    title Yes string Title of contact eg Mr, Dr, Miss etc
    firstname Yes string First name of contact
    lastname No string Last name of contact
    email No string Email name of contact
    dob No date Date of birth of contact in YYYY-MM-DD format

    Delete Contact

    curl -X DELETE "https://api.mnotify.com/api/contact/4/1?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/contact';
        $apiKey = 'YOUR_API_KEY';
        $id = 4;
        $groupId = 1;
        $url = $endPoint . '/' . $id . '/' . $groupId . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/contact'
    apiKey = 'YOUR_API_KEY'
    id = 4
    groupId = 1
    url = endPoint + '/' + id + '/' + groupId + '?key=' + apiKey
    response = requests.delete(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "message": "group and associated contacts deleted"
    }
    

    Delete a specific contact with id and group_id as parameters

    HTTP Request

    DELETE https://api.mnotify.com/api/contact/<id>/<group_id>

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of specified contact
    group_id Yes int id of group which contact belong

    Campaign

    Send Bulk SMS or Bulk Voice Call to individuals or groups. Each campaign consists of both sending using quick or group.

    Quick Bulk SMS

    curl -X POST  "https://api.mnotify.com/api/sms/quick?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"recipient":["0249706365","0203698970"], "sender":"mNotify", "message":"API messaging is fun!", "is_schedule":false, "schedule_date":""}'
    
    <?php
    
        $endPoint = 'https://api.mnotify.com/api/sms/quick';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $data = [
           'recipient' => ['0249706365', '0203698970'],
           'sender' => 'mNotify',
           'message' => 'API messaging is fun!',
           'is_schedule' => 'false',
           'schedule_date' => ''
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/sms/quick'
    apiKey = 'YOUR_API_KEY'
    data = {
       'recipient[]': ['0249706365', '0203698970'],
       'sender': 'mNotify',
       'message': 'API messaging is fun!',
       'is_schedule': False,
       'schedule_date': ''
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "code": "2000",
        "message": "messages sent successfully",
        "summary": {
            "_id": "A59CCB70-662D-45EF-9976-1EFAD249793D",
            "type": "API QUICK SMS",
            "total_sent": 2,
            "contacts": 2,
            "total_rejected": 0,
            "numbers_sent": [
                "0249706365",
                "0203698970"
            ],
            "credit_used": 2,
            "credit_left": 1483
        }
    }
    

    Send SMS to clients/contacts using contacts that you have without storing in any group first

    HTTP Request

    POST https://api.mnotify.com/api/sms/quick

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    recipient Yes array Array of phone numbers eg. ['0249706365', '0203698970']
    sender Yes string Sender ID of the message. Must be at most 11 characters
    message Yes text Message content
    is_schedule No boolean Schedule flag. True means schedule message
    schedule_date No datetime date and time in YYYY-MM-DD hh:mm if is_schedule is true

    Schedule Quick Bulk SMS

    When scheduling quick SMS, you must set is_schedule to true and include the date and time in schedule_date payload in the format YYYY-MM-DD hh:mm.

    Group Bulk SMS

    curl -X POST  "https://api.mnotify.com/api/sms/group?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"group_id":["1","2"], "sender":"mNotify", "message_id":"17481", "is_schedule":false, "schedule_date":""}'
    
    <?php
    
        $endPoint = 'https://api.mnotify.com/api/sms/group';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $data = [
           'group_id' => ['1', '2'],
           'sender' => 'mNotify',
           'message_id' => 17481,
           'is_schedule' => 'false',
           'schedule_date' => ''
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/sms/group'
    apiKey = 'YOUR_API_KEY'
    data = {
       'group_id[]': ['1', '2'],
       'sender': 'mNotify',
       'message_id': '17481',
       'is_schedule': False,
       'schedule_date': ''
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "code": "2000",
        "message": "messages sent successfully",
        "summary": {
            "_id": "8C5D1052-9BD6-459A-96FF-5DC1516C05FD",
            "type": "API GROUP SMS",
            "total_sent": 3,
            "contacts": 3,
            "total_rejected": 0,
            "numbers_sent": [
                "0203698970",
                "0244698970",
                "0249706365"
            ],
            "credit_used": 3,
            "credit_left": 1480
        }
    }
    

    Send SMS to clients/contacts using groups you created earlier which has contacts in them

    HTTP Request

    POST https://api.mnotify.com/api/sms/group

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    group_id Yes array Array of group ids eg. ['1', '2']
    sender Yes string Sender ID of the message. Must be at most 11 characters
    message Yes text Message content
    message Yes / No text Message content
    message_id No / Yes int Message template id
    is_schedule No boolean Schedule flag. True means schedule message
    schedule_date No datetime date and time in YYYY-MM-DD hh:mm if is_schedule is true

    Schedule Group Bulk SMS

    When scheduling quick SMS, you must set is_schedule to true and include the date and time in schedule_date payload in the format YYYY-MM-DD hh:mm.

    Quick Bulk Voice Call

    curl https://api.mnotify.com/api/voice/quick?key=YOUR_API_KEY
    -F campaign="First Voice Campaign" -F recipient[]=0249706365 -F recipient[]=0203698970 
    -F file=@path/to/your/voice/file -F voice_id=""  -F is_schedule=false -F schedule_date=""
    
    <?php
    
        $endPoint = 'https://api.mnotify.com/api/voice/quick';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $curlFile = curl_file_create('path/to/your/voice/file');
        $data = [
           'campaign' => 'First Voice Campaign',
           'recipient' => ['0249706365', '0203698970'],
           'file' => $curlFile,
           'voice_id' => '',
           'is_schedule' => 'false',
           'schedule_date' => ''
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: multipart/form-data";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/voice/quick'
    apiKey = 'YOUR_API_KEY'
    file = {'file': open('path/to/your/voice/file', 'rb')}
    data = {
       'campaign': 'First Voice Campaign',
       'recipient[]': ['0249706365', '0203698970'],
       'file': file,
       'voice_id': '',
       'is_schedule': False,
       'schedule_date': ''
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "code": "2000",
        "message": "voice call sent successfully",
        "summary": {
            "_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
            "voice_id": "20180308134708",
            "type": "QUICK BULK CALL",
            "total_sent": 2,
            "contacts": 2,
            "total_rejected": 0,
            "numbers_sent": [
                "0249706365",
                "0203698970"
            ],
            "credit_used": 18
        }
    }
    

    The difference between Quick Bulk Voice Call and Quick Bulk SMS is the content of message. Here instead of using text as the message, you are going to use voice that you have recorded earlier in any format.

    HTTP Request

    POST https://api.mnotify.com/api/voice/quick

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    campaign Yes string The title of your bulk voice call campaign
    recipient Yes array Array of phone numbers eg. ['0249706365', '0203698970']
    file Yes / No file Your voice file in any format eg. mp3,wav etc
    voice_id No / Yes string Your voice id when you already have a voice used before
    is_schedule No boolean Schedule flag. True means schedule message
    schedule_date No datetime date and time in YYYY-MM-DD hh:mm if is_schedule is true

    Schedule Quick Bulk Voice Call

    When scheduling quick bulk voice call, you must set is_schedule to true and include the date and time in schedule_date payload in the format YYYY-MM-DD hh:mm.

    Group Bulk Voice Call

    curl -X POST  "https://api.mnotify.com/api/voice/group?key=YOUR_API_KEY"
    -H "Content-Type:application/json" 
    -d '{"campaign":"First Voice Campaign", group_id":["1","2"], "file":"", "voice_id":"20180308134708", "is_schedule":false, "schedule_date":""}'
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/voice/group';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
        $data = [
           'campaign' => 'First Voice Campaign',
           'group_id' => ['1', '2'],
           'file' => '',
           'voice_id' => '20180308134708',
           'is_schedule' => 'false',
           'schedule_date' => ''
        ];
    
        $ch = curl_init();
        $headers = array();
        $headers[] = "Content-Type: application/json";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/voice/group'
    apiKey = 'YOUR_API_KEY'
    data = {
       'campaign': 'First Voice Campaign',
       'group_id[]': ['1', '2'],
       'file': '',
       'voice_id': '20180308134708',
       'is_schedule': False,
       'schedule_date': ''
    }
    url = endPoint + '?key=' + apiKey
    response = requests.post(url, data)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "code": "2000",
        "message": "voice call sent successfully",
        "summary": {
            "_id": "pj85z9u5odXqozOZOFuJwU88SYVN7j",
            "voice_id": "20180308134708",
            "type": "GROUP BULK CALL",
            "total_sent": 2,
            "contacts": 2,
            "total_rejected": 0,
            "numbers_sent": [
                "0203698970",
                "0249706365"
            ],
            "credit_used": 18
        }
    }
    

    Place bulk voice call to your groups which contains contacts

    HTTP Request

    POST https://api.mnotify.com/api/voice/group

    URL Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    campaign Yes string The title of your bulk voice call campaign
    group_id Yes array Array of phone numbers eg. ['1', '2']
    file Yes / No file Your voice file in any format eg. mp3,wav etc
    voice_id No / Yes string Your voice id when you already have a voice used before
    is_schedule No boolean Schedule flag. True means schedule message
    schedule_date No datetime date and time in YYYY-MM-DD hh:mm if is_schedule is true

    Reports and Stats

    Check SMS Balance

    curl -X GET "https://api.mnotify.com/api/balance/sms?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/balance/sms';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/balance/sms'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "balance": 1000,
        "bonus": 471
    }
    

    This endpoint retrieves your SMS credit balance and bonus

    HTTP Request

    GET https://api.mnotify.com/api/balance/sms

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key

    Check Voice Balance

    curl -X GET "https://api.mnotify.com/api/balance/voice?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/balance/voice';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/balance/voice'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "balance": 59995
    }
    

    This endpoint retrieves your Voice credit balance

    HTTP Request

    GET https://api.mnotify.com/api/balance/voice

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key

    SMS Delivery Report

    curl -X GET "https://api.mnotify.com/api/campaign/7FE4A62A-96EB-4755-BC57-000A38C8C6EF?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/campaign/7FE4A62A-96EB-4755-BC57-000A38C8C6EF';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/campaign/7FE4A62A-96EB-4755-BC57-000A38C8C6EF'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "report": [
            {
                "_id": 60711577,
                "recipient": "233249706365",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:19:35",
                "campaign_id": "7FE4A62A-96EB-4755-BC57-000A38C8C6EF",
                "retries": 0
            },
            {
                "_id": 60711578,
                "recipient": "233203698970",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:19:35",
                "campaign_id": "7FE4A62A-96EB-4755-BC57-000A38C8C6EF",
                "retries": 0
            }
        ]
    }
    

    This endpoint retrieves delivery report for SMS sent earlier with id (campaign_id) of message returned when message was sent

    HTTP Request

    GET https://api.mnotify.com/api/campaign/<id>/<status>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes string id of campaign
    status No string status of delivery

    Specific SMS Delivery Report

    curl -X GET "https://api.mnotify.com/api/status/60711577?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/status/60711577';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/status/60711577'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "report": {
            "_id": 60711577,
            "recipient": "233249706365",
            "message": "API messaging is fun!",
            "sender": "mNotify",
            "status": "DELIVERED",
            "date_sent": "2018-03-08 10:19:35",
            "campaign_id": "7FE4A62A-96EB-4755-BC57-000A38C8C6EF",
            "retries": 0
        }
    }
    

    This endpoint retrieves delivery report for a specific SMS sent with the id as parameter

    HTTP Request

    GET https://api.mnotify.com/api/status/<id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of message sent

    Periodic Delivery Report

    curl -X GET "https://api.mnotify.com/api/report?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/report?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/report?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "report": [
            {
                "_id": 60711577,
                "recipient": "233249706365",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:19:35",
                "campaign_id": "7FE4A62A-96EB-4755-BC57-000A38C8C6EF",
                "retries": 0
            },
            {
                "_id": 60711578,
                "recipient": "233203698970",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:19:35",
                "campaign_id": "7FE4A62A-96EB-4755-BC57-000A38C8C6EF",
                "retries": 0
            },
            {
                "_id": 60720487,
                "recipient": "233249706365",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:37:31",
                "campaign_id": "6C00C80E-C169-4F1F-A4DC-2407C1E729D3",
                "retries": 0
            },
            {
                "_id": 60720488,
                "recipient": "233203698970",
                "message": "API messaging is fun!",
                "sender": "mNotify",
                "status": "DELIVERED",
                "date_sent": "2018-03-08 10:37:31",
                "campaign_id": "6C00C80E-C169-4F1F-A4DC-2407C1E729D3",
                "retries": 0
            }
        ],
        "total_contacts": 9,
        "total_charge": "9"
    }
    

    This endpoint retrieves delivery report in between specified dates

    HTTP Request

    GET https://api.mnotify.com/api/report

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    from Yes date date from in YYYY-MM-DD format
    to Yes date date to in YYYY-MM-DD format

    Voice Call Report

    curl -X GET "https://api.mnotify.com/api/calls/XRSzcFO74eHGCj6TrdZjVut8qDsXVi?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/calls/XRSzcFO74eHGCj6TrdZjVut8qDsXVi';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/calls/XRSzcFO74eHGCj6TrdZjVut8qDsXVi'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "report": [
            {
                "_id": "185447",
                "recipient": "233249706365",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 13:47:08",
                "total_duration": "0"
            },
            {
                "_id": "185448",
                "recipient": "233203698970",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 13:47:09",
                "total_duration": "0"
            }
        ]
    }
    

    This endpoint retrieves delivery report for voice calls sent earlier with id (campaign_id) of call returned when call was made

    HTTP Request

    GET https://api.mnotify.com/api/calls/<id>/<status>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes string id of campaign
    status No string status of delivery

    Specific Voice Call Report

    curl -X GET "https://api.mnotify.com/api/call-status/185447?key=YOUR_API_KEY"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/call-status/185447';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/call-status/185447'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "call": {
            "_id": "185447",
            "recipient": "233249706365",
            "campaign": "First Voice Campaign",
            "answer_time": "0000-00-00 00:00:00",
            "hang_up_time": "0000-00-00 00:00:00",
            "campaign_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
            "status": "pending",
            "retries": "0",
            "date_sent": "2018-03-08 13:47:08",
            "total_duration": "0"
        }
    }
    

    This endpoint retrieves call report for a specific voice call sent with the id as parameter

    HTTP Request

    GET https://api.mnotify.com/api/call-status/<id>

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    id Yes int id of call sent

    Periodic Voice Call Report

    curl -X GET "https://api.mnotify.com/api/call-period?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08"
    
    <?php
        $endPoint = 'https://api.mnotify.com/api/call-period?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08';
        $apiKey = 'YOUR_API_KEY';
        $url = $endPoint . '?key=' . $apiKey;
    
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $result = curl_exec($ch);
        $result = json_decode($result, TRUE);
        curl_close($ch);
    ?>  
    
    import requests
    
    endPoint = 'https://api.mnotify.com/api/call-period?key=YOUR_API_KEY&from=2018-03-08&to=2018-03-08'
    apiKey = 'YOUR_API_KEY'
    url = endPoint + '?key=' + apiKey
    response = requests.get(url)
    data = response.json()
    

    The above command returns JSON structured like this:

    {
        "status": "success",
        "call": [
            {
                "_id": "185449",
                "recipient": "233203698970",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "pj85z9u5odXqozOZOFuJwU88SYVN7j",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 14:25:40",
                "total_duration": "0"
            },
            {
                "_id": "185448",
                "recipient": "233203698970",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 13:47:09",
                "total_duration": "0"
            },
            {
                "_id": "185450",
                "recipient": "233249706365",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "pj85z9u5odXqozOZOFuJwU88SYVN7j",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 14:25:41",
                "total_duration": "0"
            },
            {
                "_id": "185447",
                "recipient": "233249706365",
                "campaign": "First Voice Campaign",
                "answer_time": "0000-00-00 00:00:00",
                "hang_up_time": "0000-00-00 00:00:00",
                "campaign_id": "XRSzcFO74eHGCj6TrdZjVut8qDsXVi",
                "status": "pending",
                "retries": "0",
                "date_sent": "2018-03-08 13:47:08",
                "total_duration": "0"
            }
        ]
    }
    

    This endpoint retrieves voice call report in between specified dates

    HTTP Request

    GET https://api.mnotify.com/api/call-period

    Query Parameters

    Parameter Required Type Description
    key Yes string Your enabled api key
    from Yes date date from in YYYY-MM-DD format
    to Yes date date to in YYYY-MM-DD format

    Response Codes

    The mNotify API uses the following generic status codes:

    Status Code Meaning
    400 Bad Request
    401 Unauthorized
    403 Forbidden
    404 Not Found
    405 Method Not Allowed
    429 Too Many Requests.
    500 Internal Server Error.
    503 Service Unavailable.

    There are also customized response codes and meaning:

    Status Code Meaning
    2000 messages/voice call sent successfully
    2001 message/voice call has been successfully scheduled
    4001 the recipient field, sender field and message field must not be empty
    4002 make sure schedule date is not empty when is_schedule field is true
    4003 the sender must not be greater than 11 in length
    4004 credit is not enough to send message to recipients
    4005 the scheduled time should be more than an hour from now
    4006 either message field or message_id field should be empty
    4007 message id provided does not exist
    4008 either some of the groups has no contacts or group does not exist
    4009 either voice file or voice_id field should be empty (only one should not be empty)
    4010 file size should not be greater than 5MB
    4011 an error occurred when uploading the file. try again
    4012 the bit rate of the voice is too high to be sent to a phone.
    4013 voice id does not exist