← Back to Documentation

Documentation

AdGuard.ApiClient.Api.WebServicesApi

All URIs are relative to https://api.adguard-dns.io

Method HTTP request Description
ListWebServices GET /oapi/v1/web_services Lists web services

ListWebServices

List<WebService> ListWebServices ()

Lists web services

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using AdGuard.ApiClient.Api;
using AdGuard.ApiClient.Client;
using AdGuard.ApiClient.Model;

namespace Example
{
    public class ListWebServicesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.adguard-dns.io";
            // Configure API key authorization: ApiKey
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");
            // Configure Bearer token for authorization: AuthToken
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new WebServicesApi(httpClient, config, httpClientHandler);

            try
            {
                // Lists web services
                List<WebService> result = apiInstance.ListWebServices();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WebServicesApi.ListWebServices: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListWebServicesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Lists web services
    ApiResponse<List<WebService>> response = apiInstance.ListWebServicesWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WebServicesApi.ListWebServicesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

List<WebService>

Authorization

ApiKey, AuthToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 List of web-services -

[Back to top] [Back to API list] [Back to Model list] [Back to README]