Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 1.81 KB

README.md

File metadata and controls

102 lines (75 loc) · 1.81 KB

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 = "[email protected]",
        EmailMessage = message,
        EmailId = new EmailIdResource
        {
            Id = "<insert-email-id>"
        }
    };

    await email.Create();