github.com/schmorrison/Zoho@v1.1.4/expense/README.md (about)

     1  [![](https://godoc.org/github.com/schmorrison/Zoho/expense?status.svg)](http://godoc.org/github.com/schmorrison/Zoho/expense)
     2  # Zoho EXPENSE V1 API
     3  
     4  NOTE: Not finished and probably unstable. PRs welcome.
     5  
     6  This API wrapper should provide access to Zoho EXPENSE. Because some fields exist only in add-ons for EXPENSE, or are custom fields, which cannot be easily differentiated, all fields that are recieved in a record which have no direct corresponding field in the defined struct will be available in a `map[string]interface{}` field. This may extend to all fields being accessible in a field called "RAW" or some-such, which can then be manually type-asserted against.
     7  
     8  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.
     9   fields they need.
    10  
    11  ## Usage
    12      import (
    13          "log"
    14          "fmt"
    15          "github.com/schmorrison/Zoho"
    16      )
    17  
    18      func main() {
    19          // get access/refresh tokens
    20          z := zoho.New()
    21          scopes := []zoho.ScopeString{
    22              zoho.BuildScope(zoho.Expense, zoho.FullAccessScope, zoho.AllMethod, zoho.NoOp),
    23          }
    24          if err := z.AuthorizationCodeRequest("yourClientID", "yourClientSecret", scopes, "http://localhost:8080/oauthredirect"); err != nil {
    25              log.Fatal(err)
    26          }
    27  
    28          // Create a new Expense object and provide the Zoho struct
    29          c := expense.New(z)
    30  
    31          // While untested, getting data should work like so
    32          data := expense.ExpenseReportResponse{}
    33          _, err := c.GetExpenseReports(&data, "yourorganizationid", nil)
    34          if err != nil {
    35              log.Fatal(err)
    36          }
    37          fmt.Println(data)
    38      }
    39  
    40  ## TODO
    41  
    42  - [ ] Write a TODO list
    43  - [ ] Comment code with full details
    44  - [ ] Add page context values to returned data, or methods to interact with it via module
    45  - [ ] Create godoc for expense APIs
    46  - [ ] Identify Expense APIs which are used most
    47