From 3d987bb0891c9aaab4e1f18ae57966845f642202 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sun, 22 Jul 2018 02:15:24 -0600 Subject: [PATCH] Update example --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1fd2cfb..9490417 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # go-itg -IT Glue API Structs + Receivers for the Go +IT Glue API Structs + Methods for the Go This is nowhere near complete, and at least for now, I will only be adding support the functionality required for use within my organization. Feel free to send a pull request if you'd like to contribute anything that's missing. @@ -14,14 +14,21 @@ package main import ( "fmt" + "log" "deadbeef.codes/steven/go-itg/itglue" ) func main() { - itgAPI := itglue.NewITGAPI("ITG.XXXXXXXXXXXXX555555YOURAPIDKEYHERE2222222222222222XXXXXX") - fmt.Println((*itgAPI).GetOrganizationByID(1234242).Data.Attributes.Name) //Returns the name of the Organization with ID 1234242 - fmt.Println((*itgAPI).GetOrganizationByName("test Org Inc.").Data[0].Attributes.Description) //Returns the description of the Organization with Name "Test Org Inc." + fmt.Println("Example IT Glue Application") + itg := itglue.NewITGAPI("ITG.XXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXX") + + nd, err := itg.GetOrganizationByName("Next Digital Inc.") //Returns an organization list + if err != nil { + log.Fatalf("could not get nd: %s", err) + } + log.Printf("%s - %s\n", nd.Data[0].ID, nd.Data[0].Attributes.Name) } + ``` \ No newline at end of file