An extremely simple Facebook Workplace client for sending transmissions to threads via Go.
go get -u github.com/ainsleyclark/workplace
See below for a quick start to create a new Workplace client and sending off a transmission. For more details please see Go Doc which includes information on all types.
func Example() error {
// Create as new Workplace client.
wp, err := workplace.New(workplace.Config{Token: "my-token"})
if err != nil {
return err
}
// Create a new Workplace Transmission that contains
// the thread ID and message to be sent to the thread.
tx := workplace.Transmission{
Thread: "thread-id",
Message: "message",
}
// Send the transmission to the workplace API.
err = wp.Notify(tx)
if err != nil {
return err
}
return nil
}
- Add all workplace graph endpoints from Facebook Endpoints
Please feel free to make a pull request if you think something should be added to this package!
Shout out to the incredible Maria Letta for her excellent Gopher illustrations.
Code Copyright 2022 Ainsley Clark. Code released under the MIT Licence.