client.RetrieveConfig()
Retrieve
Returns a configuration by name. This request needs no user_token, so a browser integration can read its own configuration at runtime.
Endpoint
GET /keys/{key}/configs/{config}
See the API reference for this endpoint.
Signature
func (c *Client) RetrieveConfig(ctx context.Context, key string, config string) (*ConfigResponse, error)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | yes | Cancels the request and sets its deadline. |
key | string | yes | API Key |
config | string | yes | Configuration Name |
Query Parameters
None.
Response
*addresszen.ConfigResponse. Fields the API may leave out or send as null are pointers. RawJSON() returns the body as received. See responses.
Errors
An HTTP error returns *addresszen.APIError with the HTTP status, the API error code and the body; match it with errors.AsType. A transport failure returns the net/http error, wrapped. See error handling.
Example
retrieve-config/main.gogo
package main
import (
"context"
"fmt"
"log"
addresszen "go.addresszen.com/sdk"
)
func main() {
client := addresszen.NewClient("ak_test")
res, err := client.RetrieveConfig(context.Background(), "ak_test", "woocommerce")
if err != nil {
log.Fatal(err)
}
fmt.Println(res.Result.Payload)
}