Go library for accessing the Firmafon API.
go get github.com/steffen25/go-firmafon
import "github.com/steffen25/go-firmafon"
Construct a new Firmafon client using an access token which you can generate here Generate Token
client := firmafon.NewClient("token")
client := firmafon.NewClient("token")
// list all employees for your organization
users, _, err := client.Employees.All()
if err != nil {
// Handle error
}
// print each employee's name
for _, u := range users {
fmt.Println(u.Name)
}
Get a list of calls to or from one or more numbers.
client := firmafon.NewClient("token")
// List all calls to and from all numbers
calls, _, err := client.Calls.GetAll()
if err != nil {
// Handle error
}
// print each call's UUID
for _, c := range calls {
fmt.Println(c.CallUUID)
}
client := firmafon.NewClient("token")
// List all calls to and from all numbers
call, _, err := client.Calls.Get("UUID_HERE")
if err != nil {
// Handle error
}
// print call UUID
fmt.Println(call.CallUUID)