Skip to content

ghasedakapi/ghasedakapi-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghasedak csharp

ghasedak C#/.NET Helper Library

Adding Ghasedakapi libraries to your .NET project

The best and easiest way to add the Ghasedak libraries to your .NET project is to use the NuGet package manager.

Package Manager

Install-Package Ghasedak

.NET CLI

dotnet add package Ghasedak

Simple Send

      try
            {
                var sms = new Ghasedak.Api("apikey");
                var result = await sms.SendSMS("message", "0912xxxxxxx");
                foreach (var item in result.Items)
                {
                    Console.WriteLine(item);
                }
            }
            catch (Ghasedak.Exceptions.ApiException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Ghasedak.Exceptions.ConnectionException ex)
            {
                Console.WriteLine(ex.Message);
            }

Bulk Send

       try
         {
             var bulksms = new Ghasedak.Api("apikey");
             var res = bulksms.SendSMS("message", "linenumber", new string[] { "0912xxxxxxx","0937xxxxxxxx" });
             foreach(var item in res.Items)
             {
                 Console.WriteLine("messageids:" + item);
             }
         }
         catch (Ghasedak.Exceptions.ApiException ex)
         {
             Console.WriteLine(ex.Message);
         }
         catch (Ghasedak.Exceptions.ConnectionException ex)
         {
             Console.WriteLine(ex.Message);
         }

Verify

     try
            {
                var sms = new Ghasedak.Api("apikey");
                var result = sms.Verify(1, "template", new string[] { "0912xxxxxxx", "0937xxxxxxxx" }, "test", "test2");
                foreach (var item in result.Items)
                {
                    Console.WriteLine(item);
                }
            }
            catch (Ghasedak.Exceptions.ApiException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Ghasedak.Exceptions.ConnectionException ex)
            {
                Console.WriteLine(ex.Message);
            }

Releases

No releases published

Packages

No packages published

Languages