# `client.retrieve_config`

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](/docs/api/retrieve-config.md) for this endpoint.

## Signature

```ruby
def retrieve_config(key, config)
```

## Arguments

| Name     | Type     | Required | Description        |
| -------- | -------- | -------- | ------------------ |
| `key`    | `String` | yes      | API Key            |
| `config` | `String` | yes      | Configuration Name |

## Query Parameters

*None.*

## Response

`IdealPostcodes::Responses::ConfigResponse`. Read fields with readers named as the API names them, such as `response.result`, or with `response["result"]`. `to_h` returns the decoded body.

## Errors

An HTTP error raises `IdealPostcodes::ApiError` with the HTTP `status`, the API error `code` and the decoded `body`. A transport failure raises `IdealPostcodes::TransportError`. See [error handling](/docs/sdks/ruby/errors.md).

## Example

retrieve-config.rbruby

```ruby
require "ideal_postcodes"

client = IdealPostcodes::Client.new(api_key: "ak_test")

response = client.retrieve_config("ak_test", "woocommerce")

puts response.result.payload
```
