This package contains a generated API client based on the 24SevenOffice's SOAP API and payroll Swagger API.
AccountService
AttachmentService
AuthService
ClientService
CompanyService
InvoiceService
Payroll
PersonService
ProductService
ProjectService
TransactionService
go get github.com/valuetechdev/api-client-24so
Go example
import (
"github.com/valuetechdev/api-client-24so/so24"
"github.com/valuetechdev/api-client-24so/so24/account24"
)
func func() {
so24Client, err := so24.NewAuthenticatedClient()
if err != nil {
return nil, err
}
so24RatesResult, err := so24Client.Account.GetTaxCodeList(&account24.GetTaxCodeList{})
if err != nil {
return nil, err
}
// Use the data
}
To use the API, you need to log in with username
, password
and
applicationId
. These are read from as environment variables.
The names are:
TWENTYFOURSEVEN_API_APPLICATIONID
TWENTYFOURSEVEN_API_USERNAME
TWENTYFOURSEVEN_API_PASSWORD
The program will panic in any are missing.
Usage is described in 24SevenOffice's API documentation
By default the client uses your accounts default identity (the one you log in to automatically in the UI).
id := auth24.Guid("new-identity")
_, err = so24Client.Auth.SetIdentityById(&auth24.SetIdentityById{IdentityId: &id})
if err != nil {
return nil, err
}
- Add or replace the
.wsdl
-file in./wsdl/so24
-directory, follow the same naming-convention as 24SevenOffice. - Add the new service in
clientsToGenerate
ingenerate24.go
. - Add the new service in
Client
struct inclient.go
. - Run
make generate
. - Open a new PR.
- Only the payroll-API is using OpenAPI/Swagger.
- It's originally based on Swagger 2.0, but it was converted to OpenAPI 3
using
npx swagger2openapi -o <openapi>.json <swagger2>.json
- It has been altered to with defined schemas/models that was missing.
- It's originally based on Swagger 2.0, but it was converted to OpenAPI 3
using