Skip to content

An API client for Sinch written in Go, but in my own repo

Notifications You must be signed in to change notification settings

gavinepp/go-sinch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-sinch

go-sinch is an API client for the Sinch APIs written in Go(Lang).

Quickstart

Download the package

go get github.com/thezmc/go-sinch

SMS

Send a message using the SMS client

package main

import (
	"fmt"

	"github.com/thezmc/go-sinch/pkg/api"
	"github.com/thezmc/go-sinch/pkg/sms"
)

func main() {
	apiClient := new(api.Client).WithAuthToken("YOUR_AUTH_TOKEN")
	smsClient := new(sms.Client).WithPlanID("YOUR_PLAN_ID").WithSinchAPI(apiClient)

	request := new(sms.BatchSendRequest).
		To("RECIPIENT_PHONE_NUMBER").
		From("SENDER_PHONE_NUMBER").
		WithMessageBody("YOUR_MESSAGE_BODY")

	response := new(sms.BatchSendResponse)
	if err := smsClient.Do(request, response); err != nil {
		panic(err)
	}

	fmt.Printf("Send Response: %+v", response)
}

About

An API client for Sinch written in Go, but in my own repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages