The alicloudapislim
Go package provides tools to interact with the logistics tracking APIs
provided by Alicloud. It allows you to fetch information about logistics providers and track
logistics status by number.
- List all available logistics providers.
- Get logistics providers by a tracking number.
- Get detailed logistics status by provider code and tracking number.
First, initialize a new WuliuClient
with your AppCode
.
client := alicloudapislim.NewWuliuClient("your_app_code_here")
Fetch a list of all logistics providers:
providers, err := client.GetProviders(context.Background())
if err != nil {
// Handle error
}
Or, to get providers for a specific tracking number:
providers, err := client.GetProvidersForNumber(context.Background(), "tracking_number_here")
if err != nil {
// Handle error
}
To fetch logistics status:
status, err := client.GetStatusForNumber(context.Background(), "provider_code_here", "tracking_number_here")
if err != nil {
// Handle error
}
The status
will contain detailed information such as updates, timestamps, and contact information.