From 55443ad4ef9a31e282037b39e7631de3c9650458 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Mon, 13 Aug 2018 22:58:21 -0600 Subject: [PATCH] Set Site.CompanyName even if not doing user impersonation --- 3.0/connectwise/connectwise.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/3.0/connectwise/connectwise.go b/3.0/connectwise/connectwise.go index 8abb126..65139cc 100644 --- a/3.0/connectwise/connectwise.go +++ b/3.0/connectwise/connectwise.go @@ -13,9 +13,10 @@ import ( type Site struct { Site string AuthAPIKey string //Preferable authentication method + CompanyName string //Used for user impersonation, but collected for API key as well so it can be accessed publicly later on if required AuthUsername string // User for user impersonation AuthMemberHash string //Used for user impersonation - CompanyName string //Used for user impersonation + } //Count is a struct used for unmarshalling JSON data when using the Count endpoints in Connectwise (eg: counting number of companies) @@ -30,7 +31,7 @@ func NewSite(site string, publicKey string, privateKey string, company string) * authString = base64.StdEncoding.EncodeToString([]byte(authString)) authString = fmt.Sprintf("Basic %s", authString) - cwSite := Site{Site: site, AuthAPIKey: authString} + cwSite := Site{Site: site, AuthAPIKey: authString, CompanyName: company} return &cwSite }