Documention

Before You Get Started
A brief overview of the API and its purpose
Endpoints: A list of all the endpoints available in the API, including their URLs and the HTTP methods they support.
Request and Response: The expected request format and the format of the response, including examples of how to use the API and the data that it returns.
Send Email

This PHP method uses cURL to send email data to an API endpoint, receiving a JSON response with email request status and logs.
														
$curl = curl_init();
$postdata = array(
    "contact" => array(
        array(
            "subject" => "demo list info",
            "email" => "receiver1@email.com",
            "message" => "In publishing and graphic design, Lorem ipsum text",
            "sender_name" => "name",
            "reply_to_email" => "demo@gmail.com"
        ),
        array(
            "subject" => "demo list info",
            "email" => "receiver2@email.com",
            "message" => "1",
            "sender_name" => "name",
            "reply_to_email" => "demo@gmail.com"
        )
    )
);

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/email/send',
    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 =>json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
        'Content-Type: application/json'
    ),
));
$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "email_logs": [
        {
            "uid": "20034f80-f778-4d3e-a636-5c1f161b954f",
            "email": "receiver1@email.com",
            "status": "Pending",
            "created_at": "2023-10-16 04:14 PM"
        },
        {
            "uid": "c4ad7ae2-3cfd-4066-ab31-4d31c3d078db",
            "email": "receiver2@email.com",
            "status": "Pending",
            "created_at": "2023-10-16 04:14 PM"
        }
    ],
    "message": "New Email request sent, please see in the Email history for final status"
}
                                                        
														

Using cURL, this PHP code fetches email log details for a specific identifier (uid) from an API, including recipient email, content, status, and the latest update time.
														
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/get/email/{uid}',
    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',
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
    ),
));

$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "email_logs": {
        "uid": "60aca9dd-ce15-451c-b8d8-86ca01b0",
        "email": "receiver1@email.com",
        "content": "some content",
        "status": "Pending",
        "updated_at": "2023-10-16 08:15 PM"
    }
}
                                                        
														
Send SMS

This PHP method sends SMS messages via cURL to an API endpoint, receiving a JSON response with SMS request status and logs.
														
$curl = curl_init();
$postdata = array(
    "contact" => array(
        array(
            "number" => "11254352345",
            "body" => "In publishing and graphic design, Lorem ipsum is a",
            "sms_type" => "plain"
        ),
        array(
            "number" => "32234213423",
            "body" => "In publishing and graphic design, Lorem ipsum is a",
            "sms_type" => "unicode"
        )
    )
);

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/sms/send',
    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 =>json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
        'Content-Type: application/json',
    ),
));

$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "sms_logs": [
        {
            "uid": "5eb8c1b2-6832-4c91-a813-6e06062c8584",
            "number": "11254352345",
            "status": "Pending",
            "created_at": "2023-10-16 04:59 PM"
        },
        {
            "uid": "3d783e68-8f87-4374-a6b4-d07d23b30fff",
            "number": "32234213423",
            "status": "Pending",
            "created_at": "2023-10-16 04:59 PM"
        }
    ],
    "message": "New SMS request sent, please see in the SMS history for final status"
}

                                                        
														

This PHP code, employing cURL, retrieves SMS log data for a unique identifier (uid) from an API, including status, recipient number, message content, and the last update timestamp.
														
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/get/sms/{uid}',
    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',
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
    ),
));

$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "sms_logs": {
        "uid": "43339822-9d44-413e-b8b6-5cafc8be",
        "number": "11254352345",
        "content": "In publishing and graphic design, Lorem ipsum is a",
        "status": "Schedule",
        "updated_at": "2023-10-16 08:10 PM"
    }
}

                                                        
														
Send Telegram

This PHP method uses cURL to send Telegram messages via an API. The response contains the status of the sent messages and directs users to check the Telegram Log history for final status.
                                                              
  $curl = curl_init();
  $postdata = array(
      "contact" => array(
          array(
              "number" => "880123456789",
              "message" => "In publishing and graphic design, Lorem ipsum"
          ),
          array(
              "number" => "880123456789",
              "message" => "Scheduled message",
              "schedule_at" => "2023-10-16 20:04:00"
          ),
          array(
              "number" => "880123456799",
              "message" => "Message sent through a specific gateway",
              "gateway_identifier" => "b6ca078b-8a6d-4293-8118-b1498d4588aa"
          )
      )
  );

  curl_setopt_array($curl, array(
      CURLOPT_URL => 'https://www.prosender.promobangla.com/api/telegram/send',
      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 =>json_encode($postdata),
      CURLOPT_HTTPHEADER => array(
          'Api-key: ###########################,
          'Content-Type: application/json',
      ),
  ));

  $response = curl_exec($curl);
  curl_close($curl);

  //response will return data in this format
  {
      "status": "success",
      "telegram_logs": [
          {
              "id": 1,
              "created_at": "2023-10-16 20:04:00",
              "status": "Pending",
              "message": {
                  "message": "In publishing and graphic design, Lorem ipsum",
                  "file_info": null
              },
              "contact": {
                  "first_name": null,
                  "last_name": null,
                  "telegram_contact": "880123456789",
                  "meta_data": null
              }
          }
      ],
      "message": "New Telegram dispatch request created successfully"
  }
                                                              
                                                              

Using cURL, this PHP code fetches Telegram log data for a unique identifier (id) from an API, including recipient number, message content, status, and the last update timestamp.
  														
  $curl = curl_init();

  curl_setopt_array($curl, array(
      CURLOPT_URL => 'https://www.prosender.promobangla.com/api/get/telegram/{uid}',
      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',
      CURLOPT_HTTPHEADER => array(
          'Api-key: ###########################,
      ),
  ));

  $response = curl_exec($curl);
  curl_close($curl);

  //response will return data in this format
  {
      "status": "success",
      "data": {
          "id": 1,
          "created_at": "2023-10-16 20:04:00",
          "status": "Pending",
          "message": {
              "message": "In publishing and graphic design, Lorem ipsum",
              "file_info": null
          },
          "contact": {
              "first_name": null,
              "last_name": null,
              "telegram_contact": "880123456789",
              "meta_data": null
          }
      },
      "message": "Successfully fetched telegram message from Logs"
  }

                                                          
  														
Send WhatsApp

This PHP method uses cURL to send WhatsApp messages via an API, offering features like text and media messages. The response contains the status of the sent messages and directs users to check the WhatsApp Log history for final status.
                                                            
$curl = curl_init();
$postdata = array(
    "contact" => array(
        array(
            "number" => "880123456789",
            "message" => "In publishing and graphic design, Lorem ipsum"
        ),
        array(
            "number" => "880123456789",
            "message" => "In publishing and graphic design, Lorem ipsum",
            "media" => "image",
            "url" => "https://example.com/image.jpeg"
        ),
        array(
            "number" => "880123456799",
            "message" => "In publishing an audio file, Lorem ipsum",
            "media" => "audio",
            "url" => "https://example.com/audio.mp3"
        ),
        array(
            "number" => "880123456799",
            "message" => "In publishing a video file, Lorem ipsum",
            "media" => "video",
            "url" => "https://example.com/video.mp4"
        ),
        array(
            "number" => "880123456799",
            "message" => "In publishing a document file, Lorem ipsum",
            "media" => "document",
            "url" => "https://example.com/document.pdf"
        )
    )
);

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/whatsapp/send',
    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 =>json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
        'Content-Type: application/json',
    ),
));

$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "whatsapp_logs": [
        {
            "uid": "b6ca078b-8a6d-4293-8118-b1498d4588aa",
            "to": "880123456789",
            "status": "Pending",
            "created_at": "2023-10-16 08:04 PM"
        },
        {
            "uid": "83beaaae-27d1-42fd-879d-464e393990d8",
            "to": "880123456789",
            "status": "Pending",
            "created_at": "2023-10-16 08:04 PM"
        },
        {
            "uid": "66c54d4b-b02e-41ab-9651-6805a7679dcb",
            "to": "880123456799",
            "status": "Pending",
            "created_at": "2023-10-16 08:04 PM"
        },
        {
            "uid": "ed4a8aa8-820b-4019-b889-b93ebcd7a636",
            "to": "880123456799",
            "status": "Pending",
            "created_at": "2023-10-16 08:04 PM"
        },
        {
            "uid": "9ade281f-341d-49bb-9a8f-f43c47f0cc8c",
            "to": "880123456799",
            "status": "Pending",
            "created_at": "2023-10-16 08:04 PM"
        }
    ],
    "message": "New WhatsApp Message request sent, please see in the WhatsApp Log history for final status"
}
                                                            
                                                            

Using cURL, this PHP code fetches WhatsApp log data for a unique identifier (uid) from an API, including recipient number, message content, status, and the latest update time.
														
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://www.prosender.promobangla.com/api/get/whatsapp/{uid}',
    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',
    CURLOPT_HTTPHEADER => array(
        'Api-key: ###########################,
    ),
));

$response = curl_exec($curl);
curl_close($curl);

//response will return data in this format
{
    "status": "success",
    "whats_log": {
        "uid": "f2e43ee3-7fd5-4587-9f10-0e686c3b",
        "number": "880123456789",
        "content": "In publishing and graphic design, Lorem ipsum",
        "status": "Pending",
        "updated_at": "2023-10-16 08:19 PM"
    }
}