Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Latest commit

 

History

History
62 lines (57 loc) · 2.45 KB

File metadata and controls

62 lines (57 loc) · 2.45 KB

Keywords API

Check Keyword Availability

Check whether a Keyword is available to rent on Ez Texting’s short code. Please note, we will check availability for the country your account is set to.

    EzTextingClient client = new EzTextingClient("api_login", "api_password");
    Console.WriteLine("Is available: " +  client.KeywordsApi.CheckAvailability("SUSHI"));

Rent a keyword

Rents a Keyword for use on Ez Texting’s short code in the country your account is set to send messages to. You may rent a Keyword using a credit card you have stored in your Ez Texting account, or you may pass credit card details when you call the API. Example how to rent a keyword with stored credit card:

    EzTextingClient client = new EzTextingClient("login", "password");
    Keyword keyword = client.KeywordsApi.Rent("GLASSES", "1111");
    Console.WriteLine("rent keyword: " + keyword);

another option you can provide credit card details in request:

    EzTextingClient client = new EzTextingClient("login", "password");
    var cc = new CreditCard
    {
        FirstName = "John",
        LastName = "Doe",
        State = "LA",
        SecurityCode = "123",
        ExpirationMonth = "11",
        ExpirationYear = "2020",
        Number = "4111111111111111",
        City = "LA",
        Country = "US",
        Street = "1 Avenue",
        Zip = "31331",
        Type = CreditCardType.MasterCard
    };
    Keyword keyword = client.KeywordsApi.Rent("GLASSES", cc);
    Console.WriteLine("rent keyword: " + keyword);

Setup a keyword (update)

Configures an active Keyword for use on Ez Texting’s short code in the country your account is set to send messages to. This operation is the same as update

    EzTextingClient client = new EzTextingClient("login", "password");
    var keyword = new Keyword
    {
        Value = "SUSHI"
        ConfirmMessage = new SimpleMessage
        {
            DeliveryMethod = DeliveryMethod.Express,
            Subject = "subject",
            Message = "You already joined but thanks for texting in again."
        };
    };
    Keyword updated = client.KeywordsApi.Setup(keyword);
    Console.WriteLine("Updated keyword: " + updated);

Cancel a keyword

Cancels an active Keyword on Ez Texting’s short code in the country your account is set to send messages to.

    EzTextingClient client = new EzTextingClient("login", "password");
    client.KeywordsApi.Cancel("GLASSES");