Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 846 Bytes

File metadata and controls

42 lines (33 loc) · 846 Bytes

wavecell

Go Reference Go Report Card

Wavecell API client library in Go.

How to Use

package main

import (
	"context"
	"log"
	"net/http"
	"time"
)

func main() {
	c, err := New(
		WithAPIKey("YOUR_API_KEY"),
		WithTimeout(1*time.Minute),
		WithSubAccountID("SUB_ACCOUNT_ID"),
		WithClient(http.DefaultClient),
	)
	if err != nil {
		log.Fatal(err)
	}

	resp, err := c.SendSMSV1(context.Background(), &RequestSendSMS{
		Destination: "+62101010101",
		Text:        "Hello!",
	})
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("Response: %+v", resp)
}