go-cw/README.md

33 lines
995 B
Markdown
Raw Normal View History

2018-06-20 14:39:46 +00:00
# go-cw
2018-06-20 15:16:40 +00:00
Go structs and methods for the ConnectWise REST API
2018-06-20 23:56:50 +00:00
Note: This is far from complete, I'm simply adding structs and methods as I have an actual requirement for them. If you add to this, please feel free to send a pull request.
#Installation
```
2018-07-02 22:17:26 +00:00
go get deadbeef.codes/steven/go-cw
2018-06-20 23:56:50 +00:00
```
#Usage
```
package main
import (
2018-07-02 22:17:26 +00:00
"deadbeef.codes/steven/go-cw/3.0/connectwise"
2018-06-20 23:56:50 +00:00
"fmt"
)
const (
cwSite = "https://yourconnectwisesite.com/v4_6_release/apis/3.0"
cwAPIKeyPrivate = "ASDLFK4ah89ad" //Put in either your private API key or account password if using user impersonation
cwAPIKey = "ASLDFKJ2342kl" //Put in either your public API key or account username if using user impersonation
cwCompany = "yourcompanyname" //The connectwise company name
2018-06-20 23:56:50 +00:00
)
func main() {
cw := connectwise.NewSite(cwSite, cwAPIKey, cwAPIKeyPrivate, cwCompany)
companyDataByID := cw.GetCompanyByID(2) //Retrieves company ID 2 from CW and returns type pointer a Company
fmt.Println(*companyDataByID.Name)
2018-06-20 23:56:50 +00:00
}
```