Delete Logger API Key

Delete an API key from a logger.

Authentication

Requires management credentials:

  • Api-Key — Your API key
  • Api-Secret — Your API secret

Path Parameters

Parameter Description
id The unique identifier of the logger
key The ID of the API key to delete

Request

curl -X DELETE "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456" \
  -H "Api-Key: LOGGER_API_KEY" \
  -H "Api-Secret: LOGGER_API_SECRET"
DELETE /v1/loggers/logger_xyz789/apiKeys/ak_123456 HTTP/1.1
Host: api.hola.cloud
Api-Key: LOGGER_API_KEY
Api-Secret: LOGGER_API_SECRET
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("DELETE", "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Api-Key", "LOGGER_API_KEY")
	req.Header.Set("Api-Secret", "LOGGER_API_SECRET")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	responseBody, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(responseBody))
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Api-Key: LOGGER_API_KEY',
        'Api-Secret: LOGGER_API_SECRET',
    ],
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new Exception(curl_error($ch));
}
curl_close($ch);

echo $response;
import requests

headers = {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET",
}

response = requests.request(
    "DELETE",
    "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456",
    headers=headers
)

print(response.text)
const response = await fetch("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", {
  method: "DELETE",
  headers: {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET"
  }
});

console.log(await response.text());
const response = await fetch("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", {
  method: "DELETE",
  headers: {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET"
  }
});

const text = await response.text();
console.log(text);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456"))
            .method("DELETE", HttpRequest.BodyPublishers.noBody())
            .header("Api-Key", "LOGGER_API_KEY")
            .header("Api-Secret", "LOGGER_API_SECRET")
            .build();

        var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
curl -X DELETE "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456" \
  -H "Api-Key: LOGGER_API_KEY" \
  -H "Api-Secret: LOGGER_API_SECRET"
DELETE /v1/loggers/logger_xyz789/apiKeys/ak_123456 HTTP/1.1
Host: api.hola.cloud
Api-Key: LOGGER_API_KEY
Api-Secret: LOGGER_API_SECRET
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("DELETE", "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Api-Key", "LOGGER_API_KEY")
	req.Header.Set("Api-Secret", "LOGGER_API_SECRET")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	responseBody, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(responseBody))
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Api-Key: LOGGER_API_KEY',
        'Api-Secret: LOGGER_API_SECRET',
    ],
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new Exception(curl_error($ch));
}
curl_close($ch);

echo $response;
import requests

headers = {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET",
}

response = requests.request(
    "DELETE",
    "https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456",
    headers=headers
)

print(response.text)
const response = await fetch("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", {
  method: "DELETE",
  headers: {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET"
  }
});

console.log(await response.text());
const response = await fetch("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456", {
  method: "DELETE",
  headers: {
    "Api-Key": "LOGGER_API_KEY",
    "Api-Secret": "LOGGER_API_SECRET"
  }
});

const text = await response.text();
console.log(text);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.hola.cloud/v1/loggers/logger_xyz789/apiKeys/ak_123456"))
            .method("DELETE", HttpRequest.BodyPublishers.noBody())
            .header("Api-Key", "LOGGER_API_KEY")
            .header("Api-Secret", "LOGGER_API_SECRET")
            .build();

        var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

Response

HTTP 204 No Content.

Error Codes

Code Description
401 Missing or invalid API credentials
403 API credentials do not have access to this logger
404 Logger or API key not found

Comments

Leave a comment