From 8adc3a69a1c9b968eb713750d4e2e96761e4c87d Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Wed, 20 Jun 2018 17:56:50 -0600 Subject: [PATCH] Updated README.md --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c57a0b..0f5f551 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,32 @@ # go-cw Go structs and methods for the ConnectWise REST API -Note: This is far from complete, I'm simply adding structs and methods as I see a use for it. +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 +``` +go get github.com/StevenPolley/go-cw +``` + +#Usage +``` +package main + +import ( + "github.com/StevenPolley/go-cw/3.0/connectwise" + "fmt" +) + +const ( + cwSite = "https://yourconnectwisesite.com/v4_6_release/apis/3.0" + cwAPIKeyPrivate = "ASDLFK4ah89ad" + cwAPIKey = "ASLDFKJ2342kl" + cwCompany = "yourcompanyname" +) + +func main() { + cw := connectwise.NewSite(cwSite, cwAPIKey, cwAPIKeyPrivate, cwCompany) + companyDataByID := connectwise.GetCompaniesByID(cw, 2) //Retrieves company ID 2 from CW and returns pointer to struct struct + fmt.Println(*companyDataByID) +} +```