Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #67 from panxl6/master
Browse files Browse the repository at this point in the history
fix: upgrade auth header key
  • Loading branch information
panxl6 authored Dec 21, 2023
2 parents 11a1046 + f7a6781 commit 7b82171
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ make test
```

## Table of contents

- [NewClient(config)](#newaftershipconfig)
- [Rate Limiter](#rate-limiter)
- [Error Handling](#error-handling)
Expand All @@ -88,9 +87,7 @@ Create AfterShip SDK instance with config
- `APIKey` - **Required**, AfterShip API key
- `AuthenticationType` - `APIKey` / `AES`
- `APISecret` - if AuthenticationType is AES, use aes api secret
- `Endpoint` - *string*, AfterShip endpoint, default "https://api.aftership.com/tracking/2023-10

"
- `Endpoint` - *string*, AfterShip endpoint, default 'https://api.aftership.com/tracking/2023-10'
- `UserAagentPrefix` - *string*, prefix of User-Agent in headers, default "aftership-sdk-go"

Example:
Expand All @@ -105,9 +102,9 @@ client, err := aftership.NewClient(aftership.Config{
AuthenticationType `AES` signature
```go
client, err := aftership.NewClient(aftership.Config{
APIKey: "YOUR_API_KEY",
AuthenticationType: aftership.AES,
APISecret: "YOUR_API_SECRET",
APIKey: "YOUR_API_KEY",
AuthenticationType: aftership.AES,
APISecret: "YOUR_API_SECRET",
})
```

Expand Down Expand Up @@ -347,11 +344,11 @@ fmt.Println(result)
> Create a tracking.
```go
newTracking := aftership.NewTracking{
newTracking := aftership.CreateTrackingParams{
TrackingNumber: "1234567890",
Slug: []string{"dhl"},
Slug: "dhl",
Title: "Title Name",
Smses: []string{
SMSes: []string{
"+18555072509",
"+18555072501",
},
Expand Down
2 changes: 1 addition & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (client *Client) makeRequest(ctx context.Context, method string, path strin
req.Header.Add("date", date)
req.Header.Add(signatureHeader, signature)
} else {
req.Header.Add("aftership-api-key", apiKey)
req.Header.Add("as-api-key", apiKey)
}

// Send request
Expand Down

0 comments on commit 7b82171

Please sign in to comment.