openapi: 3.0.0
servers:
  - url: "https://sms.arkesel.com"
info:
  title: ""
  version: ""
  description: |-
    # Get Started
    <img src="../images/arkesel-get-started.svg" style="width:60%; margin-left:20%; margin-right:20%;"/>
    Arkesel’s RESTful APIs are the easiest way to build high-quality communication applications on the cloud. Integrate
    Arkesel’s services into your software and transform your messaging and engagement experience. You can send alerts,
    reminders and notification via SMS and Voice, and verify your users using a one-time password and check your SMS status.
    This API documentation provides you with comprehensive guides and documentation to help you get started, with samples
    codes in Java, PHP and Node.js.

    ### **Our SMS APIs**
    Interact with your customers using the most effective way of communication out there: SMS. Our SMS API is super
    developer-friendly and allows integration with your systems, and ensure there is no significant learning curve.
    You can access our platform to build and send out your campaigns and see each campaign's results separately.

    ### **Our Voice APIs**
    Stay in touch with your customers directly and in the most impactful way through perfectly recorded and communicated
    Voice messages. Our Voice SMS APIs are the best in the industry.

    ### **Our Phone Verification APIs**
    Make your users feel secure with a one-time password. Generate a one-time password within 2 seconds to verify customer
    identity and transactions using SMS and Voice. Verifying users' identity is essential in preventing fraud and securing
    accounts from compromise.

    ### **USSD APIs**
    Develop and engage with your audience directly and maintain a two-way communication channel with our USSD. Your
    client can request important information such as balance inquiry, transaction updates, package details, answering questioners amongst others.

    ### **Sandbox Environment**
    Our messaging APIs provide a sandbox environment for testing without affecting your balance. You can send unlimited
    messages in the sandbox environment.

    ## Create an Account
    To get started, sign up for an Arkesel account if you don’t already have one. Head over to [Arkesel](https://account.arkesel.com/signup),
    and sign up for a free user account. Begin by completing all the required fields, continue by verifying your phone number,
    and check your inbox for the verification email. After creating an account, you will receive ten (10) free SMS credits
    and GHC 0.20 Main credit that you can use to test Arkesel’s APIs.

    ## API Key
    To use Arkesel’s APIs, you’ll need to provide an API access key. To create your live API access key, go to the
    [Arkesel Dashboard](https://sms.arkesel.com/dashboard), navigate to [SMS API](https://sms.arkesel.com/user/sms-api/info)
    using the left sidebar navigation. Here, you can generate a new Main API key and also manage Multiple API Keys. Multiple
    API Keys is based on the idea that users may need sub-keys to limit or monitor usage and access the account without
    exposing existing keys or other use cases. For instance, a user may decide to create a sub-key for each school that
    uses the School Management System developed by the user. If you’re having any issues creating your API key, please
    reach out to [support@arkesel.com](mailto:support@arkesel.com).

    ## Account Top-up
    To top-up your SMS account, navigate to [Recharge - Purchase SMS Plan](https://sms.arkesel.com/user/sms/purchase-sms-plan).
    Choose a plan that is best for you, either expiry or non-expiry. To recharge your Main Balance navigate to
    [Recharge - Main Balance Top Up](https://sms.arkesel.com/user/billing/make-payment). You choose your desired amount,
    proceed to checkout and select your payment method. Your Main Balance is billed for Voice and OTP services.
  contact:
    email: support@arkesel.com
    name: Arkesel
    url: "https://arkesel.com"
  x-logo:
    url: ../images/arkesel.png
    backgroundColor: "#FFFFFF"
    altText: Arkesel Logo
tags:
  - name: SMS V1
    description: |-
      In version 1, api_key is been passed as a ***Query Parameter***

      ## Status Responses(V1)
      - OK - Successfully Sent
      - 100 - Bad gateway request
      - 101 - Wrong action
      - 102 - Authentication failed
      - 103 - Invalid phone number
      - 104 - Phone coverage not active
      - 105 - Insufficient balance
      - 106 - Invalid Sender ID
      - 109 - Invalid Schedule Time
      - 111 - SMS contains spam word. Wait for approval
  - name: SMS V2
    description: |-
      In version 2, ***api key*** is been passed as ***Header Parameter***
      ## Status Responses(V2)
      - 200 - Successfully Sent
      - 401 - Authentication failed
      - 402 - Insufficient balance
      - 403 - Inactive Gateway
      - 422 - Validation Errors
      - 500 - Internal error
  - name: Voice
    description: |-
      ## Status Responses(Voice)
      - 200 - Successfully Sent
      - 401 - Authentication failed
      - 402 - Insufficient balance
      - 403 - Inactive Gateway
      - 422 - Validation Errors
      - 500 - Internal error
  - name: WhatsApp Business API
    description: |-
      ## Status Responses
      - 200 - Success
      - 400 - Token required
      - 401 - Invalid token
      - 404 - Plan not found
      - 500 - An error occurred during authentication
  - name: One Time Password (OTP)
    description: |-
      ## Status Responses(OTP)
      - 401 - Authentication failed (Missing or Invalid key)
      - 422 - Validation error (Missing required field)
      - 500 - Internal error

      #### Generate OTP
      - 1000 - Successful, Message delivered
      - 1001 - Validation error (Missing required field)
      - 1002 - Message must contain a slot for otp code, like %otp_code%
      - 1003 - This Sender ID have Blocked By Administrator
      - 1004 - SMS gateway not active or credential not found
      - 1005 - Invalid phone number
      - 1006 - OTP is not allowed in your Country
      - 1007 - Insufficient balance
      - 1008 - Insufficient balance
      - 1009 - You can not send more than 500 characters using voice medium
      - 1011 - Internal error

      #### Verify OTP
      - 1100 - Successful
      - 1101 - Validation error (Missing required field)
      - 1102 - Invalid phone number
      - 1103 - Invalid phone number
      - 1104 - Invalid code
      - 1105 - Code has expired
      - 1106 - Internal error
  - name: Voice Connect API
    servers: 
      - url: https://ivrsys.arkesel.com/
    description: |-
      ***api key*** is been passed as ***Header Parameter***
      ## Status Responses
      - 201 - Success
      - 401 - Invalid API Key
      - 404 - Survey campaign log not found
      - 500 - An error occurred during survey campaign creation
  - name: Overview
    description: |
      ## Introduction
      USSD is one of the few truly inclusive mobile technologies available. USSD allows faster communication between the user and the client application. It is not device-dependent and can be operated without any form of activation taking place.

      The process flow for a USSD session begins when a user dials a USSD code, e.g. ```*928*99#``` from their mobile phone. This is similar to a request made when checking airtime or data balance.

      Processing USSD requests using ARKESEL's API is very fluid once your account is set up. The USSD API allows developers to create and structure applications to suit the use case for every business.

      You can dowload our <a href="https://play.google.com/store/apps/details?id=com.arkesel.mobile.simulator" target="_blank">USSD Simulator App</a> to increase the speed of your development

      ## Why is USSD Preferred
      * It is accessible on all cellular networks and mobile handsets.
      * It can be easily used in collecting customer feedback.
      * It can be applied during polls for voting in real-time.
      * Very useful for Financial Services such as Mobile Banking and Balance Enquiry.
      * It can be used for Two-factor authentication.

      ## How it Works

        ![how-it-works](../images/ussd-overview.png)

      * Arkesel initiates a request with a ```newSession```  value ```true``` to the URL provided during the setup.
      * You work with the data and return a response in JSON format to Arkesel to display to the user with a ```continueSession``` set to ```true``` if you are expecting the session to continue or with ```false``` to close the session.

      ## USSD FAQ’S

      ### What is a USSD?
      USSD (Unstructured Supplementary Service Data) is an interactive technology that serves to send text between a mobile phone and an application programme in a network. Some of these services are:
      * Airtime and Internet Bundle Top-ups.
      * Account Balance checking.
      * Mini Statements Delivery.
      * Voting and Surveys.
      * Utility Services.
      * Two-factor Authentication.
      * The format is confined by * and # at the beginning and end of the series of digits.

      ### How do I get a USSD shortcode?
      Kindly sign up if you have no account and make a request <a href="https://account.arkesel.com/signup" target="_blank">here </a>.

      ### How do I pay for the USSD code?
      You can make payment via mobile money, bank transfer and other available channels on our platform after <a href="https://account.arkesel.com/signup" target="_blank">Sign Up </a>.

      ### Where can I get sample codes?
      We have alot of sample codes available for different languages <br>
      <a href="https://github.com/ArkeselDev/php-ussd-sample" target="_blank">PHP Sample Code </a> <br>
      <a href="https://github.com/ArkeselDev/laravel-ussd-sample" target="_blank">Laravel Sample Code </a> <br>
      <a href="https://github.com/ArkeselDev/fastapi-ussd-sample" target="_blank">Python/FastApi Sample Code </a> <br>
      <a href="https://github.com/ArkeselDev/DotnetUssdSample" target="_blank">.NET/C# Sample Code </a> <br>
      <a href="https://github.com/ArkeselDev/express-ussd-sample" target="_blank">Node/Express Sample Code </a> <br>

      Don't forget to give the repo a star on Github! :):)
  - name: API Reference
    description: |
      ## Requirements for USSD setup

      To successfully complete the integration, the following details are required as described in the table below:

      | Requirement | Description |
      |-------------|-------------|
      |Arkesel Account| You need to have an existing account with Arkesel. If you don’t have one, click <a href="https://account.arkesel.com/signup" target="_blank">here </a>to create one.|
      |Endpoint URL |This is the URL all USSD requests data for your registered extension will be routed.  The URL is provided during the subscription process.|

      NOTE:
      * All requests will be submitted by the ```HTTP POST``` Method.
      * All REQUEST DATA will be in ```JSON``` format.
      * All RESPONSE DATA is expected to be in ```JSON``` format.
  - name: KOVA-IQ
    description: |
      ## Introduction
      KOVA-IQ is a customer experience and relationship management system developed by Arkesel that empowers businesses with comprehensive customer engagement tools. The KOVA-IQ APIs provide programmatic access to KOVA-IQ's ticketing and customer management capabilities.
    
      ## Authentication
      Authentication is required for all API endpoints using an API Key passed as `X-API-Token` in the request headers. You can generate your API Key from the KOVA-IQ platform by navigating to Settings > API Configuration.
      
      Example Header:
      X-API-Token: your-api-key-here

      ## Status Responses
      - 200 - Success
      - 201 - Created
      - 400 - Bad Request
      - 401 - Unauthorized
      - 404 - Not Found
      - 422 - Validation Error
      - 500 - Internal Server Error
x-tagGroups:
  - name: Messaging
    tags:
      - SMS V1
      - SMS V2
      - Voice
  - name: Phone Verification
    tags:
      - One Time Password (OTP)
  - name: USSD Section
    tags:
      - Overview
      - API Reference
  - name: WhatsApp
    tags:
      - WhatsApp Business API
  - name: Voice Connect
    servers: 
      - url: https://ivrsys.arkesel.com/
    tags:
      - Voice Connect API
  - name: KOVA-IQ
    servers: 
      - url: "{baseUrl}/api"
        description: "API Server"
        variables:
          baseUrl:
            default: "https://app-crm.arkesel.com/"
            description: "Base URL for the API server"
            # enum:
            #   - "https://app-crm.arkesel.com/"
            #   - "https://staging-api.kova-iq.com"
    tags:
      - KOVA-IQ
paths:
  /sms/api?action=send-sms:
    get:
      summary: Send SMS
      tags:
        - SMS V1
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SEND-SMS-RESPONSE"
              examples:
                SEND SMS:
                  value:
                    code: ok
                    message: Successfully Sent
                    balance: 1185
                    main_balance: 2.974
                    user: Arkesel Dev
      x-codeSamples:
        - lang: JAVA
          source: |2-
             /* SEND SMS */
            OkHttpClient client = new OkHttpClient().newBuilder() .build();
            Request request = new Request.Builder()
            .get()
            .url("https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=233544919953&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!")
            .build();
            /* When terminating traffic to Nigerian contacts, you are required to specify the use_case field */
            /* that means the complete url will look like this | */
            /* "https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=2349541111111&from=Arkesel&use_case=promotional&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!" */
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests

            def send_sms(api_key, message, sender_id, phone_number):
                base_url = f"https://sms.arkesel.com/sms/api?action=send-sms&api_key={api_key}&from={sender_id}"
                sms_url = base_url + f"&to={phone_number}&sms={message}"
                ## When terminating sms traffic to Nigerian contacts, you are required to specify the use_case to the fields submitted
                ## ie.|   sms_url = base_url + f"&to={phone_number}&sms={message}&use_case=transactional"
                response = requests.get(sms_url)
                response_json = response.json()
                return response_json

            api_key = "cE9QRUkdjsjdfjkdsj9kdiieieififiw="
            message = "233544919953"
            sender_id = "Arkesel"
            phone_number = "Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!"

            send_sms(api_key, message, sender_id, phone_number)

        - lang: PHP
          source: |
            <?php
            // SEND SMS
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=233544919953&from=Arkesel&sms=Hello%20world.%20Spreading%20peace%20and%20joy%20only.%20Remeber%20to%20put%20on%20your%20face%20mask.%20Stay%20safe!',
            # When sending SMS to Nigerian contacts, the use_case field is required |
            # CURLOPT_URL => 'https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=2349541111111&from=Arkesel&use_case=promotional&sms=Hello%20world.%20Spreading%20peace%20and%20joy%20only.%20Remeber%20to%20put%20on%20your%20face%20mask.%20Stay%20safe!',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET', ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            // SEND SMS
            const axios = require('axios');
            axios.get('https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=233544919953&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!')
            /* When terminating sms traffic to Nigerian contacts, you are required to specify the use_case to the fields submitted */
            /* axios.get('https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=2349541111111&use_case=promotional&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!') */
            .then(response => console.log(response))
            .catch(error => console.log(error));
      operationId: send_sms_v1
      description: |
        This operation is used to send SMS to a single phone number or muliple phone numbers.

        ### NOTE
        - To send to multiple phone numbers, separate the phone numbers with a comma (,) when assigning them to the 'to' parameter.
        - Ensure that parameters with special characters (e.g., #, *, %, emojis like 👨🏼‍💻) are **URL-encoded** to prevent issues during HTTP requests.
        - The SMS sent via Api will be delivered to the receiver shortly after the request is sent. You can check your SMS dashboard to view your SMS history and the status of each SMS sent.

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND-SMS"
            examples:
              SEND SMS:
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "233544919953"
                  from: Arkesel
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
              MULTIPLE PHONE NUMBERS:
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "233544919953,233544919953,233544919953"
                  from: Arkesel
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
              SEND SMS (NIGERIAN CONTACTS):
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "2349150000000,2349150100000"
                  from: ArkeselNG
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
                  use_case: promotional
        description: ""
    parameters:
      - name: api_key
        in: query
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /sms/api?schedule=####:
    get:
      summary: Send Schedule SMS
      tags:
        - SMS V1
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SCHEDULE-SMS-RESPONSE"
              examples:
                SEND SMS:
                  value:
                    code: ok
                    message: Successfully Sent
                    balance: 1185
                    main_balance: 2.974
                    user: Arkesel Dev
                SCHEDULE SMS:
                  value:
                    code: ok
                    message: SMS Scheduled successfully.
                    sms_balance: 1184
                    main_balance: 2.974
                    user: Arkesel Dev
                CHECK BALANCE:
                  value:
                    balance: 1185
                    user: Arkesel Dev
                    country: Ghana
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient().newBuilder() .build();
            Request request = new Request.Builder()
            .get()
            .url("https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUdCakRKskdkdjkdksflxSXF6dD0=&to=233544919953,233544919953&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!&schedule=13-01-2021 05:30 PM")
            .build();
            /* When terminating traffic to Nigerian contacts, you are required to specify the use_case field */
            /* that means the complete url will look like this | */
            /* "https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUkdjsjdfjkdsj9kdiieieififiw=&to=2349541111111&from=Arkesel&use_case=promotional&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!&schedule=13-01-2021 05:30 PM" */
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |-
            import requests

            def send_scheduled_sms(api_key, message, sender_id, phone_number, scheduled_time):
                base_url = f"https://sms.arkesel.com/sms/api?action=send-sms&api_key={api_key}&from={sender_id}"
                sms_url = base_url + f"&to={phone_number}&sms={message}&schedule={scheduled_time}"
                ## When terminating sms traffic to Nigerian contacts, you are required to specify the use_case to the fields submitted
                ## ie.|   sms_url = base_url + f"&to={phone_number}&sms={message}&schedule={scheduled_time}&use_case=transactional"
                response = requests.get(sms_url)
                response_json = response.json()
                return response_json


            # Example usage
            api_key = "cE9QRUkdjsjdfjkdsj9kdiieieififiw="
            message = "233544919953"
            sender_id = "Arkesel"
            phone_number = "Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!"
            scheduled_time = "13-01-2021 05:30 PM"

            send_scheduled_sms(api_key, message, sender_id, phone_number, scheduled_time)

        - lang: PHP
          source: |
            <?php

            // SCHEDULE SMS
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUdCakRKskdkdjkdksflxSXF6dD0=&to=233544919953,233544919953&from=Arkesel&sms=Hello%20world.%20Spreading%20peace%20and%20joy%20only.%20Remeber%20to%20put%20on%20your%20face%20mask.%20Stay%20safe!&schedule=13-01-2021%2005:30%20PM',
            # When sending SMS to Nigerian contacts, the use_case field is required |
            # CURLOPT_URL => 'https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUdCakRKskdkdjkdksflxSXF6dD0=&to=2349541111111,2349542222222&from=Arkesel&use_case=promotional&sms=Hello%20world.%20Spreading%20peace%20and%20joy%20only.%20Remeber%20to%20put%20on%20your%20face%20mask.%20Stay%20safe!&schedule=13-01-2021%2005:30%20PM',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET',
            ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            // SCHEDULE SMS
            const axios = require('axios');
            axios.get('https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUdCakRKskdkdjkdksflxSXF6dD0=&to=233544919953,233544919953&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!&schedule=13-01-2021 05:30 PM')
            /* When terminating sms traffic to Nigerian contacts, you are required to specify the use_case to the fields submitted */
            /* axios.get('https://sms.arkesel.com/sms/api?action=send-sms&api_key=cE9QRUdCakRKskdkdjkdksflxSXF6dD0=&to=2349541111111,2349542222222&use_case=transactional&from=Arkesel&sms=Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!&schedule=13-01-2021 05:30 PM') */
            .then(response => console.log(response))
            .catch(error => console.log(error));
      operationId: send_schedule_sms_v1
      description: |
        This operation is used to schedule SMS to a **single phone number** or **muliple phone numbers**.

        ### NOTE
        - To send to multiple phone numbers, separate the phone numbers with a comma (,) when assigning them to the 'to' parameter.
        - Ensure that parameters with special characters (e.g., #, *, %, emojis like 👨🏼‍💻) are **URL-encoded** to prevent issues during HTTP requests.
        - The SMS sent via Api will be delivered to the receiver shortly after the request is sent. You can check your SMS dashboard to view your SMS history and the status of each SMS sent.

      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SCHEDULE-SMS"
            examples:
              SCHEDULE SMS:
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "233544919953"
                  from: Arkesel
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
                  schedule: "13-01-2021 05:30 PM"
              MULTIPLE PHONE NUMBERS:
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "233544919953,233544919953,233544919953"
                  from: Arkesel
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
                  schedule: "13-01-2021 05:30 PM"
              SEND SMS (NIGERIAN CONTACTS):
                value:
                  action: send-sms
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  to: "2349150000000,2349150100000"
                  from: ArkeselNG
                  sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
                  use_case: promotional
                  schedule: "13-01-2021 05:30 PM"
        description: ""
    parameters:
      - name: api_key
        in: query
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /sms/api?action=check-balance:
    get:
      summary: Check balance
      tags:
        - SMS V1
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CHECK-BALANCE-RESPONSE"
              examples:
                CHECK BALANCE:
                  value:
                    balance: 1185
                    user: Arkesel Dev
                    country: Ghana
      x-codeSamples:
        - lang: JAVA
          source: |
            OkHttpClient client = new OkHttpClient().newBuilder() .build();
            Request request = new Request.Builder()
            .get()
            .url("https://sms.arkesel.com/sms/api?action=check-balance&api_key=cE9QRUdCskdjsfiwi329ehfidhXF6dD0=&response=json")
            .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests

            client = requests.Session()

            url = "https://sms.arkesel.com/sms/api"
            params = {
                "action": "check-balance",
                "api_key": "cE9QRUdCskdjsfiwi329ehfidhXF6dD0=",
                "response": "json"
            }

            try:
                response = client.get(url, params=params)
                response.raise_for_status()  # Raise an exception for non-2xx responses
                print(response.text)  # Print the response content
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |
            <?php
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/sms/api?action=check-balance&api_key=cE9QRUdCskdjsfiwi329ehfidhXF6dD0=&response=json%0A%0A',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET',
            ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |
            const axios = require('axios');
            axios.get('https://sms.arkesel.com/sms/api?action=check-balance&api_key=cE9QRUdCskdjsfiwi329ehfidhXF6dD0=&response=json')
            .then(response => console.log(response))
            .catch(error => console.log(error));
      operationId: check_balance_v1
      description: |
        This operation used to check the SMS balance for an account.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CHECK-BALANCE"
            examples:
              CHECK BALANCE:
                value:
                  action: check-balance
                  api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
                  response: json
        description: ""
    parameters:
      - name: api_key
        in: query
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /contacts/api:
    get:
      summary: Save contact
      tags:
        - SMS V1
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                description: ""
                type: object
                properties:
                  code:
                    type: string
                    minLength: 1
                  message:
                    type: string
                    minLength: 1
                required:
                  - code
                  - message
              examples:
                Save Contact:
                  value:
                    code: "105"
                    message: You already subscribed
      x-codeSamples:
        - lang: JAVA
          source: |2-
             OkHttpClient client = new OkHttpClient().newBuilder().build();
            Request request = new Request.Builder()
            .get()
            .url("https://sms.arkesel.com/contacts/api?action=subscribe-us&api_key=cE9QRUdCakRksjdksdjisfiwieff&phone_book=Most Recent Customers&phone_number=233544919953&first_name=Arkesel&last_name=Dev&email=support@arkesel.com&company=Arkesel")
            .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests

            client = requests.Session()

            url = "https://sms.arkesel.com/contacts/api"
            params = {
                "action": "subscribe-us",
                "api_key": "cE9QRUdCakRksjdksdjisfiwieff",
                "phone_book": "Most Recent Customers",
                "phone_number": "233544919953",
                "first_name": "Arkesel",
                "last_name": "Dev",
                "email": "support@arkesel.com",
                "company": "Arkesel"
            }

            try:
                response = client.get(url, params=params)
                response.raise_for_status()  # Raise an exception for non-2xx responses
                print(response.text)  # Print the response content
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |2-
             <?php
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/contacts/api?action=subscribe-us&api_key=cE9QRUdCakRksjdksdjisfiwieff&phone_book=Most%20Recent%20Customers&phone_number=233544919953&first_name=Arkesel&last_name=Dev&email=support@arkesel.com&company=Take%20Care%20Inc.',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET', ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            axios.get('https://sms.arkesel.com/contacts/api?action=subscribe-us&api_key=cE9QRUdCakRksjdksdjisfiwieff&phone_book=Most Recent Customers&phone_number=233544919953&first_name=Arkesel&last_name=Dev&email=support@arkesel.com&company=Arkesel')
            .then(response => { console.log(response); })
            .catch(error => { console.log(error); });
      operationId: add_contact
      description: |
        This operation is used to save customer phone numbers or personal contacts to a contact group.

        ### NOTE:
        - The contact group must be present in order to add contact details
        - You can find your contact groups in the 'Bulk SMS > Contacts' section of your dashboard.

      security:
        - api_key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CONTACT-SAVE"
            examples:
              ADD CONTACT:
                value:
                  action: subscribe-us
                  api_key: cE9QRUdCakRksjdksdjisfiwieff
                  phone_book: string
                  phone_number: "233544919953"
                  first_name: Arkesel
                  last_name: Dev
                  email: support@arkesel.com
                  company: Arkesel.
        description: ""
    parameters:
      - name: api_key
        in: query
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms/send:
    post:
      summary: Send SMS
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                description: ""
                anyOf:
                  - $ref: "#/components/schemas/MESSAGE_RESPONSE"
                  - $ref: "#/components/schemas/SEND_SMS_WITH_DELIVERY_WEBHOOK_RESPONSE"
              examples:
                SEND SMS:
                  value:
                    status: success
                    data:
                      - recipient: "233544919953"
                        id: 9b752841-7ee7-4d40-b4fe-768bfb1da4f0
                      - recipient: "233544919953"
                        id: 7ea01acd-485c-4df3-b646-e9e24430e145
                      - invalid numbers: ["22354674948"]
                SEND SCHEDULED SMS:
                  value:
                    status: success
                    message: SMS request sent successfully!
                SEND SMS WITH DELIVERY WEBHOOK:
                  value:
                    status: success
                    data:
                      - recipient: "233544919953"
                        id: 9b752841-7ee7-4d40-b4fe-768bfb1da4f0
                      - recipient: "233544919953"
                        id: 7ea01acd-485c-4df3-b646-e9e24430e145
        "402":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Insufficient balance or invalid coverage!
        "403":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Inactive SMS Gateway!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The message field is required.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: SMS request failed!
      x-codeSamples:
        - lang: JAVA
          source: |2-
             /* SEND SMS */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            List<String> recipients = Arrays.asList("233553995047","233544919953");
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Hello world");
            requestBody.put("message", "Welcome to Arkesel SMS API v2. Please enjoy the experience.");
            requestBody.put("recipients", recipients.toString());
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

            /* SCHEDULE SMS */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            List<String> recipients = Arrays.asList("233553995047","233544919953");
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Hello world");
            requestBody.put("message", "Welcome to Arkesel SMS API v2. Please enjoy the experience.");
            requestBody.put("recipients", recipients.toString());
            requestBody.put("scheduled_date", "2021-03-17 07:00 AM");
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

            /* SEND SMS WITH DELIVERY WEBHOOK */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            List<String> recipients = Arrays.asList("233553995047","233544919953");
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Hello world");
            requestBody.put("message", "Welcome to Arkesel SMS API v2. Please enjoy the experience.");
            requestBody.put("recipients", recipients.toString());
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            requestBody.put("callback_url", "https://google.com");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            base_url = "https://sms.arkesel.com/api/v2/sms/send"

            recipients = ["233553995047", "233544919953"]

            # SEND SMS
            sms_payload = {
                "sender": "Hello world",
                "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                "recipients": recipients
                # When sending SMS to Nigerian recipients, specify the use_case field
                # "use_case": "promotional"
            }

            try:
                response = client.post(base_url, headers=headers, json=sms_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

            # SCHEDULE SMS
            schedule_payload = {
                "sender": "Hello world",
                "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                "recipients": recipients,
                "scheduled_date": "2021-03-17 07:00 AM"
                # When sending SMS to Nigerian recipients, specify the use_case field
                # "use_case": "promotional"
            }

            try:
                response = client.post(base_url, headers=headers, json=schedule_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

            # SEND SMS WITH DELIVERY WEBHOOK
            webhook_payload = {
                "sender": "Hello world",
                "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                "recipients": recipients,
                "callback_url": "https://google.com"
                # When sending SMS to Nigerian recipients, specify the use_case field
                # "use_case": "promotional"
            }

            try:
                response = client.post(base_url, headers=headers, json=webhook_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |
            <?php
            // SEND SMS
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Helloworld',
                    'message' => 'Welcome to Arkesel SMS API v2. Please enjoy the experience.',
                    'recipients' => ['233542336719', '233268155768', '22354674948'],
                    // When sending SMS to Nigerian recipients, specify the use_case field
                    // 'use_case' => 'transactional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;


            // SCHEDULE SMS
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Helloworld',
                    'message' => 'Welcome to Arkesel SMS API v2. Please enjoy the experience.',
                    'recipients' => ['233542336719', '233268155768'],
                    'scheduled_date' => '2021-03-17 07:00 AM',
                    // When sending SMS to Nigerian recipients, specify the use_case field
                    // 'use_case' => 'transactional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;

            // SEND SMS WITH DELIVERY WEBHOOK
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Helloworld',
                    'message' => 'Welcome to Arkesel SMS API v2. Please enjoy the experience.',
                    'recipients' => ['233542336719', '233268155768'],
                    'callback_url' => 'https://google.com',
                    // When sending SMS to Nigerian recipients, specify the use_case field
                    // 'use_case' => 'transactional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |2-
             // SEND SMS
             const axios = require('axios');
             const data = {"sender": "Hello world",
                          "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                          "recipients": ["233553995047","233544919953"],
                          // When sending SMS to Nigerian recipients, specify the use_case field
                          // "use_case" = "transactional"
                        };

             const config = {
               method: 'post',
               url: 'https://sms.arkesel.com/api/v2/sms/send',
               headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
               },
               data : data
             };

             axios(config)
             .then(function (response) {
               console.log(JSON.stringify(response.data));
             })
             .catch(function (error) {
               console.log(error);
             });

            // SCHEDULE SMS
            const axios = require('axios');
            const data = {"sender": "Hello world",
                          "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                          "recipients": ["233553995047","233544919953"],
                          "scheduled_date": "2021-03-17 07:00 AM",
                          // When sending SMS to Nigerian recipients, specify the use_case field
                          // "use_case" = "transactional"
                          };

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/send',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });

            // SEND SMS WITH DELIVERY WEBHOOK
            const axios = require('axios');
            const data = {"sender": "Hello world",
                          "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                          "recipients": ["233553995047","233544919953"],
                          "callback_url": "https://google.com",
                          // When sending SMS to Nigerian recipients, specify the use_case field
                          // "use_case" = "transactional"
                        };

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/send',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: send_sms
      description: |
        This operation is used to SEND SMS, SCHEDULE SMS and SEND SMS WITH DELIVERY WEBHOOK by specifying the action parameter in request.

        ### 1. SEND SMS
         This operation is used to send SMS to a  single phone number or multiple phone numbers.

        ### 2. SCHEDULE SMS
         This operation is used to schedule SMS to a single phone number or multiple phone numbers.

        ### 3. SEND SMS WITH DELIVERY WEBHOOK
        This operation is used to send SMS and request a delivery report using a delivery webhook. The system pushes
        the delivery status of the message to the webhook.

        ### 4. SEND SANDBOXED SMS
        This operation is used to send a test SMS request to the system. You are not billed for this operation. Messages
        sent in a sandboxed environment are not forwarded to the mobile network providers for delivery. Sandbox messages
        can only be seen from the SMS history report. This is a great environment to test your application without any cost.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_SMS"
            examples:
              SEND SMS:
                value:
                  sender: Arkesel
                  message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
                  recipients:
                    - "233544919953"
                    - "233544919953"
              SCHEDULE SMS:
                value:
                  sender: Arkesel
                  message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
                  recipients:
                    - "233544919953"
                    - "233544919953"
                  scheduled_date: "2021-04-09 07:30 AM"
              SEND SMS WITH DELIVERY WEBHOOK:
                value:
                  sender: Arkesel
                  message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
                  recipients:
                    - "233544919953"
                    - "233544919953"
                  callback_url: "https://webhook.site/sms/delivery_webhook"
              SEND SMS TO (NIGERIAN CONTACTS):
                value:
                  sender: Arkesel
                  message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
                  recipients:
                    - "233544919953"
                    - "233544919953"
                  use_case: promotional
              SEND SANDBOXED SMS:
                value:
                  sender: Arkesel
                  message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
                  recipients:
                    - "233544919953"
                    - "233544919953"
                  sandbox: true
        description: ""
      parameters: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms/template/send:
    post:
      summary: Send SMS using Template
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                description: ""
                anyOf:
                  - $ref: "#/components/schemas/MESSAGE_RESPONSE"
                  - $ref: "#/components/schemas/SEND_SMS_WITH_DELIVERY_WEBHOOK_RESPONSE"
              examples:
                SEND TEMPLATE SMS:
                  value:
                    status: success
                    data:
                      - recipient: "233544919953"
                        id: 9b752841-7ee7-4d40-b4fe-768bfb1da4f0
                      - recipient: "233544919953"
                        id: 7ea01acd-485c-4df3-b646-e9e24430e145
        "402":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Insufficient balance or invalid coverage!
        "403":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Inactive SMS Gateway!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The message field is required.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: SMS request failed!
      x-codeSamples:
        - lang: JAVA
          source: |2-
             /* SEND TEMPLATE SMS */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Map<String, Map<String, String>> recipients = new HashMap<>();

            // create array for first phoneNumber
            Map<String, String> recipientOne = new HashMap<>();
            recipientOne.put("name", "John Doe");
            recipientOne.put("hometown", "Techiman");
            // Put phoneNumber as index key in recipients
            recipients.put("233553995047", recipientOne);

            // Create array for second phoneNumber
            Map<String, String> recipientTwo = new HashMap<>();
            recipientTwo.put("name", "Adam");
            recipientTwo.put("hometown", "Cape Coast");
            // Put second phoneNumber as index key in recipients
            recipients.put("233544919953", recipientTwo);

            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Arkesel");
            requestBody.put("message", "Hello <%name%>, safe journey to <%hometown%> this Xmas");
            requestBody.put("recipients", recipients.toString());
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/template/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }


            /* SEND SCHEDULED TEMPLATE SMS */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Map<String, Map<String, String>> recipients = new HashMap<>();

            // create array for first phoneNumber
            Map<String, String> recipientOne = new HashMap<>();
            recipientOne.put("name", "John Doe");
            recipientOne.put("hometown", "Techiman");
            // Put phoneNumber as index key in recipients
            recipients.put("233553995047", recipientOne);

            // Create array for second phoneNumber
            Map<String, String> recipientTwo = new HashMap<>();
            recipientTwo.put("name", "Adam");
            recipientTwo.put("hometown", "Cape Coast");
            // Put second phoneNumber as index key in recipients
            recipients.put("233544919953", recipientTwo);

            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Arkesel");
            requestBody.put("message", "Hello <%name%>, safe journey to <%hometown%> this Xmas");
            requestBody.put("recipients", recipients.toString());
            requestBody.put("scheduled_date", "2023-03-17 12:00 PM");
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/template/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }


            /* SEND TEMPLATE SMS WITH DELIVERY WEBHOOK */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Map<String, Map<String, String>> recipients = new HashMap<>();

            // create array for first phoneNumber
            Map<String, String> recipientOne = new HashMap<>();
            recipientOne.put("name", "John Doe");
            recipientOne.put("hometown", "Techiman");
            // Put phoneNumber as index key in recipients
            recipients.put("233553995047", recipientOne);

            // Create array for second phoneNumber
            Map<String, String> recipientTwo = new HashMap<>();
            recipientTwo.put("name", "Adam");
            recipientTwo.put("hometown", "Cape Coast");
            // Put second phoneNumber as index key in recipients
            recipients.put("233544919953", recipientTwo);

            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Arkesel");
            requestBody.put("message", "Hello <%name%>, safe journey to <%hometown%> this Xmas");
            requestBody.put("recipients", recipients.toString());
            /* If sending SMS to Nigerian recipients, specify the use_case field  */
            /* requestBody.put("use_case", "promotional"); */
            requestBody.put("callback_url", "https://google.com");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/template/send")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            base_url = "https://sms.arkesel.com/api/v2/sms/template/send"

            recipients = {
                "233553995047": {"name": "John Doe", "hometown": "Techiman"},
                "233544919953": {"name": "Adam", "hometown": "Cape Coast"}
            }

            # SEND TEMPLATE SMS
            template_payload = {
                "sender": "Arkesel",
                "message": "Hello <%name%>, safe journey to <%hometown%> this Xmas",
                "recipients": recipients
                # When sending SMS to Nigerian recipients, specify the use_case field
                # "use_case": "promotional"
            }

            try:
                response = client.post(base_url, headers=headers, json=template_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

            # SEND SCHEDULED TEMPLATE SMS
            template_payload["scheduled_date"] = "2023-03-17 12:00 PM"

            try:
                response = client.post(base_url, headers=headers, json=template_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

            # SEND TEMPLATE SMS WITH DELIVERY WEBHOOK
            template_payload["callback_url"] = "https://google.com"

            try:
                response = client.post(base_url, headers=headers, json=template_payload)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |
            <?php
            // SEND SMS USING TEMPLATE
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/template/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Arkesel',
                    'message' => 'Hello <%name%>, safe journey to <%hometown%> this Xmas',
                    'recipients' => [
                          '233553995047' => ['name' => 'John Doe', 'hometown' => 'Techiman'],
                          '233544919953' => ['name' => 'Adam', 'hometown' => 'Cape Coast'],
                      ],
                      // When sending SMS to Nigerian recipients, specify the use_case field
                      // 'use_case' => 'promotional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;


            // SEND SCHEDULED TEMPLATE SMS
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/template/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Arkesel',
                    'message' => 'Hello <%name%>, safe journey to <%hometown%> this Xmas',
                    'recipients' => [
                          '233553995047' => ['name' => 'John Doe', 'hometown' => 'Techiman'],
                          '233544919953' => ['name' => 'Adam', 'hometown' => 'Cape Coast'],
                      ],
                    'scheduled_date' => '2023-03-17 12:00 PM',
                    // When sending SMS to Nigerian recipients, specify the use_case field
                    // 'use_case' => 'promotional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;


            // SEND TEMPLATE SMS WITH DELIVERY WEBHOOK
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/template/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'Arkesel',
                    'message' => 'Hello <%name%>, safe journey to <%hometown%> this Xmas',
                    'recipients' => [
                          '233553995047' => ['name' => 'John Doe', 'hometown' => 'Techiman'],
                          '233544919953' => ['name' => 'Adam', 'hometown' => 'Cape Coast'],
                      ],
                    'callback_url' => 'https://google.com',
                    // When sending SMS to Nigerian recipients, specify the use_case field
                    // 'use_case' => 'transactional'
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |2-
            // SEND TEMPLATE SMS
            const axios = require('axios');
            const data = {"sender": "Arkesel",
                        "message": "Hello <%name%>, safe journey to <%hometown%> this Xmas",
                        "recipients": [
                          "233553995047" = ["name" = "John Doe", "hometown" = "Techiman"],
                          "233544919953" = ["name" = "Adam", "hometown" = "Cape Coast"],
                        ],
                        // When sending SMS to Nigerian recipients, specify the use_case field
                        // "use_case" = "transactional"
                  };
            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/template/send',
              headers: {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });


            // SEND SCHEDULED TEMPLATE SMS
            const axios = require('axios');
            const data = {"sender": "Arkesel",
                        "message": "Hello <%name%>, safe journey to <%hometown%> this Xmas",
                        "recipients": [
                          "233553995047" = ["name" = "John Doe", "hometown" = "Techiman"],
                          "233544919953" = ["name" = "Adam", "hometown" = "Cape Coast"],
                        ],
                        "scheduled_date": "2023-03-17 12:00 PM",
                        // When sending SMS to Nigerian recipients, specify the use_case field
                        // "use_case" = "transactional"
                      };
            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/template/send',
              headers: {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });


            // SEND TEMPLATE SMS WITH DELIVERY WEBHOOK
            const axios = require('axios');
            const data = {"sender": "Arkesel",
                        "message": "Hello <%name%>, safe journey to <%hometown%> this Xmas",
                        "recipients": [
                          "233553995047" = ["name" = "John Doe", "hometown" = "Techiman"],
                          "233544919953" = ["name" = "Adam", "hometown" = "Cape Coast"],
                        ],
                        "callback_url": "https://google.com",
                        // When sending SMS to Nigerian recipients, specify the use_case field
                        // "use_case" = "transactional"
                      };
            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/template/send',
              headers: {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: send_template_sms
      description: |
        This operation is used to send variable SMS to recipients.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_TEMPLATE_SMS"
            examples:
              SEND TEMPLATE SMS:
                value:
                  sender: Arkesel
                  message: Hello <%name%>, have a safe journey to <%city%>. Stay safe!
                  recipients:
                    "233553995047":
                      name: Josh
                      city: Accra
                    "233544919953":
                      name: Joel
                      city: Beinjin
              SEND TEMPLATE SMS (NIGERIAN CONTACTS):
                value:
                  sender: Arkesel
                  message: Hello <%name%>, have a safe journey to <%city%>. Stay safe!
                  recipients:
                    "233553995047":
                      name: Josh
                      city: Accra
                    "233544919953":
                      name: Joel
                      city: Beinjin
                  use_case: transactional
        description: ""
      parameters: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/clients/balance-details:
    get:
      summary: Check balance
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CHECK_BALANCE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    data:
                      sms_balance: "2003"
                      main_balance: GHS 20.99
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Failed to obtain your balance details!
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/clients/balance-details")
              .get()
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            url = "https://sms.arkesel.com/api/v2/clients/balance-details"

            try:
                response = client.get(url, headers=headers)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/clients/balance-details',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'GET',
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');

            const config = {
              method: 'get',
              url: 'https://sms.arkesel.com/api/v2/clients/balance-details',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              }
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: check_client_balance
      description: Check an account balance be it SMS or Main balance.
      security:
        - api-key: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms:
    get:
      summary: SMS details
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SMS_DETAILS_RESPONSE"
              examples:
                SMS_DETAILS_RESPONSE:
                  value:
                    status: success
                    data:
                      ID: f3be70c1-3545-4677-b607-6b5f32202652
                      status: DELIVERED
                      sender: Arkesel
                      recipient: "233544919953"
                      message: Welcome to version 2 of our API!
                      message_count: 1
                      sent_at_time: "2021-04-09 18:44:05"
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: SMS request failed!
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/f3be70c1-3545-4677-b607-6b5f32202652")
              .get()
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            url = "https://sms.arkesel.com/api/v2/sms/f3be70c1-3545-4677-b607-6b5f32202652"

            try:
                response = client.get(url, headers=headers)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/f3be70c1-3545-4677-b607-6b5f32202652',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'GET',
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');

            const config = {
              method: 'get',
              url: 'https://sms.arkesel.com/api/v2/sms/f3be70c1-3545-4677-b607-6b5f32202652',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              }
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: sms_details
      description: "Get the details of a sent SMS such as delivery status, recipient, sender etc., using its UUID."
      security:
        - api-key: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms/message-reports:
    post:
      summary: Batch SMS Report
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_REPORT_RESPONSE"
              examples:
                MESSAGE_REPORT_RESPONSE:
                  value:
                    status: success
                    data:
                      f3be70c1-3545-4677-b607-6b5f32202652:
                        sender: Arkesel
                        recipient: "233540000000"
                        status: DELIVERED
                        message: Welcome to version 2 of our API!
                        message_count: 1
                        sent_at_time: "2021-04-09 18:44:05"
                      9b61686b-b7a9-4167-bebe-808467635c05":
                        sender: Arkesel
                        recipient: "233500000000"
                        status: DELIVERED
                        message: Welcome to version 2 of our API!
                        message_count: 1
                        sent_at_time: "2021-04-09 18:44:05"
                      b35e5b16-c66c-4561-b0ab-2f6ae50c8757:
                        status: error
                        response: message does not exist
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_REPORT_FAILED_RESPONSE"
              examples:
                MESSAGE_REPORT_FAILED_RESPONSE:
                  value:
                    status: failed
                    timestamp: 2023-01-01 12:59:59
                    message: An error occurred, please try again or contact support if error persist!
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            List<String> messageids = Arrays.asList("9b61686b-b7a9-4167-bebe-808467635c05","f3be70c1-3545-4677-b607-6b5f32202652","b35e5b16-c66c-4561-b0ab-2f6ae50c8757");
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("msg_ids", messageids.toString());
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/message-reports")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            url = "https://sms.arkesel.com/api/v2/sms/message-reports"

            messageids = [
                "9b61686b-b7a9-4167-bebe-808467635c05",
                "f3be70c1-3545-4677-b607-6b5f32202652",
                "b35e5b16-c66c-4561-b0ab-2f6ae50c8757"
            ]

            request_body = {
                "msg_ids": messageids
            }

            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/message-reports',
              CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => '',
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 0,
              CURLOPT_FOLLOWLOCATION => true,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => 'POST',
              CURLOPT_POSTFIELDS => http_build_query([
                  'msg_ids' => ['9b61686b-b7a9-4167-bebe-808467635c05','f3be70c1-3545-4677-b607-6b5f32202652','b35e5b16-c66c-4561-b0ab-2f6ae50c8757'],
              ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {
              "msg_ids": ["9b61686b-b7a9-4167-bebe-808467635c05","f3be70c1-3545-4677-b607-6b5f32202652","b35e5b16-c66c-4561-b0ab-2f6ae50c8757"
              ]};

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/message-reports',
              headers: {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: batch_message_reports
      description: "Get the details of multiple SMS sent such as: delivery status, recipient, sender etc., using their UUIDs."
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BATCH-SMS-REPORT"
            examples:
              BATCH SMS REPORT:
                value:
                  msg_ids:
                    [
                      "9b61686b-b7a9-4167-bebe-808467635c05",
                      "f3be70c1-3545-4677-b607-6b5f32202652",
                      "b35e5b16-c66c-4561-b0ab-2f6ae50c8757",
                    ]
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/contacts/groups:
    post:
      summary: Create contact group
      tags:
        - SMS V2
      responses:
        "201":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    message: Contact group has been created successfully!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The "group_name" field is required!
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Contact group cannot be created!
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("group_name", "Hello world");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/contacts/groups")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }

        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            url = "https://sms.arkesel.com/api/v2/contacts/groups"

            request_body = {
                "group_name": "Hello world"
            }

            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/contacts/groups',
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'group_name' => 'Hello World'
                ]),
                CURLOPT_HTTPHEADER => [
                    'Accept' => 'application/json',
                    'api-key' => 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
                ],
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {"group_name": "Hello World"};

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/contacts/groups',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
                'Accept': 'application/json'
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: create_contact_group
      description: |
        - Create a new contact group.
        - The contact group name should not match an existing group name.
        - You can find your contact groups in the 'Bulk SMS > Contacts' section of your dashboard after sending your API request.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CONTACT_GROUP"
            examples:
              CONTACT_GROUP:
                value:
                  group_name: New Customers
        description: This contains the group_name field containing the name of the group name
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/contacts:
    post:
      summary: Add contacts to a group
      tags:
        - SMS V2
      responses:
        "201":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    message: Contacts have been created successfully!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The "phone_number" field is required!
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Contacts cannot be created!
      x-codeSamples:
        - lang: JAVA
          source: |-
            // Create Class
            public class Contact{
              private String phone_number;
              private String first_name;
              private String last_name;
              private String company;
              private String email_address;
              private String user_name;

              public Contact(String phone_number){
                this.phone_number = phone_number;
              }

              public Contact(String phone_number,String first_name,String last_name,String company,){
                this.phone_number = phone_number;
                this.first_name = first_name;
                this.last_name = last_name;
                this.company = company;
              }
            }

            Gson gson = new Gson();

            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            List<String> contacts = Arrays.asList(gson.toJson(new Contact("0244459784")),
                  gson.toJson(new Contact("233544919953","Arkesel","Dev","Arkesel","support@arkesel.com","ark")));
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("group_name", "Hello world");
            requestBody.put("contacts", contacts.toString());
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/contacts")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests
            import json

            # Define Contact class
            class Contact:
                def __init__(self, phone_number, first_name=None, last_name=None, company=None, email_address=None, user_name=None):
                    self.phone_number = phone_number
                    self.first_name = first_name
                    self.last_name = last_name
                    self.company = company
                    self.email_address = email_address
                    self.user_name = user_name

            # Create contacts list
            contacts = [
                json.dumps(Contact("0244459784").__dict__),
                json.dumps(Contact("233544919953", "Arkesel", "Dev", "Arkesel", "support@arkesel.com", "ark").__dict__)
            ]

            # HTTP request setup
            client = requests.Session()
            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }
            url = "https://sms.arkesel.com/api/v2/contacts"

            # Define request body
            request_body = {
                "group_name": "Hello world",
                "contacts": contacts
            }

            # Send HTTP POST request
            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/contacts',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'group_name' => 'Hello World',
                    'contacts' => [
                        [
                            'phone_number' => '0244459784'
                        ],
                        [
                            'phone_number' => '233544919953',
                            'first_name' => 'Arkesel',
                            'last_name' => 'Dev',
                            'company' => 'Arkesel',
                            'email_address' => 'support@arkesel.com',
                            'user_name' => 'ark'
                        ]
                    ]
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {"group_name": "Hello World",
                        "contacts": [
                                      {"phone_number": "0244459784"},
                                      {"phone_number": "233544919953", "first_name": "Arkesel","last_name": "Dev", "company": "Arkesel","email_address": "support@arkesel.com","user_name": "New wele"}
                                    ]
                        };

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/contacts',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: create_contacts
      description: |
        ## Create new contacts

        - Create new contact.
        - Contact group name must be present in your account.
        - **Please note that the phone_number field in the contacts array field is required**
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CONTACT"
            examples:
              CONTACT:
                value:
                  group_name: New Customers
                  contacts:
                    - phone_number: "233544919953"
                    - phone_number: "233544919953"
                      first_name: Arkesel
                      last_name: Dev
                      company: Arkesel
                      email_address: support@arkesel.com
                      user_name: kadzam
        description: This contains the group_name field containing the name of the group name and the contact details.
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms/voice/send:
    post:
      summary: Send voice SMS
      tags:
        - Voice
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VOICE_SMS_RESPONSE"
                # $ref: '#/components/schemas/MESSAGE_RESPONSE'
              examples:
                SEND VOICE SMS:
                  value:
                    status: success
                    message: Voice SMS request sent successfully!
                    data:
                      campaign_id: C5f17ced633b3b
                      recipients: ["233544919952", "233544919953"]
                WEBHOOK PAYLOAD FOR VOICE SMS:
                  value:
                    status: "sucess"
                    data:
                      - campaign_id: "C5f17ced633b3b"
                        recipient: "233540000000"
                        status: "NO ANSWER"
                      - campaign_id: "C5f17ced633b3b"
                        recipient: "233541234567"
                        status: "ANSWERED"
        "402":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Insufficient balance or invalid coverage!
        "403":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Inactive SMS Gateway!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The recipients field is required.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: SMS request failed!
        # '100':
        #   description: This payload is sent to your callback url
        #   content:
        #     application/json:
        #       schema:
        #         $ref: '#/components/schemas/MESSAGE_RESPONSE'
        #       examples:
        #         MESSAGE_RESPONSE:
        #           value:
        #             status: "sucess"
        #             data:
        #               - campaign_id: "C5f17ced633b3b"
        #                 recipient: "233540000000"
        #                 status: "NO ANSWER"
        #               - campaign_id: "C5f17ced633b3b"
        #                 recipient: "233540000000"
        #                 status: "ANSWERED"
      x-codeSamples:
        - lang: JAVA
          source: |-
            /* SEND VOICE SMS */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .build();
            RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
              .addFormDataPart("recipients[]","233544919953")
              .addFormDataPart("recipients[]","233544919953")
              .addFormDataPart("voice_id","0540000000")
              .addFormDataPart("voice_file","/C:/files/voice_message.mp3",
                RequestBody.create(MediaType.parse("application/octet-stream"),
                new File("/C:/files/voice_message.mp3")))
              .build();
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/voice/send")
              .post(body)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }


            /* SEND VOICE SMS WITH DELIVERY WEBHOOK  */
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .build();
            RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
              .addFormDataPart("recipients[]","233544919953")
              .addFormDataPart("recipients[]","233544919953")
              .addFormDataPart("voice_id","0540000000")
              .addFormDataPart("retry","false")
              .addFormDataPart("callback_url","https://google.com/")
              .addFormDataPart("voice_file","/C:/files/voice_message.mp3",
            RequestBody.create(MediaType.parse("application/octet-stream"),
              new File("/C:/files/voice_message.mp3")))
              .build();
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/voice/send")
              .post(body)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests

            # SEND VOICE SMS
            client = requests.Session()
            url = "https://sms.arkesel.com/api/v2/sms/voice/send"
            headers = {"api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw="}
            files = {
                "voice_file": open("/C:/files/voice_message.mp3", "rb")
            }
            data = {
                "recipients[]": ["233544919953", "233544919953"],
                "voice_id": "0540000000"
            }

            try:
                response = client.post(url, headers=headers, files=files, data=data)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

            # SEND VOICE SMS WITH DELIVERY WEBHOOK
            data = {
                "recipients[]": ["233544919953", "233544919953"],
                "voice_id": "0540000000",
                "retry": "false",
                "callback_url": "https://google.com/"
            }

            try:
                response = client.post(url, headers=headers, files=files, data=data)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |
            <?php

            /* SEND VOICE SMS  */
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/voice/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'recipients' => [
                        '233544919959',
                        '233544919953'
                    ],
                    'voice_id' => '0540000000',
                    'voice_file' => new CURLFILE('/C:/files/voice_message.mp3'),
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;




            /* SEND VOICE SMS WITH DELIVERY WEBHOOK */
            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/voice/send',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'recipients' => [
                        '233544919959',
                        '233544919953'
                    ],
                    'voice_id' => '0540000000',
                    'retry' => "false",
                    'callback_url' => 'https://google.com/',
                    'voice_file' => new CURLFILE('/C:/files/voice_message.mp3'),
                ]),
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            /* SEND VOICE SMS  */
            const axios = require('axios');
            const FormData = require('form-data');
            const fs = require('fs');
            const data = new FormData();
            data.append('recipients[]', '233544919953');
            data.append('recipients[]', '233544919953');
            data.append('voice_file', fs.createReadStream('/C:/files/voice_message.mp3'));
            data.append('voice_id', '0540000000');

            var config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/voice/send',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
                ...data.getHeaders()
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });



            /* SEND VOICE SMS WITH DELIVERY WEBHOOK  */
            const axios = require('axios');
            const FormData = require('form-data');
            const fs = require('fs');
            const data = new FormData();
            data.append('recipients[]', '233544919953');
            data.append('recipients[]', '233544919953');
            data.append('voice_file', fs.createReadStream('/C:/files/voice_message.mp3'));
            data.append('voice_id', '0540000000');
            data.append('retry', 'false'); // By default, calls will be retried when any status but ANSWERED is return. Turn off retries by passing value 'false' to request field.
            data.append('callback_url', 'https://google.com/'); //The status of the call and recipient's number will be returned to the url for a call if a status other than ANSWERED is received.

            var config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/voice/send',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
                ...data.getHeaders()
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });

      operationId: send_voice_sms
      description: |
        This operation is used to SEND VOICE SMS.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_VOICE_SMS"
            examples:
              SEND VOICE SMS:
                value:
                  $ref: "#/components/schemas/SEND_VOICE_SMS/x-examples/SEND_VOICE_SMS"
              SEND VOICE SMS WITH WEBHOOK:
                value:
                  $ref: "#/components/schemas/SEND_VOICE_SMS/x-examples/SEND_VOICE_SMS_WITH_WEBHOOK"
        description: ""
      parameters: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/v2/sms/send/contact-group:
    post:
      summary: Send SMS to group
      tags:
        - SMS V2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                description: ""
                anyOf:
                  - $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                SEND VOICE SMS:
                  value:
                    status: success
                    message: SMS request sent successfully!
        "402":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Insufficient balance or invalid coverage!
        "403":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Inactive SMS Gateway!
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: The recipients field is required.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: SMS request failed!
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
              .newBuilder()
              .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
              .addHeader("Content-Type", "application/json")
              .build();
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("sender", "Hello world");
            requestBody.put("message", "Welcome to Arkesel SMS API v2. Please enjoy the experience.");
            requestBody.put("group_name", "Loyal Customers");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
              .url("https://sms.arkesel.com/api/v2/sms/send/contact-group")
              .post(jsonRequestBody)
              .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw=",
                "Content-Type": "application/json"
            }

            url = "https://sms.arkesel.com/api/v2/sms/send/contact-group"

            request_body = {
                "sender": "Hello world",
                "message": "Welcome to Arkesel SMS API v2. Please enjoy the experience.",
                "group_name": "Loyal Customers"
            }

            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
                CURLOPT_URL => 'https://sms.arkesel.com/api/v2/sms/send/contact-group',
                CURLOPT_HTTPHEADER => ['api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='],
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS => http_build_query([
                    'sender' => 'ArkeselTry',
                    'message' => 'Welcome to version 2 of our API',
                    'group_name' => 'Loyal Customers'
                ])
            ]);

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {"sender": "Hello World","message": "Welcome to version 2 of our API","group_name": "Loyal Customers"};

            const config = {
              method: 'post',
              url: 'https://sms.arkesel.com/api/v2/sms/send/contact-group',
              headers: {
                'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw='
              },
              data : data
            };

            axios(config)
            .then(function (response) {
              console.log(JSON.stringify(response.data));
            })
            .catch(function (error) {
              console.log(error);
            });
      operationId: send_sms_to_contact_group
      description: |
        This operation is used to SEND SMS to a CONTACT GROUP.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_SMS_TO_CONTACT_GROUP"
        description: ""
      parameters: []
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/otp/generate:
    post:
      summary: Generate OTP
      tags:
        - One Time Password (OTP)
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                Responses:
                  value:
                    code: "1000"
                    ussd_code: "*928*01#"
                    message: "Successful, OTP is being processed for delivery"
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    code: "1001"
                    message: "The type you selected [numeri] is invalid. Expected one of [numeric, alphanumeric]"
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: "1011"
                    message: Internal error
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
            .newBuilder()
            .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
            .build();
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("expiry", "5");
            requestBody.put("length", "6");
            requestBody.put("medium", "sms");
            requestBody.put("message", "This is OTP from Arkesel, %otp_code%");
            requestBody.put("number", "233544919953");
            requestBody.put("sender_id", "Arkesel");
            requestBody.put("type", "numeric");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
            .url("https://sms.arkesel.com/api/otp/generate")
            .post(jsonRequestBody)
            .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw="
            }

            url = "https://sms.arkesel.com/api/otp/generate"

            request_body = {
                "expiry": "5",
                "length": "6",
                "medium": "sms",
                "message": "This is OTP from Arkesel, %otp_code%",
                "number": "233544919953",
                "sender_id": "Arkesel",
                "type": "numeric"
            }

            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php
            $fields = [
            'expiry'=> 5,
            'length'=> 6,
            'medium'=> 'sms',
            'message'=> 'This is OTP from Arkesel, %otp_code%',
            'number'=>'233544919953',
            'sender_id'=>'Arkesel',
            'type'=>'numeric',
            ];
            $postvars = '';
            foreach($fields as $key=>$value) {
                $postvars .= $key . "=" . $value . "&";
            }
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/api/otp/generate',
            CURLOPT_HTTPHEADER => array('api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => $postvars,
            ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {
              expiry: 5,
              length: 6,
              medium: 'sms',
              message: 'This is OTP from Arkesel, %otp_code%',
              number: '233544919953',
              sender_id: 'Arkesel',
              type: 'numeric',
            };
            const headers = {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
            }
            axios.post('https://sms.arkesel.com/api/otp/generate',data,{headers})
            .then(response => console.log(response))
            .catch(error => console.log(error));
      operationId: otp_generate
      description: |
        This operation generates and sends a code to the receiver through the specified medium. The type and medium
        parameters have to be specified in the request.
        #### API key
        Key must be passed as a header parameter as "api-key : xxxxxxxxxxxxxxxxxxx". Kindly replace the API key with your **api-key**, which you can obtain from your Arkesel dashboard.


        #### Type
        - numeric
        - alphanumeric

        ### 1. Numeric
        This operation generates code with only digits.

        ### 2. Alphanumeric
        This operation generates code with both digits and letters.

        #### Medium
        - sms
        - voice

        ### 1. SMS
        This operation sends a code as an SMS message using the template provided.

        ### 2. Voice
        This operation sends a code as a voice call using a registered caller ID. The supplied message text is translated
        to speech by our text to speech engine.

        **Note:** Use Main SMS API Key, OTP will not work for any of the Multiple API Keys.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GENERATE-OTP"
            examples:
              GENERATE NUMERIC OTP SMS:
                value:
                  expiry: 5
                  length: 6
                  medium: sms
                  message: "This is OTP from Arkesel, %otp_code%"
                  number: "233544919953"
                  sender_id: Arkesel
                  type: numeric
              GENERATE NUMERIC OTP VOICE:
                value:
                  length: 6
                  medium: voice
                  message: "This is OTP from Arkesel, %otp_code%"
                  number: "233544919953"
                  sender_id: Arkesel
                  type: numeric
              GENERATE ALPHANUMERIC OTP SMS:
                value:
                  expiry: 5
                  length: 6
                  medium: sms
                  message: "This is OTP from Arkesel, %otp_code%"
                  number: "233544919953"
                  sender_id: Arkesel
                  type: alphanumeric
              GENERATE ALPHANUMERIC OTP VOICE:
                value:
                  expiry: 5
                  length: 6
                  medium: voice
                  message: "This is OTP from Arkesel, %otp_code%"
                  number: "233544919953"
                  sender_id: Arkesel
                  type: alphanumeric
        description: ""
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/otp/verify:
    post:
      summary: Verify OTP
      tags:
        - One Time Password (OTP)
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                Responses:
                  value:
                    code: "1100"
                    message: Successful
        "422":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    code: "1101"
                    message: The code field is required.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OTP_MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: "1106"
                    message: Internal error
      x-codeSamples:
        - lang: JAVA
          source: |-
            OkHttpClient client = new OkHttpClient()
            .newBuilder()
            .addHeader("api-key", "cE9QRUkdjsjdfjkdsj9kdiieieififiw=")
            .build();
            Map<String, String> requestBody = new LinkedHashMap<>();
            requestBody.put("code", "173882");
            requestBody.put("number", "233544919953");
            RequestBody jsonRequestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), mapJsonAdapter.toJson(requestBody));
            Request request = new Request.Builder()
            .url("https://sms.arkesel.com/api/otp/verify")
            .post(jsonRequestBody)
            .build();
            try (Response response = client.newCall(request).execute()) {
              if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
              System.out.println(response.body().string());
            }
        - lang: PYTHON
          source: |
            import requests
            import json

            client = requests.Session()

            headers = {
                "api-key": "cE9QRUkdjsjdfjkdsj9kdiieieififiw="
            }

            url = "https://sms.arkesel.com/api/otp/verify"

            request_body = {
                "code": "173882",
                "number": "233544919953"
            }

            try:
                response = client.post(url, headers=headers, json=request_body)
                response.raise_for_status()
                print(response.text)
            except requests.exceptions.RequestException as e:
                print("An error occurred:", e)

        - lang: PHP
          source: |-
            <?php
            $fields = [
            'api_key'=> 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
            'code'=> '173882',
            'number'=>'233544919953',
            ];
            $postvars = '';
            foreach($fields as $key=>$value) {
                $postvars .= $key . "=" . $value . "&";
            }
            $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'https://sms.arkesel.com/api/otp/verify',
            CURLOPT_HTTPHEADER => array('api-key: cE9QRUkdjsjdfjkdsj9kdiieieififiw='),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => $postvars,
            ));
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |-
            const axios = require('axios');
            const data = {
              api_key: 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
              code: '173882',
              number: '233544919953'
            };
            const headers = {
              'api-key': 'cE9QRUkdjsjdfjkdsj9kdiieieififiw=',
            }
            axios.post('https://sms.arkesel.com/api/otp/verify',data,{headers})
            .then(response => console.log(response))
            .catch(error => console.log(error));
      operationId: otp_verify
      description: |
        This operation is callback for code verification.

        #### API key
        Key must be passed as a header parameter as "api-key : xxxxxxxxxxxxxxxxxxx"

        **Note:** Use Main SMS API Key, OTP will not work for any of the Multiple API Keys.
      security:
        - api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VERIFY-OTP"
            examples:
              VERIFY OTP:
                value:
                  code: "173882"
                  number: "233544919953"
        description: ""
    parameters:
      - name: api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /ussd-endpoint-url:
    parameters: []
    post:
      summary: Receiving Requests
      operationId: receiving-requests
      x-code-samples:
        - lang: JAVA
          source: |
            package com.arksel;
            import com.google.gson.Gson;

            import static spark.Spark.port;
            import static spark.Spark.post;

            public class USSD {
                public static void main(String[] args) {
                  Gson gson = new Gson();
                  // Start embedded server at this port
                  port(8080);

                  // POST - ENDPOINT URL PROVIDED DURING SETUP
                  post("/endpointURL", (request, response) -> {
                  USSDRequest ussdRequest = gson.fromJson(request.body(), USSDRequest.class);
                  USSDResponse ussdResponse = new USSDResponse();
                  ussdResponse.setSessionID(ussdRequest.getSessionID());
                  ussdResponse.setUserID(ussdRequest.getUserID());
                  ussdResponse.setMsisdn(ussdRequest.getMsisdn());

                  if (ussdRequest.isNewSession() && ussdRequest.getUserData().equals("*928*92#")) {
                    ussdResponse.setMessage("Welcome to Arkesel Bank\n1. Check Balance\n2. Buy Bundle");
                    ussdResponse.setContinueSession(true);
                   }else if ( !ussdRequest.isNewSession() && ussdRequest.getUserData().equals("1")) {
                    // Implement Check balance functionality for 1
                    ussdResponse.setMessage("Your account balance is GHc 2.00");
                    ussdResponse.setContinueSession(false);
                  }else if (!ussdRequest.isNewSession() && ussdRequest.getUserData().equals("2")){
                    // Implement Check balance functionality for 2
                    ussdResponse.setMessage("No packages available for subscription");
                    ussdResponse.setContinueSession(false);
                  }else {
                    ussdResponse.setMessage("Invalid input");
                    ussdResponse.setContinueSession(false);
                  }
                    response.header("Content-Type","application/json");
                    return gson.toJson(ussdResponse);
                  });
                 }
                }
            // DEPENDENCIES
              <dependencies>
                <dependency>
                  <groupId>com.sparkjava</groupId>
                  <artifactId>spark-core</artifactId>
                  <version>2.5.4</version>
                </dependency>
                <dependency>
                  <groupId>com.google.code.gson</groupId>
                  <artifactId>gson</artifactId>
                  <version>2.8.0</version>
                </dependency>
                <dependency>
                  <groupId>ch.qos.logback</groupId>
                  <artifactId>logback-classic</artifactId>
                  <version>1.2.2</version>
                </dependency>
              </dependencies>
        - lang: PYTHON
          source: |
            from flask import Flask, request, jsonify

            app = Flask(__name__)

            class USSDResponse:
                def __init__(self, session_id=None, user_id=None, msisdn=None, message=None, continue_session=False):
                    self.sessionID = session_id
                    self.userID = user_id
                    self.msisdn = msisdn
                    self.message = message
                    self.continueSession = continue_session

            @app.route('/endpointURL', methods=['POST'])
            def ussd_handler():
                ussd_request = request.json
                ussd_response = USSDResponse(session_id=ussd_request.get('sessionID'),
                                            user_id=ussd_request.get('userID'),
                                            msisdn=ussd_request.get('msisdn'))

                if ussd_request.get('newSession') and ussd_request.get('userData') == '*928*92#':
                    ussd_response.message = "Welcome to Arkesel Bank\n1. Check Balance\n2. Buy Bundle"
                    ussd_response.continueSession = True
                elif not ussd_request.get('newSession') and ussd_request.get('userData') == '1':
                    ussd_response.message = "Your account balance is GHc 2.00"
                    ussd_response.continueSession = False
                elif not ussd_request.get('newSession') and ussd_request.get('userData') == '2':
                    ussd_response.message = "No packages available for subscription"
                    ussd_response.continueSession = False
                else:
                    ussd_response.message = "Invalid input"
                    ussd_response.continueSession = False

                return jsonify(vars(ussd_response))

            if __name__ == '__main__':
                app.run(port=8080)

        - lang: PHP
          source: |
            <?php

            // Get the JSON contents
            $json = file_get_contents('php://input');

            // decode the json data
            $data = json_decode($json, true);

            $sessionID = $data['sessionID'];
            $userID = $data['userID'];
            $newSession = $data['newSession'];
            $msisdn = $data['msisdn'];
            $userData = $data['userData'];
            $network = $data['network'];

            if($newSession && $userData == "*928*303#"){
              // This is a new session
              $message = "Welcome to Arkesel Bank\n";
              $message .= "1. Check Balance\n";
              $message .= "2. Buy Bundle";
              $continueSession = true;
            } else if($newSession == false && $userData == "1"){
              // Implement Check balance functionality for 1
              $message = "Your account balance is GHc 2.00";
              $continueSession = false;
            } else if ($newSession == false && $userData == "2") {
              // Implement Check balance functionality for 2
              $message = "No packages available for subscription";
              $continueSession = false;
            }else {
              //Invalid Option Selected
              $message = "Invalid input";
              $continueSession = false;
            }

            $response = [
              "sessionID" => $sessionID,
              "userID" => $userID,
              "msisdn" => $msisdn,
              "message" => $message,
              "continueSession" => $continueSession
            ];

            http_response_code(200);

            // treat this as json
            header('Content-Type: application/json');

            echo json_encode($response);
      tags:
        - API Reference
      description: The request from the mobile user will be routed to the endpoint URL you provided during the USSD subscription/setup process. The data is JSON formatted and contains the following.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/USSDREQUEST"
            examples:
              sample-1:
                value:
                  sessionID: "2005506191900168"
                  userID: USSD_DOCUMENTATION
                  newSession: true
                  msisdn: "233271231234"
                  userData: "*928*1#"
                  network: AIRTELTIGO
      responses:
        "100":
          x-summary: "## Expected Response to Request"
          description: This is the response to the user’s request. You should provide a response to the request in the format below. The response body should have **all** the elements as described below.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/USSDRESPONSE"
              examples:
                sample-1:
                  value:
                    sessionID: "2005506191900168"
                    userID: USSD_DOCUMENTATION
                    msisdn: "233271231234"
                    message: Welcome to ARKESEL USSD Documentation
                    continueSession: false
  api/wbs/getGroups?token={{ token }}&showContacts=no:
    get:
      summary: Get Groups
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: ""
              examples:
                GET GROUPS:
                  value:
                    status: success
                    groups:
                      - id: 1
                        name: "New client list"
                GET GROUPS WITH CONTACTS:
                  value:
                    status: "success"
                    groups:
                      -  id: 1
                         name: "New client list"
                         contacts:
                          - id: 11
                            name: "John Doe"
                            phone: "+23354xxxxxxx"

        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Token is required
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during authentication
      x-codeSamples:


      operationId: get_groups
      description: |
        This operation is used to retrieve contact groups with optional display of associated contacts   
    parameters:
      - name: token
        in: query
        example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
        required: true
        schema:
          type: string
      - name: showContacts
        in: query
        example: no
        description: can be included as part of the query parameters with a value of "yes” to display the associated contacts of each group
        required: false
        schema:
          type: string
  api/wbs/getContacts?token={{ token }}:
    get:
      summary: Get Contacts
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: ""
              examples:
                GET CONTACTS:
                  value:
                    status: success
                    contacts:
                     -  id: 1
                        name: "John Doe"
                        phone: "+233541234567"
                     
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Token is required
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during authentication
      x-codeSamples:


      operationId: get_contacts
      description: |
        This operation is used to retrieve a list of contacts with detailed information.
    parameters:
      - name: token
        in: query
        example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
        required: true
        schema:
          type: string
  api/wbs/addContact:
    post:
      summary: Add Contacts
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    contact:
                     - id: 1
                       name: "Dev"
                       phone: "233544919953"
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    -  status: error
                       message: Token is required
                    -  status: error
                       error:
                       - phone: ""

        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during contact creation
      x-codeSamples:


      operationId: add_contacts
      description: |
        This operation is used to add new contacts to the list with option to assign to groups.

        - Add new contact
        - Providing a group name is optional but if a group name is to be provided, it can either be an existing group or a name of a new group to be created.
        - **Please note that the phone field is required**
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ADD_CONTACTS"
            examples:
              ADD_CONTACT:
                value:
                    token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
                    phone: "233544919953"
                    name: Dev
                    group: Arkesel
  api/wbs/getCampaigns?token={{ token }}&type=api:
    get:
      summary: Get Campaigns
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: ""
              examples:
                GET CAMPAIGN:
                  value:
                    status: success
                    items:
                      campaign_id: 1
                      campaign_name: "First API Campaign"
                      message_template_id: 805265648148968
                      message_template_name: "pilot_template"
                      total_recipients: 2
                      messages_delivered: 2
                      messages_read: 2
                      associated_group: "Arkesel"
                      linked_contact: "Dev"
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Token is required
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during authentication
      x-codeSamples:


      operationId: get_campaigns
      description: |
        This operation is used to retrieve campaigns created via API or dashboard
    parameters:
      - name: token
        in: query
        example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
        required: true
        schema:
          type: string
      - name: type
        in: query
        example:
          enum:
            - api
            - regular
        required: true
        schema:
          type: string
  api/wbs/sendcampaigns:
    post:
      summary: Send Campaign
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    message: "7206c9c4-8e33-4751-9e4d-e67521161b6c"      
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    -  status: error
                       message: Token is required
                    -  status: error
                       message: Insufficient balance. Please top up your account to proceed.
                    -  status: error
                       errors:
                       - template_id: "The template id field is required."
                    -  status: error
                       errors:
                       - campaign_name: "The campaign name field is required."
                    

        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during contact creation
      x-codeSamples:

      operationId: send_campaign
      description: |
        This operation is used to create and send campaigns to specific contacts, groups, or all contacts.

        - Send campaign
        - NB: If no `phone` or `group_id` is provided, the campaign message will be sent to all your contacts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_CAMPAIGN"
            examples:
              SEND_CAMPAIGN:
                value:
                    token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
                    phone: "233544919953"
                    campaign_name: First API Campaign
                    group_id: 
                    schedule_time:
                    template_id: "805265648148957"
  api/wbs/get_templates?token={{ token }}:
    get:
      summary: List templates
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: ""
              examples:
                LIST TEMPLATES:
                  value:
                    status: success
                    templates:
                     -  id: 805265648148957
                        name: "pilot_template"
                        status: "APPROVED"
                        category: "UTILITY"
                        language:  "en"
                        components: "[{\"type\":\"BODY\",\"text\":\"Hi,\\n\\nWelcome to our support.\\nHow can we help you?\\n\\nYour support team\"}]"
                        company_id: 2
                        created_at: "2024-10-24T14:30:50.000000Z"
                        updated_at: "2024-10-28T11:54:20.000000Z"
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Token is required
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during authentication
      x-codeSamples:


      operationId: list_templates
      description: |
        This operation is used to retrieve all your message templates.
    parameters:
      - name: token
        in: query
        example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
        required: true
        schema:
          type: string
  api/wbs/sendtemplatemessage:
    post:
      summary: Send template message
      tags:
        - WhatsApp Business API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    message: "7206c9c4-8e33-4751-9e4d-e67521161b6c"      
        "400":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    -  status: error
                       message: Token is required
                    -  status: error
                       error:
                       - phone: ""

        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid token
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Plan not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during contact creation
      x-codeSamples:

      operationId: send_template_message
      description: |
        This operation sends template messages for authentication (OTP), marketing, or utility purposes to contacts.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SEND_TEMPLATE_MESSAGE"
            examples:
              SEND TEMPLATE MESSAGE WITHOUT VARIABLES:
                value:
                  token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
                  to: "233544919953"
                  from: "233544919953"
                  channel: "whatsapp"
                  content: 
                       contentType: "template"
                       template:
                          templateId: "discounted_sales_template"
                          templateLanguage: "en"
                          components: {}
                            
              SEND TEMPLATE MESSAGE WITH VARIABLES:
                value:
                  token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
                  to: "233544919953"
                  from: "233544919953"
                  channel: "whatsapp"
                  content: 
                       contentType: "template"
                       template:
                          templateId: "discounted_sales_template"
                          templateLanguage: "en"
                          components: 
                            header:
                              - type: "text"
                                text: "John Doe"
                            body:
                              -  type: "text"
                                 text: "Order ID 123"
              SEND AUTHENTICATION TEMPLATE MESSAGE:
                value:
                  token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
                  to: "233544919953"
                  from: "233544919953"
                  channel: "whatsapp"
                  content: 
                       contentType: "template"
                       template:
                          templateId: "authentication_template"
                          templateLanguage: "en"
                          components: 
                            body:
                              - type: "text"
                                text: "789654 // This is the OTP code to be sent to the user"
                            footer:
                              -  type: "url"
                                 index: 0
                                 text: "789654 // This is the OTP code to be sent to the user"
  /api/survey-campaigns/create:
    post:
      servers: 
        - url: https://ivrsys.arkesel.com/
      summary: Create Campaign
      tags:
        - Voice Connect API
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: success
                    message: "Survey campaign created successfully"
                    data:
                     - campaign_id: "0199e34e-0e7a-724b-8aa9-9ca4b5b77fb4"
                       status: "Pending"
        
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid API key
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during survey campaign creation.
      x-codeSamples:
      operationId: create_campaign
      description: |
        This operation is used to create survey campaign.

        - Create survey campaign by providing the title, survey_id and recipients fields.
        - Providing start_date and end_date is optional. If provided, the start_date must be greater than or equal to the current date and time, and the end_date must be greater than or equal to the start_date.
      security:
        - x-api-key: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CREATE_CAMPAIGN"
            examples:
              CREATE_CAMPAIGN:
                value:
                    title: Demo Survey Campaign
                    survey_id: 0197f961-c1b4-71c2-a663-e521a7f9b282
                    start_date: "2025-10-13 12:35 PM"
                    end_date: "2025-10-13 01:30 PM"
                    recipients: 
                      - "233544919953"
                      - "233501234567"
      parameters:
      - name: x-api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  /api/survey-campaign/{campaignId}/call-log-summary:
    get:
      servers: 
        - url: https://ivrsys.arkesel.com/
      summary: Fetch Survey Campaign Call Log Summary
      tags:
        - Voice Connect API
      responses:
        "201":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CONTACT"
              examples:
                F:
                  value:
                    status: "success"
                    message: Post survey call log summary retrieved successfully
                    data:
                      logs:
                        0541234567:
                            - id: "0199e34e-0e7a-724b-8aa9-9ca4b5b77fb4"
                              question_label: "Introduction"
                              question_options: "[\"English\",\"French\",\"Spanish\"]"
                              answer_label: "English"
                              answered_at: "2023-10-10 10:00:30"
                            - id: "0197f41b-8175-71a1-be94-2638dad7df9c"
                              question_label: "Service Satisfaction"
                              question_options: "[\"Very Satisfied\",\"Satisfied\",\"Neutral\",\"Dissatisfied\",\"Very Dissatisfied\"]"
                              answer_label: "Very Satisfied"
                              answered_at: "2023-10-10 10:00:45"
                            - id: "0197f41b-8182-71e6-952e-2f1328167f50"
                              question_label: "Recommendation Likelihood"
                              question_options: "[\"Definitely\",\"Probably\",\"Not Sure\",\"Probably Not\",\"Definitely Not\"]"
                              answer_label: "Definitely"
                              answered_at: "2023-10-10 10:01:00"
                        0547654321:
                            - id: "0199e34e-0e7a-724b-8aa9-9ca4b5b77fb4"
                              question_label: "Introduction"
                              question_options: "[\"English\",\"French\",\"Spanish\"]"
                              answer_label: "English"
                              answered_at: "2023-10-10 10:00:30"
                            - id: "0197f41b-8175-71a1-be94-2638dad7df9c"
                              question_label: "Service Satisfaction"
                              question_options: "[\"Very Satisfied\",\"Satisfied\",\"Neutral\",\"Dissatisfied\",\"Very Dissatisfied\"]"
                              answer_label: "Very Satisfied"
                              answered_at: "2023-10-10 10:00:45"
                            - id: "0197f41b-8182-71e6-952e-2f1328167f50"
                              question_label: "Recommendation Likelihood"
                              question_options: "[\"Definitely\",\"Probably\",\"Not Sure\",\"Probably Not\",\"Definitely Not\"]"
                              answer_label: "Definitely"
                              answered_at: "2023-10-10 10:01:00"
                      campaign:
                        - analysis: null  
        "401":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Invalid API key
        "404":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: Survey campaign log not found.
        "500":
          description: ERROR
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MESSAGE_RESPONSE"
              examples:
                MESSAGE_RESPONSE:
                  value:
                    status: error
                    message: An error occurred during fetching survey campaign logs.
                           
      x-codeSamples:
        
      operationId: fetch_survey_campaign_call_log_summary
      description: |
        This operation is used to fetch the call log summary for a specific survey campaign. It provides detailed information about the responses collected from the survey calls made during the campaign.

      security:
        - x-api-key: [] 
    parameters:
      - name: x-api-key
        in: header
        example: Xeeini34rnjfi334t
        required: true
        schema:
          type: string
  
  /ext-api/v1/create-customer-ticket:
    post:
      summary: Create Customer Ticket
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Create a new customer support ticket. This endpoint allows you to create tickets for customers within your organization.
        
        **Required fields:** organization_id, message
        
        **Note:** Either `customer_id` OR (`email`, `first_name`, `last_name`) must be provided. If customer_id is not provided, email and customer person details (first_name, last_name) are required to create or identify the customer.
      operationId: create_customer_ticket
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - organization_id
                - message
              properties:
                organization_id:
                  type: string
                  description: The unique identifier of the organization
                  example: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                customer_id:
                  type: string
                  description: The unique identifier of the customer (optional if email and customer person details are provided)
                  example: "01934ef2-7340-73ed-909d-68613b1313d3"
                message:
                  type: string
                  description: The ticket message or description
                  example: "external ticket creation4"
                title:
                  type: string
                  description: The ticket title (optional)
                  example: "test"
                first_name:
                  type: string
                  description: Customer's first name (required if customer_id is not provided)
                  example: "Max"
                last_name:
                  type: string
                  description: Customer's last name (required if customer_id is not provided)
                  example: "Gerald"
                email:
                  type: string
                  format: email
                  description: Customer's email address (required if customer_id is not provided)
                  example: "max@g.com"
            examples:
              create_ticket:
                summary: Create a new ticket
                value:
                  organization_id: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                  customer_id: "01934ef2-7340-73ed-909d-68613b1313d3"
                  message: "external ticket creation4"
                  title: "test"
              create_ticket_with_customer_details:
                summary: Create ticket with customer details (without customer_id)
                value:
                  organization_id: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                  message: "external ticket creation6"
                  title: "test"
                  first_name: "Max"
                  last_name: "Gerald"
                  email: "max@g.com"
      responses:
        '201':
          description: Ticket created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  message:
                    type: string
                    example: "Ticket created successfully"
                  data:
                    type: object
                    properties:
                      ticket_id:
                        type: string
                        example: "01991fba-4460-7306-b719-027c022b1398"
                      organization_id:
                        type: string
                        example: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                      customer_id:
                        type: string
                        example: "01934ef2-7340-73ed-909d-68613b1313d3"
                      title:
                        type: string
                        example: "test"
                      message:
                        type: string
                        example: "external ticket creation4"
                      created_at:
                        type: string
                        format: date-time
                        example: "2025-01-07T10:30:00Z"
              examples:
                success:
                  value:
                    status: "success"
                    message: "Ticket created successfully"
                    data:
                      ticket_id: "01991fba-4460-7306-b719-027c022b1398"
                      organization_id: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                      customer_id: "01934ef2-7340-73ed-909d-68613b1313d3"
                      title: "test"
                      message: "external ticket creation4"
                      created_at: "2025-01-07T10:30:00Z"
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
                    example: "Bad request"
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
                    example: "Validation failed"
                  errors:
                    type: object
      x-codeSamples:
        - lang: cURL
          source: |
            # Create ticket with customer_id
            curl --location '{server_url}/ext-api/create-customer-ticket' \
            --header 'Content-Type: application/json' \
            --data '{
              "organization_id":"0192f7f7-1359-71c6-9b26-a3a15815b89b",
              "customer_id":"01934ef2-7340-73ed-909d-68613b1313d3",
              "message":"external ticket creation4",
              "title":"test"
            }'
            
            # Create ticket with customer details (without customer_id)
            curl --location '{server_url}/ext-api/create-customer-ticket' \
            --header 'Content-Type: application/json' \
            --data '{
              "organization_id":"0192f7f7-1359-71c6-9b26-a3a15815b89b",
              "message":"external ticket creation6",
              "title":"test",
              "first_name":"Max",
              "last_name":"Gerald",
              "email":"max@g.com"
            }'
        - lang: PHP
          source: |
            <?php
            $curl = curl_init();
            
            curl_setopt_array($curl, array(
              CURLOPT_URL => '{server_url}/ext-api/create-customer-ticket',
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_CUSTOMREQUEST => 'POST',
              CURLOPT_POSTFIELDS =>'{
                "organization_id":"0192f7f7-1359-71c6-9b26-a3a15815b89b",
                "customer_id":"01934ef2-7340-73ed-909d-68613b1313d3",
                "message":"external ticket creation4",
                "title":"test"
              }',
              CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
            ));
            
            $response = curl_exec($curl);
            curl_close($curl);
            echo $response;
        - lang: NODEJS
          source: |
            const axios = require('axios');
            
            const data = {
              organization_id: "0192f7f7-1359-71c6-9b26-a3a15815b89b",
              customer_id: "01934ef2-7340-73ed-909d-68613b1313d3",
              message: "external ticket creation4",
              title: "test"
            };
            
            axios.post('{server_url}/ext-api/create-customer-ticket', data)
            .then(response => console.log(response.data))
            .catch(error => console.error(error));
        - lang: PYTHON
          source: |
            import requests
            import json
            
            url = "{server_url}/ext-api/create-customer-ticket"
            
            payload = json.dumps({
              "organization_id": "0192f7f7-1359-71c6-9b26-a3a15815b89b",
              "customer_id": "01934ef2-7340-73ed-909d-68613b1313d3",
              "message": "external ticket creation4",
              "title": "test"
            })
            
            headers = {'Content-Type': 'application/json'}
            
            response = requests.post(url, headers=headers, data=payload)
            print(response.text)
  
  /ext-api/v1/update-customer-ticket:
    put:
      summary: Update Customer Ticket
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Update an existing customer support ticket. You can modify the ticket's message and title.
      operationId: update_customer_ticket
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - organization_id
                - ticket_id
                - customer_id
              properties:
                organization_id:
                  type: string
                  description: The unique identifier of the organization
                  example: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                ticket_id:
                  type: string
                  description: The unique identifier of the ticket
                  example: "01991fba-4460-7306-b719-027c022b1398"
                customer_id:
                  type: string
                  description: The unique identifier of the customer
                  example: "01934ef2-7340-73ed-909d-68613b1313d3"
                message:
                  type: string
                  description: The updated ticket message
                  example: "update ticket3"
                title:
                  type: string
                  description: The updated ticket title
                  example: "updateTicket3"
            examples:
              update_ticket:
                summary: Update an existing ticket
                value:
                  organization_id: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
                  ticket_id: "01991fba-4460-7306-b719-027c022b1398"
                  customer_id: "01934ef2-7340-73ed-909d-68613b1313d3"
                  message: "update ticket3"
                  title: "updateTicket3"
      responses:
        '200':
          description: Ticket updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  message:
                    type: string
                  data:
                    type: object
        '404':
          description: Ticket not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
      x-codeSamples:
        - lang: cURL
          source: |
            curl --location --request PUT '{server_url}/ext-api/update-customer-ticket' \
            --header 'Content-Type: application/json' \
            --data '{
              "organization_id":"0192f7f7-1359-71c6-9b26-a3a15815b89b",
              "ticket_id":"01991fba-4460-7306-b719-027c022b1398",
              "customer_id":"01934ef2-7340-73ed-909d-68613b1313d3",
              "message":"update ticket3",
              "title":"updateTicket3"
            }'
  
  /ext-api/v1/get-customer-messages/{customer_id}/{organization_id}:
    get:
      summary: Get Customer Messages
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Retrieve all messages for a specific customer within an organization.
      operationId: get_customer_messages
      parameters:
        - name: customer_id
          in: path
          required: true
          description: The unique identifier of the customer
          schema:
            type: string
          example: "01995273-2f8c-70d7-8fce-f1a0026c86fa"
        - name: organization_id
          in: path
          required: true
          description: The unique identifier of the organization
          schema:
            type: string
          example: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
      responses:
        '200':
          description: Messages retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        message_id:
                          type: string
                        ticket_id:
                          type: string
                        message:
                          type: string
                        sender:
                          type: string
                        created_at:
                          type: string
                          format: date-time
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
      x-codeSamples:
        - lang: cURL
          source: |
            curl --location '{server_url}/ext-api/get-customer-messages/01995273-2f8c-70d7-8fce-f1a0026c86fa/0192f7f7-1359-71c6-9b26-a3a15815b89b'

  /ext-api/v1/get-customer-ticket-details/{customer_id}/{organization_id}/{ticket_id}/ticket:
    get:
      summary: Get Ticket Details
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Retrieve detailed information about a specific ticket.
      operationId: get_ticket_details
      parameters:
        - name: customer_id
          in: path
          required: true
          description: The unique identifier of the customer
          schema:
            type: string
          example: "01934ef2-7340-73ed-909d-68613b1313d3"
        - name: organization_id
          in: path
          required: true
          description: The unique identifier of the organization
          schema:
            type: string
          example: "0192f7f7-1359-71c6-9b26-a3a15815b89b"
        - name: ticket_id
          in: path
          required: true
          description: The unique identifier of the ticket
          schema:
            type: string
          example: "019ae0ae-f2d6-73d7-959e-a9e14a16f883"
      responses:
        '200':
          description: Ticket details retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: object
                    properties:
                      ticket_id:
                        type: string
                      customer_id:
                        type: string
                      organization_id:
                        type: string
                      title:
                        type: string
                      message:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      messages:
                        type: array
                        items:
                          type: object
        '404':
          description: Ticket not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
      x-codeSamples:
        - lang: cURL
          source: |
            curl --location '{server_url}/ext-api/get-customer-ticket-details/01934ef2-7340-73ed-909d-68613b1313d3/0192f7f7-1359-71c6-9b26-a3a15815b89b/019ae0ae-f2d6-73d7-959e-a9e14a16f883/ticket'

  /ext-api/v1/get-customer-ticket/{customer_id}/{organization_id}/tickets:
    get:
      summary: Get Customer Tickets
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Retrieve all tickets for a specific customer within an organization.
      operationId: get_customer_tickets
      parameters:
        - name: customer_id
          in: path
          required: true
          description: The unique identifier of the customer
          schema:
            type: string
        - name: organization_id
          in: path
          required: true
          description: The unique identifier of the organization
          schema:
            type: string
      responses:
        '200':
          description: Tickets retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        ticket_id:
                          type: string
                        title:
                          type: string
                        status:
                          type: string
                        created_at:
                          type: string
                          format: date-time
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
      x-codeSamples:
        - lang: cURL
          source: |
            curl --location '{server_url}/ext-api/get-customer-ticket/{customer_id}/{organization_id}/tickets'

  /ext-api/v1/get-customer-contact/{phone_no}/{organization_id}/contacts:
    get:
      summary: Get Customer Contact
      servers: 
        - url: https://kova-api.arkesel.com
      tags:
        - KOVA-IQ
      description: |
        Retrieve customer contact information using phone number and organization ID.
      operationId: get_customer_contact
      parameters:
        - name: phone_no
          in: path
          required: true
          description: The phone number of the customer
          schema:
            type: string
          example: "233544919953"
        - name: organization_id
          in: path
          required: true
          description: The unique identifier of the organization
          schema:
            type: string
      responses:
        '200':
          description: Contact retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "success"
                  data:
                    type: object
                    properties:
                      customer_id:
                        type: string
                      phone_no:
                        type: string
                      name:
                        type: string
                      email:
                        type: string
                      organization_id:
                        type: string
        '404':
          description: Contact not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: "error"
                  message:
                    type: string
      x-codeSamples:
        - lang: cURL
          source: |
            curl --location '{server_url}/ext-api/get-customer-contact/{phone_no}/{organization_id}/contacts'

