Skip to main content

client.RetrieveConfigAsync()

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​

Task<ConfigResponse> RetrieveConfigAsync(string key, string config, CancellationToken cancellationToken = default)

Arguments​

NameTypeRequiredDescription
keystringyesAPI Key
configstringyesConfiguration Name
cancellationTokenCancellationTokennoCancels the request.

Query Parameters​

None.

Response​

ConfigResponse. Fields are properties in PascalCase, such as response.Result; fields this SDK version does not know are kept in AdditionalProperties. See responses.

Errors​

An HTTP error throws ApiException with the StatusCode, the API error Code and the raw Body. A success response whose body cannot be read throws UnserializableResponseException. Network failures and cancellation throw HttpClient's own HttpRequestException and OperationCanceledException. See error handling.

Example​

retrieve-config.cscsharp
using IdealPostcodes;

using var client = new IdealPostcodesClient("ak_test");

var response = await client.RetrieveConfigAsync("ak_test", "woocommerce");

Console.WriteLine(response.Result.Payload);