## DESCRIPTION
* Documentation of bulk sms checks, approval and rescheduling APIs for internal tool.

## ENDPOINTS
* `https://p-bulk-sms-internal.snwolley.com/senderid`        : returns approved sender ids.

* `https://p-bulk-sms-internal.snwolley.com/balance-checks`  : balance checks on deywuro user accounts.

* `https://p-bulk-sms-internal.snwolley.com/sendsms`         : sends sms and otp-codes for user job approval.

* `https://p-bulk-sms-internal.snwolley.com/resend/otp`      : resend otp codes. 

* `https://p-bulk-sms-internal.snwolley.com/bulk/info`       : rescheduling of p-bulk sms user jobs.

## REQUESTS
* `https://p-bulk-sms-internal.snwolley.com/senderid`  
    + #### POST REQUEST EXAMPLE (PYTHON)
   ```
        json_payload = {
       "user_id" : ""     # user_id
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/senderid", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "sender_ids": [
            "ABSA BANK",
            "Absa Bank"
        ]
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | ok
             404     | sender id does not exist

   ```

* `https://p-bulk-sms-internal.snwolley.com/balance-checks`  
    + #### POST REQUEST EXAMPLE (PYTHON)

   ```
        json_payload = {
       "user_id" : "",           # user_id
       "username" : "",          # username
       "sender_id" : "",         # sender_id    
       "campaign_name" : "",     # sms campaign name
       "message" : "",           # message
       "file_path" : "",         # filepath of records
       "remove_duplicate" : "",  # remove duplicate
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/balance-checks", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "data": "Enough Balance",
        "sms_count" : 306,
        "total_traffic": 2
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | ok
             400     | Insufficient Balance
             404     | File not found
             500     | Query failed
            
   ```

* `https://p-bulk-sms-internal.snwolley.com/sendsms`  
    + #### POST REQUEST EXAMPLE (PYTHON)
   ```
       json_payload = {
       "user_id" : "",         # user_id
       "username" : "",        # username
       "destination" : "",     # phonenumber
       "url" : "",             # generated url link to internal tool dashboard
       
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/sendsms", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "success": "Link and OTP-code sent",
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | ok
             400     | Message not delivered
             500     | Query failed
            
   ```

* `https://p-bulk-sms-internal.snwolley.com/resend/otp`  
    + #### POST REQUEST EXAMPLE (PYTHON)
   ```
        json_payload = {
       "destination" : ""     # phonenumber
       
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/resend/otp", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "success": "OTP-code sent",
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | ok
             400     | OTP-code not delivered
             500     | Query failed
            
   ```

* `https://p-bulk-sms-internal.snwolley.com/validate/otp`  
    + #### POST REQUEST EXAMPLE (PYTHON)
   ```
        json_payload = {
       "otp_code" : ""     # otp_code
       
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/validate/otp", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "success": "Valid code",
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | Valid code
             500     | Invalid code
            
   ```

* `https://p-bulk-sms-internal.snwolley.com/bulk/info`  
    + #### POST REQUEST EXAMPLE (PYTHON)
   ```
        json_payload = {
       "user_id" : "",                       # user_id
       "username" : "",                      # username
       "sender_id" : "",                     # sender_id
       "campaign_name": "",                  # bulk, group, p-bulk
       "message": "",                        # message
       "total_traffic" : "",                 # total traffic
       "sms_count' : "",                     # sms count
       "file_path" : "",                     # path of saved records
       "sched_datetime" : "",                # blast schedule
       "approval_status" : "approved",       # user job approval status
       "created_by" : "",                    # job created by
       "created_at" : "",                    # time job was created
       "message_type" : "",                  # text/flash
       
   }
      req = requests.post("https://p-bulk-sms-internal.snwolley.com/bulk/info", json=json_payload)   
   ```
   + #### RESPONSE EXAMPLE
   ```
        {
        "code": 200,
        "success": "Message Queued",
        }
   ```
   + #### RESPONSE CODES
   ```
        response code|response
        -------------|-------------
             200     | ok
             400     | user job has not been approved
             404     | user job does not exist
            
   ```