Skip to content

smsapi/smsapi-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smsapi-go

Build Status codecov

A GO client for accessing smsapi.pl / smsapi.com API.

Usage

import "github.com/smsapi/smsapi-go/smsapi"

Create new Smsapi client for smsapi.com customers:

client = smsapi.NewInternationalClient(accessToken, nil)

Create new Smsapi client for smsapi.pl customers:

client = smsapi.NewPlClient(accessToken, nil)	

Send Sms

result, err := client.Sms.Send(context.Background(), "+48500500500", "go", "")

Iterate over results

pageIterator := client.Contacts.GetContactsPageIterator(ctx, nil)

for {
    page, err := pageIterator.Next()

    if err != nil {
        break
    }

    for _, c := range page.Collection {
        fmt.Println(c.PhoneNumber)
    }
}

Integration Tests

Additional integration tests can be executed by following command:

SMSAPI_ACCESS_TOKEN= PHONE_NUMBER= make tests-e2e

Contributing

Contributions are of course always welcome.

License

This library is distributed under the Apache 2.0 license found in the LICENSE file.

About

SMSAPI Go client that allows you to send messages and administrate your SMSAPI account.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors