A Aircall API Golang Wrapper for the Aircall API
$ go get github.com/dinistavares/go-aircall-api
Import the Aircall package.
import "github.com/dinistavares/go-aircall-api"
Create a new Aircall Client and use the provided services.
client := aircall.New()
// List Aircall calls
calls, _, err := client.Call.List(nil)
Authenticate with access token for OAuth app
import (
"github.com/dinistavares/go-aircall-api"
)
func main(){
accessToken := "xxxxxxx"
client := aircall.New()
client.Authenticate(accessToken)
// List Aircall calls
calls, _, err := client.Call.List(nil)
}
Authenticate with api_key and api_token for Aircall customers
import (
"github.com/dinistavares/go-aircall-api"
)
func main(){
apiKey := "xxxxxxx"
apiToken := "xxxxxxx"
client := aircall.New()
client.AuthenticateBasic(apiKey, apiToken)
// List Aircall calls
calls, _, err := client.Call.List(nil)
}
List calls
// Create query filter and set 'from' and 'to'
opts := client.Call.Query().NewListCalls()
opts.From("1728722536")
opts.To("1728922536")
response, _, err := client.Call.List(opts)
Get call by ID
id := 23456
response, _, err := client.Call.GetByID(id)
Search calls
opts := client.Call.Query().NewSearchCalls()
opts.From("1728722536")
opts.To("1728922536")
opts.Direction("inbound")
response, _, err := client.Call.Search(opts)