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

Latest commit

 

History

History
55 lines (50 loc) · 1.73 KB

File metadata and controls

55 lines (50 loc) · 1.73 KB

Groups API

Create

Example how to create a new group that will be stored in your Ez Texting account

    EzTextingClient client = new EzTextingClient("login", "password");
    var group = new Group
    {
        Name = "Friends",
        Note = "my friends numbers"
    };
    Group stored = client.GroupsApi.Create(group);
    Console.WriteLine(stored);

Update

Example how to update a group stored in your Ez Texting account

    EzTextingClient client = new EzTextingClient("login", "password");
    var group = new Group
    {
        Id = 202020,
        Note = "my family numbers"
    };
    Group updated = client.GroupsApi.Update(group);
    Console.WriteLine(updated);

Get one group

Get a single group stored in your Ez Texting account.

    EzTextingClient client = new EzTextingClient("login", "password");
    Group group = client.GroupsApi.Get(343434);
    Console.WriteLine(group);

Get multiple groups

Get a list of groups stored in your Ez Texting account.

    EzTextingClient client = new EzTextingClient("login", "password");
    var request = new GetGroupsRequest
    {
        SortBy = SortProperty.Name,
        // sort asc/desc
        SortType = SortType.Desc,
        // number of results to retrieve. By default, first 10 groups sorted in alphabetical order are retrieved.
        ItemsPerPage = 10,
        // page of results to retrieve
        Page = 7
    };
    List<Group> groups = client.GroupsApi.Get(request);
    Console.WriteLine("multiple groups: " + groups);

Delete

Delete a group that is stored in your Ez Texting account

    EzTextingClient client = new EzTextingClient("login", "password");
    client.GroupsApi.Delete(354421);