Generated golang API for bol.com v3 using the swagger spec.
We do not hold copyright over the API specification and types.json is from bol.com.
Add github.com/tcorp-bv/bol-api-go v1.6.0
to go.mod.
import (
bolapi "github.com/tcorp-bv/bol-api-go"
)
// Setup the authentication
api, err := bolapi.New(&auth.EnvironmentProvider{ClientIdKey: "CLIENT_ID", ClientSecretKey: "CLIENT_SECRET"})
if err != nil {
//handle error
}
// Get the client (you should do this once)
client := api.GetClient()
// Use the API
res, err := client.Shipments.GetShipments(&shipments.GetShipmentsParams{Context:context.Background()})
if err != nil {
// handle error
}
for _, s := range res.Payload.Shipments {
println(s.ShipmentID)
}
Go-swagger was used for the client generation. Make sure it is accessible as swagger
.
swagger generate client -f types.json
In the current version we had to change get-process-status
to get-process-status-list
due to the duplicate.
Rate limits of the bol.com api are shared between all your clientIds and are extremely low. Because of this, we recommend having a single service that consumes your bol.com api and indexes all resources.
This library is opinionated in the way it handles rate limiting. Requests that fail due to rate limiting will be tried again a certain amount of time. Because of this, requests could take a very long time.
The default behavior is to retry 10 times.