components:
  schemas:
    CONTACT-SAVE:
      title: Add Contact
      type: object
      description: This model describes the information required to add a contact to a phone book
      properties:
        action:
          type: string
          example: subscribe-us
          enum:
            - subscribe-us
        api_key:
          type: string
          example: cE9QRUdCakRksjdksdjisfiwieff
          description: This can be found by clicking on the SMS API navigation link found in the SMS application
        phone_book:
          type: string
          description: The phone book / Contact group you want to insert the contact into.
        phone_number:
          type: string
          description: The phone number of the contact. Ensure they are in the international format. Eg. 233XXXXXXXXX
          example: "233544919953"
        first_name:
          type: string
          description: The first name of the contact
          example: Arkesel
        last_name:
          type: string
          description: The last name of the contact
          example: Dev
        email:
          type: string
          description: The email of the contact
          example: support@arkesel.com
        company:
          type: string
          example: Arkesel
          description: The company of the contact
      required:
        - action
        - api_key
        - phone_book
        - phone_number
      x-examples:
        ADD CONTACT:
          action: subscribe-us
          api_key: cE9QRUdCakRksjdksdjisfiwieff
          phone_book: SAVINGS AND LOANS
          phone_number: "233544919953"
          first_name: Arkesel
          last_name: Dev
          email: support@arkesel.com
          company: Arkesel
          user_name: vicpres
    SEND-SMS:
      title: SEND-SMS
      type: object
      description: This model describes the request to a SEND-SMS operation
      x-examples:
        SEND SMS:
          action: send-sms
          api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
          to: "233544919953"
          from: Arkesel
          sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
      properties:
        action:
          type: string
          enum:
            - send-sms
          example: send-sms
        api_key:
          type: string
          example: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
        to:
          type: string
          description: This parameter refers to the **MOBILE NUMBER** to which to Send message to
          example: "233544919953"
        from:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: Arkesel
          minLength: 1
          maxLength: 11
        sms:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*, so you send a message with
            *200 characters, the messages will be 2 pages.*
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
        use_case:
          enum:
            - promotional
            - transactional
          description: |
            This is used to determine whether the message is promotional or transactional. It also ensures that a sender ID registered for promotional messages is not used to send transactional messages, and vice versa. | Note: This applies only to **Nigerian** traffic.
          example: promotional
      required:
        - action
        - api_key
        - to
        - from
        - sms
    SCHEDULE-SMS:
      title: SCHEDULE-SMS
      type: object
      x-examples:
        SCHEDULE SMS:
          action: send-sms
          api_key: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
          to: "233544919953"
          from: Arkesel
          sms: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
          schedule: "13-01-2021 05:30 PM"
      description: This model describes the request to  a SCHEDULE-SMS operation
      properties:
        action:
          type: string
          enum:
            - send-sms
          example: send-sms
        api_key:
          type: string
          example: cE9QRUkdjsjdfjkdsj9kdiieieififiw=
        to:
          type: string
          description: This parameter refers to the **MOBILE NUMBER** to which to Send message to
          example: "233544919953"
        from:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: Arkesel
          minLength: 1
          maxLength: 11
        sms:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*, so you send a message with
            *200 characters, the messages will be 2 pages.*
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
        schedule:
          type: string
          description: "This is the time the message is scheduled to be sent to the number (s). Set your schedule in the format dd-mm-yyyy hh:mm AM/PM"
          example: "13-01-2021 05:30 PM"
        use_case:
          enum:
            - promotional
            - transactional
          description: |
            This is used to determine whether the message is promotional or transactional. It also ensures that a sender ID registered for promotional messages is not used to send transactional messages, and vice versa. | Note: This applies only to **Nigerian** traffic.
          example: promotional
      required:
        - action
        - api_key
        - to
        - from
        - sms
        - schedule
    GENERATE-OTP:
      title: Generate OTP
      type: object
      x-examples:
        GENERATE OTP:
          expiry: 5
          length: 6
          medium: sms
          message: "This is OTP from Arkesel, %otp_code%"
          number: "233544919953"
          sender_id: The cook
          type: numeric
      description: This model describes the request to GENERATE OTP operation
      properties:
        expiry:
          type: integer
          description: "This parameter refers to how long a code will last in minutes. The expiry value can be included in the OTP message adding **%expiry%** to the content. Example: *This is OTP from Arkesel, %otp_code%. Code will expiry in %expiry% minutes*"
          example: 5
          minimum: 1
          maximum: 10
        length:
          type: integer
          description: This parameter refers to the length of the generated code.
          example: 6
          minimum: 6
          maximum: 15
        message:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*.
            *A 200 characters messages will be 2 pages. Include the slot %otp_code% where the generated code should be
            inserted in the message*'
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
        medium:
          type: string
          enum:
            - sms
            - voice
          example: sms
        number:
          type: string
          description: The phone number of the contact.
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
        sender_id:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: Arkesel
          minLength: 1
          maxLength: 11
        type:
          type: string
          enum:
            - numeric
            - alphanumeric
          example: numeric
      required:
        - expiry
        - length
        - medium
        - message
        - number
        - sender_id
        - type
    VERIFY-OTP:
      title: Verify OTP
      type: object
      x-examples:
        GENERATE OTP:
          code: 173882
          number: "233544919953"
      description: This model describes the request to GENERATE OTP operation
      properties:
        code:
          type: string
        number:
          type: string
          description: The phone number of the contact.
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
      required:
        - code
        - number
    CHECK-BALANCE:
      title: CHECK-BALANCE-RESPONSE
      type: object
      description: This model describes the request to CHECK-BALANCE operation
      x-examples:
        ACCOUNT BALANCE:
          action: check-balance
          api_key: cE9QRUdCskdjsfiwi329ehfidhXF6dD0=
          response: json
      properties:
        action:
          type: string
          enum:
            - check-balance
          example: check-balance
        api_key:
          type: string
          example: cE9QRUdCskdjsfiwi329ehfidhXF6dD0=
          description: ""
        response:
          type: string
          enum:
            - json
          example: json
          description: Describes the format of the response for this operation
      required:
        - action
        - api_key
        - response
    BATCH-SMS-EPORT:
      title: Batch SMS Report
      type: object
    BATCH-SMS-REPORT:
      title: Batch SMS Report
      type: object
      # description: This model describes the request for a SEND_SMS operation
      description: This model describes the request to BATCH SMS REPORT operation
      x-examples:
        BATCH SMS REPORT:
          msg_ids:
            - "9b61686b-b7a9-4167-bebe-808467635c05"
            - "f3be70c1-3545-4677-b607-6b5f32202652"
      properties:
        msg_ids:
          type: array
          description: List of SMS UUIDs that you want to get the details of. A minimum of 1 and maximum of 1000 UUIDs is accepted per request.
          example: "9b61686b-b7a9-4167-bebe-808467635c05"
          # minSize: 1
          maxLength: 1000
      required:
        - msg_ids
    SEND-SMS-RESPONSE:
      description: This model describes the response  to a SEND-SMS operation
      type: object
      properties:
        code:
          type: string
          minLength: 1
          example: ok
          description: "This "
        message:
          type: string
          minLength: 1
        balance:
          type: number
        main_balance:
          type: number
        user:
          type: string
          minLength: 1
      required:
        - code
        - message
        - balance
        - main_balance
        - user
      x-examples:
        SEND SMS RESPONSE:
          code: ok
          message: Successfully Sent
          balance: 1185
          main_balance: 2.974
          user: Arkesel Dev
    SCHEDULE-SMS-RESPONSE:
      description: This model describes the response  to a SCHEDULE-SMS operation
      type: object
      properties:
        code:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        sms_balance:
          type: number
        main_balance:
          type: number
        user:
          type: string
          minLength: 1
      required:
        - code
        - message
        - sms_balance
        - main_balance
        - user
      x-examples:
        SCHEDULE SMS RESPONSE:
          code: ok
          message: SMS Scheduled successfully.
          sms_balance: 1184
          main_balance: 2.974
          user: Arkesel Dev
    CHECK-BALANCE-RESPONSE:
      description: This model describes the response to the CHECK-BALANCE operation
      type: object
      properties:
        balance:
          type: number
        user:
          type: string
          minLength: 1
        country:
          type: string
          minLength: 1
      required:
        - balance
        - user
        - country
      x-examples:
        CHECK BALANCE RESPONSE:
          balance: 1185
          user: Arkesel Dev
          country: Ghana
    CONTACT_GROUP:
      title: Create contact group
      type: object
      description: This model describes the information required to create a contact group.
      properties:
        group_name:
          type: string
          description: The group name used to create a contact group
          example: New Customers
      required:
        - group_name
      x-examples:
        CREATE CONTACT GROUP:
          group_name: New Customers
    MESSAGE_RESPONSE:
      title: Message response
      type: object
      description: This model describes the response to an operation which just contains a message.
      properties:
        status:
          type: string
          description: "The status of the request, whether success or error."
          example: success
        message:
          type: string
          description: This is the message attached to the response.
          example: Contact group has been created successfully!
      required:
        - status
        - message
    VOICE_SMS_RESPONSE:
      title: Message response
      type: object
      description: This model describes the response to an operation which just contains a message.
      properties:
        status:
          type: string
          description: "The status of the request, whether success or error."
          example: success
        message:
          type: string
          description: This is the message attached to the response.
          example: Contact group has been created successfully!
        campaign_id:
          type: string
          description: This unique identfier represents the voice campaign. Each voice sms api request will be assigned a unique id
          example: C3456ed345b3b
      required:
        - status
        - message
    MESSAGE_REPORT_RESPONSE:
      title: Batch SMS Report Response
      type: object
      description: This model describes the response to Batch SMS Report operation
      x-examples:
        SMS_DETAILS_RESPONSE:
          status: success
          data:
            f3be70c1-3545-4677-b607-6b5f32202652:
              status: DELIVERED
              sender: Arkesel
              recipient: "233500000000"
              message: Welcome to version 2 of our API!
              message_count: 1
              sent_at_time: "2021-04-09 18:44:05"
            9b61686b-b7a9-4167-bebe-808467635c05:
              status: DELIVERED
              sender: Arkesel
              recipient: "233540000000"
              message: Welcome to version 2 of our API!
              message_count: 1
              sent_at_time: "2021-04-09 18:44:05"
      properties:
        status:
          type: string
          example: success
        data:
          type: object
          example:
            f3be70c1-3545-4677-b607-6b5f32202652:
              status: DELIVERED
              sender: Arkesel
              recipient: "233500000000"
              message: Welcome to version 2 of our API!
              message_count: 1
              sent_at_time: "2021-04-09 18:44:05"
            9b61686b-b7a9-4167-bebe-808467635c05:
              status: DELIVERED
              sender: Arkesel
              recipient: "233540000000"
              message: Welcome to version 2 of our API!
              message_count: 1
              sent_at_time: "2021-04-09 18:44:05"
          description: Contains the details of all requested sms reports
      required:
        - status
        - data
    MESSAGE_REPORT_FAILED_RESPONSE:
      title: Message response
      type: object
      description: This model describes the response to an operation which just contains a message.
      properties:
        status:
          type: string
          description: "The status of the request, whether success or error."
          example: failed
        timestamp:
          type: string
          description: "The datetime value of the error occurring."
          example: 2023-01-01 12:59:59
        message:
          type: string
          description: This is the message attached to the response.
          example: An error has occurred, please contact support.
      required:
        - status
        - timestamp
        - message
    OTP_MESSAGE_RESPONSE:
      title: OTP Message response
      type: object
      properties:
        code:
          type: string
          description: "The code of the request, whether success or error."
          example: 1000
        ussd_code:
          type: string
          description: "Recipient can also check for the OTP code using this USSD code. OTP Code is accessible to the receiving phone number only."
          example: "*928*01#"
        message:
          type: string
          description: This is the message attached to the response.
          example: "Successful, Message delivered"
      required:
        - code
        - ussd_code
        - message
      description: This model describes the response to an operation which just contains a message.
    CONTACT:
      title: Add Contacts in a contact group
      type: object
      description: This model describes the information required to add contacts into a contact group. **Please note that the phone_number field is required**.
      properties:
        group_name:
          type: string
          example: New Customers
        contacts:
          type: array
          example:
            - phone_number: "233544919953"
            - phone_number: "233544919953"
              first_name: Arkesel
              last_name: Dev
              company: Arkesel
              email_address: support@arkesel.com
              user_name: kadzam
      required:
        - group_name
        - contacts
      x-examples:
        ADD CONTACT:
          group_name: New Customers
          contacts:
            - phone_number: "233544919953"
              first_name: Arkesel
              last_name: Dev
              company: Arkesel
              email_address: support@arkesel.com
              user_name: kadzam
            - phone_number: "233544919953"
    SEND_SMS:
      title: Send SMS
      type: object
      description: This model describes the request for a SEND_SMS operation
      x-examples:
        SEND SMS:
          sender: Arkesel
          message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
          recipients:
            - "233544919953"
            - "233544919953"
        SEND SCHEDULED SMS:
          sender: Arkesel
          message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
          recipients:
            - "233544919953"
            - "233544919953"
          scheduled_date: "2021-04-09 07:30 AM"
        SEND SMS WITH DELIVERY WEBHOOK:
          sender: Arkesel
          message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
          recipients:
            - "233544919953"
            - "233544919953"
          callback_url: "https://webhook.site/sms/delivery_webhook"
        SEND SANDBOXED SMS:
          sender: Arkesel
          message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
          recipients:
            - "233544919953"
            - "233544919953"
          sandbox: true
      properties:
        sender:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: APT INC
          minLength: 1
          maxLength: 11
        recipients:
          type: array
          description: This parameter refers to the **MOBILE NUMBER(S)** to which to Send message to
          example:
            - "233544919953"
            - "233544919953"
        message:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*. *A 200 characters messages will be 2 pages.*
          example: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
        callback_url:
          type: string
          description: |-
            ### Callback URL

            A URL that will be called to notify you about the status of the message to a particular number.

            - It must be a valid URL
            - The notification request to your url will have 2 query parameters, sms_id and status.
              - The sms_id is the unique id that is attached to a message in the response when a request is made
                with the callback_url. The sms_id is a 16 character unique identifier (UUID).
              - The status is the status of the message to phone number correlating to the sms_id has values
                such as DELIVERED, SUBMITTED, PROHIBITED, QUEUED, NOT_DELIVERED, EXPIRED.
            - Please make sure your URL is exempted from any pre-authorization/authentication in your application to
              avoid delivery notification failure.
          example: "https://webhook.site/sms/delivery_webhook"
        scheduled_date:
          type: string
          description: "In the case of scheduling an SMS request, you need to add the scheduled_date field to it. Its in the format 'Y-m-d H:i A'"
          example: "2021-03-23 10:30 PM"
        use_case:
          enum:
            - promotional
            - transactional
          description: |
            This is used to determine whether the message is promotional or transactional. It also ensures that a sender ID registered for promotional messages is not used to send transactional messages, and vice versa. | Note: This applies only to **Nigerian** traffic.
          example: promotional
        sandbox:
          type: boolean
          description: |
            This is used to send a test SMS request to the system. You are not billed for this operation.
            Messages sent in a sandboxed environment are not forwarded to the mobile network providers for delivery.
            Sandbox messages can only be seen from the SMS history report. This is a great environment to test your
            application without any cost.
          example: true
      required:
        - sender
        - recipients
        - message
    SEND_SMS_WITH_DELIVERY_WEBHOOK_RESPONSE:
      title: Send sms with a delivery webhook
      type: object
      description: This model describes the request to CHECK-BALANCE operation
      x-examples:
        SEND_SMS_WITH_DELIVERY_WEBHOOK_RESPONSE:
          status: success
          data:
            - recipient: "233544919953"
              id: 9b752841-7ee7-4d40-b4fe-768bfb1da4f0
            - recipient: "233544919953"
              id: 7ea01acd-485c-4df3-b646-e9e24430e145
      properties:
        status:
          type: string
          example: success
        data:
          type: object
          example:
            - recipient: "233544919953"
              id: 9b752841-7ee7-4d40-b4fe-768bfb1da4f0
            - recipient: "233544919953"
              id: 7ea01acd-485c-4df3-b646-e9e24430e145
          description: Contains the notification id and recipient it belongs to so that it can be identified during the delivery notification process.
      required:
        - status
        - data
    SEND_TEMPLATE_SMS:
      title: Send variable SMS
      type: object
      description: This model describes the request for a SEND SMS USING TEMPLATE operation
      x-examples:
        SEND TEMPLATE SMS:
          sender: Arkesel
          message: Hello <%name%>, have a safe journey to <%city%>. Stay safe!
          recipients:
            "233553995047":
              name: Josh
              city: Accra
            "233544919953":
              name: Joel
              city: Beinjin
      properties:
        sender:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: APT INC
          minLength: 1
          maxLength: 11
        recipients:
          type: array
          description: This parameter refers to the **MOBILE NUMBER(S)** to which to send message to, and the variables replaceable. All recipients should have equal arrays with same keys for variables replacebale in the message.
          example:
            recipients:
              "233553995047":
                name: Josh
                city: Accra
              "233544919953":
                name: Joel
                city: Beinjin
        message:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*. *A 200 characters messages will be 2 pages.*
            Tags to be replaced in the message should start with (<%) and end with (%>).
            Eg. <%name%>.
          example: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
        callback_url:
          type: string
          description: |-
            ### Callback URL

            A URL that will be called to notify you about the status of the message to a particular number.

            - It must be a valid URL
            - The notification request to your url will have 2 query parameters, sms_id and status.
              - The sms_id is the unique id that is attached to a message in the response when a request is made
                with the callback_url. The sms_id is a 16 character unique identifier (UUID).
              - The status is the status of the message to phone number correlating to the sms_id has values
                such as DELIVERED, SUBMITTED, PROHIBITED, QUEUED, NOT_DELIVERED, EXPIRED.
            - Please make sure your URL is exempted from any pre-authorization/authentication in your application to
              avoid delivery notification failure.
            - The url provided will be used for all the variable messages in the request.
          example: "https://webhook.site/sms/delivery_webhook"
        scheduled_date:
          type: string
          description:
            "In the case of scheduling an SMS request, you need to add the scheduled_date field to it. Its in
            the format 'Y-m-d H:i A' This date will be applied to all the separate messages to be delivered.
            All messages sent through this request will be scheduled for the date specified in this field."
          example: "2021-03-23 10:30 PM"
        use_case:
          enum:
            - promotional
            - transactional
          description: |
            This is used to determine whether the message is promotional or transactional. It also ensures that a sender ID registered for promotional messages is not used to send transactional messages, and vice versa. | Note: This applies only to **Nigerian** traffic.
          example: promotional
        # sandbox:
        #   type: boolean
        #   description: |
        #     This is used to send a test SMS request to the system. You are not billed for this operation.
        #     Messages sent in a sandboxed environment are not forwarded to the mobile network providers for delivery.
        #     Sandbox messages can only be seen from the SMS history report. This is a great environment to test your
        #     application without any cost.
        #   example: true
      required:
        - sender
        - recipients
        - message
    CHECK_BALANCE_RESPONSE:
      title: Check balance of user
      type: object
      description: This model describes the request to CHECK-BALANCE operation
      x-examples:
        CHECK_BALANCE_RESPONSE:
          status: success
          data:
            - sms_balance: "2003"
            - main_balance: GHS 20.99
      properties:
        status:
          type: string
          example: success
        data:
          type: object
          example:
            - sms_balance: "2003"
            - main_balance: GHS 20.99
          description: Contains the main balance and sms balance of the user
      required:
        - status
        - data
    SMS_DETAILS_RESPONSE:
      title: Get SMS details
      type: object
      description: This model describes the response to SMS-DETAILS operation
      x-examples:
        SMS_DETAILS_RESPONSE:
          status: success
          data:
            ID: f3be70c1-3545-4677-b607-6b5f32202652
            status: DELIVERED
            sender: Arkesel
            recipient: "233544919953"
            message: Welcome to version 2 of our API!
            message_count: 1
            sent_at_time: "2021-04-09 18:44:05"
      properties:
        status:
          type: string
          example: success
        data:
          type: object
          example:
            ID: f3be70c1-3545-4677-b607-6b5f32202652
            status: DELIVERED
            sender: Arkesel
            recipient: "233544919953"
            message: Welcome to version 2 of our API!
            message_count: 1
            sent_at_time: "2021-04-09 18:44:05"
          description: Contains the details of an sms sent
      required:
        - status
        - data
    SEND_VOICE_SMS:
      title: Send Voice SMS
      type: object
      description: This model describes the information required to send a voice sms to recipients
      x-examples:
        SEND_VOICE_SMS:
          voice_file: "/C:/files/voice_message.mp3"
          voice_id: "0540000000"
          recipients:
            - "233544919953"
            - "233544919953"
        SEND_VOICE_SMS_WITH_WEBHOOK:
          voice_file: "/C:/files/voice_message.mp3"
          voice_id: "0540000000"
          retry: "false"
          recipients:
            - "233544919953"
            - "233544919953"
          callback_url: "https://my-domain.com/voice/callback"
      properties:
        voice_file:
          type: string
          format: binary
        voice_id:
          type: string
          maxLength: 10
          description: A Voice ID or DID number that can be used for the Voice SMS. Voice ID is optional. To register a voice ID, please contact  [support@arkesel.com](mailto:support@arkesel.com).
          example: "0540000000"
          required: false
        retry:
          type: string
          # default: true
          description: By default, calls will be retried when any status but ANSWERED is return. To disable retries for the voice SMS request, pass the value 'false' to the retry field in your request. `retry` is an optional field.
        recipients:
          type: array
          example:
            - "233544919953"
            - "233544919953"
        callback_url:
          type: string
          description: |-
            A url where the campaign ID, status of the call and recipient's number will be returned to. callback_url is an optional field.
            It must be a valid URL.
            The notification request to your url will have 3 query parameters, campaign_id, recipient and status.
            The campaign_id is a unique id that is attached to a voice sms request.

            The status is the status of the call made to phone number . The status can have values such as :
            1. ANSWERED - Call was answered by the recipient
            2. NO ANSWER - Call was not answered by the recipient.
            3. BUSY - This status could mean a few things such the call was rejected by the recipient, the recipient was on another call when this call was made, recipients phone number could not be reached due to a netwrok challenge or the recipients phone was off.
            4. SUBMITTED - Call has been submitted and is waiting to be processed.

            Please make sure your URL is exempted from any pre-authorization/authentication in your application to avoid delivery notification failure.'

            A sample of the webhook's payload can be found in the ``WEBHOOK PAYLOAD FOR VOICE SMS`` response sample.
          # description: A url where the campaign ID, status of the call and recipient's number will be returned to. callback_url is an optional field. A sample of the webhook's payload can be found in the `WEBHOOK PAYLOAD FOR VOICE SMS` response sample
          # description: The status of the call and recipient's number will be returned to the url if a status other than ANSWERED is received. `callback_url` is an optional field.
          example: "https://my-domain.com/voice/callback"
      required:
        - recipients
        - voice_file
      # optional:
      #   - voice_id
    SEND_SMS_TO_CONTACT_GROUP:
      title: Send SMS to contact group
      type: object
      description: This model describes the information required to send sms to recipients in a contact group
      properties:
        sender:
          type: string
          description: A Sender ID (from address) is the name or number that identifies the sender of an SMS message. Note that this field should be 11 characters max including space. Anything more than that will result in your messages failing.
          example: APT INC
          minLength: 1
          maxLength: 11
        group_name:
          type: string
          description: The group name used to create a contact group
          example: New Customers
        message:
          type: string
          description: |
            Content of your message should go here. A one-page *message = 160 character*. *A 200 characters messages will be 2 pages.*
          example: Hello world. Spreading peace and joy only. Remeber to put on your face mask. Stay safe!
      required:
        - sender
        - group_name
        - message
      x-examples:
        SEND SMS TO CONTACT GROUP:
          sender: Arkesel
          message: Hello world. Spreading peace and joy only. Remember to put on your face mask. Stay safe!
          group_name: New Customers
    USSDREQUEST:
      description: This object describes the format of the request sent to clients endpoint URL
      type: object
      x-examples:
        sample-1:
          sessionID: "2005506191900168"
          userID: USSD_DOCUMENTATION
          newSession: true
          msisdn: "233271231234"
          userData: "*928*1#"
          network: AIRTELTIGO
      properties:
        sessionID:
          type: string
          description: "This is generated by USSD Server for identifying the request. In a valid session, the sessionID values in the subsequent request messages are the same."
        userID:
          type: string
          description: This is a unique identification created by ARKESEL's platform for you during the subscription process.
        newSession:
          type: boolean
          description: This indicates whether an incoming request is an initiating/new request.
        msisdn:
          type: string
          description: This is the mobile number of the user initiating the request.
        userData:
          type: string
          description: This is the value entered by the user on user’s handset device.
        network:
          type: string
          description: This is the mobile network provider for the incoming request.
      required:
        - sessionID
        - userID
        - newSession
        - msisdn
        - userData
        - network
    USSDRESPONSE:
      description: This is the response to the user’s request. You should provide a response to the request in the Sample Response Format below. The response body should have the elements as described below.
      type: object
      x-examples:
        sample-1:
          sessionID: "2005506191900168"
          userID: USSD_DOCUMENTATION
          msisdn: "233271231234"
          message: Welcome to ARKESEL USSD Documentation
          continueSession: false
      properties:
        sessionID:
          type: string
          minLength: 1
          description: "This is generated by USSD Server for identifying the request. In a valid session, the sessionID values in the subsequent request messages are the same. This parameter must be exactly the same as in the request"
        userID:
          type: string
          minLength: 1
          description: This is a unique identification created by ARKESEL's platform for third parties during the subscription process. This parameter must be exactly the same as in the request
        msisdn:
          type: string
          minLength: 1
          description: This is the mobile number of the user initiating the request. This parameter must be exactly the same as in the request
        message:
          type: string
          minLength: 1
          description: "This is a mandatory parameter that holds the message to be displayed on the user’s phone "
        continueSession:
          type: boolean
          description: |-
            This indicates whether the session should continue or be terminated.

            The USSD session is terminated when ```continueSession``` is ```false```, it continues to allow for user input when ```true```.
          default: false
      required:
        - sessionID
        - userID
        - msisdn
        - message
        - continueSession
    GET_GROUPS:
      title: Get Contacts
      description: This model retrieves contact groups with optional display of associated contacts
      x-examples:
        GET_GROUPS:
          action: getGroups
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
        showContacts:
          type: string
          # default: true
          description: can be included as part of the query parameters with a value of "yes” to display the associated contacts of each group.
          required: false
      required:
        - token
    GET_CONTACTS:
      title: Get Contacts
      description: This model returns a list of contacts with detailed information.
      x-examples:
        GET_CONTACTS:
          action: getContacts
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
      required:
        - token
    ADD_CONTACTS:
      title: Add Contacts in a contact group
      type: object
      description: This model describes the information required to add a new contact into a contact group. **Please note that the phone_number field is required**.
      x-examples:
        ADD_CONTACT:
          action: addContact
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          phone: "233544919953"
          name: "233544919953"
          group: New clients
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
        phone:
          type: string
          example: "233544919953"
          description: This is the phone number of the contact you want to add
          required: true
        name:
          type: string
          example: Dev
          description: The name of the contact to be added
          required: false
        group:
          type: string
          example: New clients
          description: Name of group you want to assign contact to. You can provide the name of an existing group or a name of a new group to be created.
          required: false
      required:
        - token
        - phone      
    GET_CAMPAIGNS:
      title: Get Campaigns
      description: This model retrieve campaigns created via API or dashboard
      x-examples:
        GET_CAMPAIGNS:
          action: getCampaigns
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
        type:
          enum:
            - promotional
            - transactional
          # default: true
          description: this parameter will help you fetch campaign data created via the API or the dashboard. The values to be passed to the is parameter are api and regular
          required: false
      required:
        - token
        - type
    SEND_CAMPAIGN:
      title: Create and send campaigns to specific contacts, groups, or all contacts
      type: object
      description: This model describes the information required to send a campaign message.
      x-examples:
        SEND_CAMPAIGN:
          action: sendcampaigns
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          phone: "233544919953"
          group_id: 
          schedule_time: 
          template_id: "805265648148957"
          campaign_name: "First API Campaign"
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
        phone:
          type: string
          example: "233544919953"
          description: This is the phone number of the contact you want to send the campaign message to
          required: false
        group_id:
          type: string
          example: Dev
          description: The ID for the contact group you want to send the campaign message to
          required: false
        schedule_time:
          type: string
          example: "2024-10-29 13:37"
          description: The time the campaign should be processed. If left empty, the campaign will be process immediately.
          required: false
        template_id:
          type: string
          example: "805265648148957"
          description: The ID of the template to be used for the campaign
          required: true
        campaign_name:
          type: string
          example: "First API Campaign"
          description: The name of the campaign you are about to send out.
          required: true
      required:
        - token
        - template_id
        - campaign_name
    LIST_TEMPLATES:
      title: List Templates
      description: This model lists all your message templates.
      x-examples:
        GET_GROUPS:
          action: get_templates
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
      required:
        - token
    SEND_TEMPLATE_MESSAGE:
      title: Send template messages for authentication (OTP), marketing, or utility purposes to contacts.
      type: object
      description: This model describes the information required to send a template message.
      x-examples:
        SEND_TEMPLATE_MESSAGE_WITHOUT_VARIABLES:
          action: sendtemplatemessage
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          to: "233544919953"
          from: "233544919953"
          channel: "whatsapp"
          contentType: "template"
          templateId: "no_variable_template"
          templateLanguage: "en"
          response: json
        SEND_TEMPLATE_MESSAGE_WITH_VARIABLES:
          action: sendtemplatemessage
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          to: "233544919953"
          from: "233544919953"
          channel: "whatsapp"
          contentType: "template"
          templateId: "auth_template"
          templateLanguage: "en"
          response: json
        SEND_AUTHENTICATION_TEMPLATE_MESSAGE:
          action: sendtemplatemessage
          token: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          to: "233544919953"
          from: "233544919953"
          channel: "whatsapp"
          contentType: "template"
          templateId: "variable_template"
          templateLanguage: "en"
          response: json
      properties:
        token:
          type: string
          example: TiLQv3QiU2n01i9JIZBhP5xFKWFOrLnLrBmLKYxcfadadb15
          description: "This is the API token used for authentication."
          required: true
        to:
          type: string
          example: "233544919953"
          description: The message recipient
          required: true
        from:
          type: string
          example: "233544919953"
          description: Your registered WhatsApp business account number.
          required: true
        channel:
          type: string
          example: "whatsapp"
          description: The channel through which the message will be sent. The only accepted value is `whatsapp` .
          required: true
        contentType:
          type: string
          example: "template"
          description: The type of the content of the message to be sent. The only accepted value is `template`
          required: true
        templateId:
          type: string
          example: "pilot_template"
          description: The name of the template to be used to send the message. 
          required: true
        templateLanguage:
          type: string
          example: "en"
          description: The language set at the time of template creation. 
          required: true
        components:
          type: object
          example: "en"
          description: The component field should be set as an empty object if the template does not have any variables.
          required: true
      required:
        - token
        - to
        - from
        - channel
        - contentType
        - templateId
        - templateLanguage
    CREATE_CAMPAIGN:
      title: Create survey campaign
      type: object
      description: This model describes the information required to create a survey campaign. **Please note that the title, survey_id and recipients  fields are required**.
      x-examples:
        CREATE_CAMPAIGN:
          title: Demo Survey Campaign
          survey_id: 0197f961-c1b4-71c2-a663-e521a7f9b282
          start_date: "2025-10-13 12:35 PM"
          end_date: "2025-10-13 01:30 PM"
          recipients: 
            - "233544919953"
            - "233501234567"
          response: json
      properties:
        title:
          type: string
          example: Demo Survey Campaign
          description: "This is the title of the survey campaign."
          required: true
        survey_id:
          type: string
          example: "0197f961-c1b4-71c2-a663-e521a7f9b282"
          description: This is the id of the survey you want to use for the campaign. You can get the survey id from the dashboard.
          required: true
        start_date:
          type: string
          example: 2025-10-13 12:35 PM
          description: This is to be provided only when you wish to schedule campaign
          required: false
        end_date:
          type: string
          example: 2025-10-13 01:30 PM
          description: This is to be provided only when you wish to schedule campaign. It must be greater than or equal to start_date if provided
          required: false
        recipients:
          type: array
          example: 233544919953, 233501234567
          description: The list of phone numbers to send the survey to. The phone numbers must be in international format without the + sign and separated by commas.
          required: true
      required:
        - title
        - survey_id 
        - recipients 
    FETCH-SURVEY-CAMPAIGN-LOGS:
      title: Fetch Survey Campaign Call Log Summary
      type: object
      description: This model describes the information required to fetch the call log summary for a specific survey campaign.
      properties:
        campaignId:
          type: string
          example: 0197f41b-8172-7276-bcb7-1146bb33c814
          description: "This is the unique identifier for the survey campaign whose call log summary is to be fetched."
          required: true
  securitySchemes:
    api-key:
      name: api-key
      type: apiKey
      in: header
      description: |-
        This parameter is required for SMS API Version 2, Voice API and OTP API calls. You will find our API key when you
        click on the SMS API navigation link found in the Arkesel SMS application. The API Key is used to authorize and
        authenticate towards the other end-points of the API.
    x-api-key:
      name: x-api-key
      type: apiKey
      in: header
      description: |-
        This parameter is required. You will find our API key when you
        click on the API navigation link found in the Arkesel Voice Connect dashboard. The API Key is used to authorize and
        authenticate towards the other end-points of the API.
  parameters: {}
  responses: {}
security:
  - api_key: []

