Categorygithub.com/tcorp-bv/bol-api-go
modulepackage
1.7.0
Repository: https://github.com/tcorp-bv/bol-api-go.git
Documentation: pkg.go.dev

# README

Bol-api-go

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.

Using the API

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)
}

Regenerating the API

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.

Notes on rate limiting

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.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
Create a new API client with the host (default is "api.bol.com").
No description provided by the author

# Structs

Little bit of to connect to the demo environment.

# Interfaces

The core interface to retrieve the bol.com v3 client.