Skip to content

omnigage/omnigage-sdk-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omnigage .NET SDK .NET Core

Authorization

API Token

    OmnigageClient.Init("token-key", "token-secret");

JWT Token

    OmnigageClient.Init("token");

Samples

  1. Call a Single Number
    OmnigageClient.Init("token-key", "token-secret");

    var call = new CallResource
    {
        To = "+11115551111"
    };

    await call.Create();
  1. Call Two Numbers and Connect
    OmnigageClient.Init("token-key", "token-secret");

    var call = new CallResource
    {
        From = "+11115550000",
        To = "+11115551111",
        CallerId = new CallerIdResource
        {
            Id = "<insert-caller-id>"
        }
    };

    await call.Create();
  1. Send a Text Message
    OmnigageClient.Init("token-key", "token-secret");

    var message = new TextMessageResource
    {
        Body = "Sample body"
    };

    await message.Create();

    var text = new TextResource
    {
        To = "+11115551111",
        TextMessage = message,
        PhoneNumber = new PhoneNumberResource
        {
            Id = "<insert-phone-number-id>"
        }
    };

    await text.Create();
  1. Send an Email
    OmnigageClient.Init("token-key", "token-secret");

    var message = new EmailMessageResource
    {
        Subject = "Hello",
        Body = "Sample body"
    };

    await message.Create();

    var email = new EmailResource
    {
        To = "demo@omnigage.com",
        EmailMessage = message,
        EmailId = new EmailIdResource
        {
            Id = "<insert-email-id>"
        }
    };

    await email.Create();