client.ListConfigsAsync()
List
Returns every configuration stored against a key, oldest first.
Endpoint
GET /keys/{key}/configs
See the API reference for this endpoint.
This operation needs a Management Key. Pass it as the second argument to new IdealPostcodesClient(apiKey, managementKey), or set ManagementKey in the options; the client sends it in the Authorization header. See setup.
Signature
Task<ConfigsResponse> ListConfigsAsync(string key, CancellationToken cancellationToken = default)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
key | string | yes | API Key |
cancellationToken | CancellationToken | no | Cancels the request. |
Query Parameters
None.
Response
ConfigsResponse. 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
using IdealPostcodes;
using var client = new IdealPostcodesClient("ak_test", "uk_test");
var response = await client.ListConfigsAsync("ak_test");
foreach (var config in response.Result.Configs)
{
Console.WriteLine($"{config.Name} updated {config.UpdatedAt}");
}