Giter Club home page Giter Club logo

sms-net-bd-csharp-nuget's Introduction

sms.net.bd NuGet Package Release Note

Static Badge Static Badge

Summary:

The sms.net.bd NuGet package provides a simple interface to send SMS messages using the sms.net.bd API. This release introduces initial support for sending SMS messages, scheduling SMS messages, checking SMS delivery reports, and retrieving account balances.

Initialization:

To start using the sms.net.bd NuGet package, follow these steps:

  1. Install the Package: Install the sms.net.bd NuGet package in your project using the following command in the NuGet Package Manager Console:

    NuGet\Install-Package smsnetbd.Csharp.Client
  2. Initialize SMS Client: Create an instance of the SMS class by providing your API key. This API key can be obtained from the sms.net.bd API website.

    using sms.net.bd;
    
    // Initialize SMS client with your API key
    SMS smsClient = new SMS("Your-API-Key");

Usage:

After initializing the SMS client, you can use its methods to interact with the sms.net.bd API. Below are the available methods and their usage:

  1. SendSMS: Send a text message to a specified phone number.

    // Send SMS message
    string phoneNumber = "01800000000";
    string message = "Hello, world!";
    string sender_id = "xxxxxxx";  //Optional. If you have an approved Sender ID. 
    string response = await smsClient.SendSMS(phoneNumber, message, sender_id);

    Response

    {
      "error": 0,
      "msg": "Request successfully submitted",
      "data": {
        "request_id": 0000
      }
    }
  2. ScheduleSMS: Schedule a text message to be sent at a specified time.

    // Schedule SMS message
    string phoneNumber = "01800000000";
    string message = "Hello, world!";
    string scheduleTime = "2023-11-01 12:00:00"; // Specify the scheduled time in ISO 8601 format
    string response = await smsClient.ScheduleSMS(phoneNumber, message, scheduleTime);

    Response

    {
      "error": 0,
      "msg": "Request successfully submitted"
    }
  3. GetReport: Retrieve the delivery report of an SMS message.

    // Get SMS delivery report
    int messageId = 12345; // Specify the ID of the SMS message
    string report = await smsClient.GetReport(messageId);

    Response

    {
      "error":0,
      "msg":"Success",
      "data":{"request_id":000000,
    	 "request_status":"Complete",
    	 "request_charge":"0.0000",
    	 "recipients":[
    	  {
    		"number":"01800000000",
    		"charge":"0.0000",
    		"status":"Sent"
    	  }
    	]
      }
    }
  4. GetBalance: Retrieve the current account balance.

    // Get account balance
    string balance = await smsClient.GetBalance();

    Response

        {
          "error": 0,
          "msg": "Success",
          "data": {
            "balance": "00.0000"
          }
        }

Error Codes:

Common Errors
Error - 0 Success. Everything worked as expected.
Error - 400 The request was rejected, due to a missing or invalid parameter.
Error - 403 You don't have permissions to perform the request.
Error - 404 The requested resource not found.
Error - 405 Authorization required.
Error - 409 Unknown error occurred on Server end.
Send SMS Errors
Error - 410 Account expired.
Error - 411 Reseller Account expired or suspended.
Error - 412 Invalid Schedule.
Error - 413 Invalid Sender ID.
Error - 414 Message is empty.
Error - 415 Message is too long.
Error - 416 No valid number found.
Error - 417 Insufficient balance.
Error - 418 Content Blocked.

Feedback and Support

We welcome your feedback and suggestions for improving the sms.net.bd NuGet package. If you encounter any issues or have questions, please contact [Your Contact Information] or open an issue on the GitHub repository.

Thank you for using sms.net.bd!

For more details on the sms.net.bd API and its usage, refer to the official API documentation.

sms-net-bd-csharp-nuget's People

Contributors

sujadud avatar md-riaz avatar

Watchers

 avatar

Forkers

sujadud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.