github.com/schmorrison/Zoho@v1.1.4/bookings/README.md (about) 1 # Zoho BOOKINGS V1 API 2 3 NOTE: Not finished and probably unstable. PRs welcome. 4 5 This API wrapper should provide access to Zoho BOOKINGS. For the GET api's which use query parameters, these should be passed as the type `map[string]zoho.Parameter`. For the POST API's which require RequestBody, the key value pairs should be passed on as variables of type `map[string]string`. 6 7 Note: These APIs result entire API response in JSON format. It is expected that client application will parse the API response to get the desired fields. 8 fields they need. 9 10 ## Usage 11 import ( 12 "log" 13 "fmt" 14 "github.com/schmorrison/Zoho" 15 ) 16 17 func main() { 18 // get access/refresh tokens 19 z := zoho.New() 20 scopes := []zoho.ScopeString{ 21 zoho.BuildScope(zoho.Bookings, zoho.DataScope, "", zoho.Create), 22 } 23 if err := z.AuthorizationCodeRequest("yourClientID", "yourClientSecret", scopes, "http://localhost:8080/oauthredirect"); err != nil { 24 log.Fatal(err) 25 } 26 27 // Create a new Bookings object and provide the Zoho struct 28 c := bookings.New(z) 29 30 // While untested, getting data should work like so 31 data := bookings.ServiceResponse{} 32 param := make(map[string]zoho.Parameter) 33 param["workspace_id"] = "yourWorkspaceID" 34 resp, err := c.FetchServices(&data,param) 35 if err != nil { 36 log.Fatal(err) 37 } 38 fmt.Println(resp) 39 } 40 41 ## TODO 42 43 - [ ] Write a TODO list 44 - [ ] Comment code with full details 45 - [ ] Add page context values to returned data, or methods to interact with it via module 46 - [ ] Create godoc for bookings APIs 47 - [ ] Identify Bookings APIs which are used most