Counters

FREEMIUM
(Ким) inUtil Labs | Оновлено il y a 2 mois | Tools
Популярність

0.1 / 10

Затримки

687ms

Рівень обслуговування

100%

Health Check

100%

Назад до всіх навчальних посібників (1)

Basic operations.

Counters API Usage Manual

Counters API, a versatile tool for counting and tracking various activities. This document will guide you through using the API effectively with detailed explanations for each endpoint.

Endpoint 1: Create Counter

  • Endpoint: GET /add/{counter_id}
  • Description: Create a new counter with a unique identifier. Each counter starts at zero by default.

Usage:
To create a new counter, simply make a GET request to /add/{counter_id}, where {counter_id} is a unique identifier for your counter. Upon successful execution, a new counter will be created, starting at zero.

Example Request:

GET /add/my_counter

Endpoint 2: Increment Counter

  • Endpoint: GET /inc/{counter_id}
  • Description: Increment the value of a specific counter identified by {counter_id} by 1.

Usage:
To increment the value of a counter, make a GET request to /inc/{counter_id}, where {counter_id} is the identifier of the counter you want to increment. Each request to this endpoint increases the counter’s value by 1.

Example Request:

GET /inc/my_counter

Endpoint 3: Get Counter

  • Endpoint: GET /get/{counter_id}
  • Description: Retrieve the current value of a specific counter identified by {counter_id}.

Usage:
To retrieve the current value of a counter, make a GET request to /get/{counter_id}, where {counter_id} is the identifier of the counter. This will return the current value of the specified counter.

Example Request:

GET /get/my_counter

Endpoint 4: Clear Counter

  • Endpoint: GET /reset/{counter_id}
  • Description: Clear a specific counter identified by {counter_id}, resetting its value to zero.

Usage:
To reset a specific counter to zero, make a GET request to /reset/{counter_id}, where {counter_id} is the identifier of the counter you want to clear. This action will set the counter’s value back to zero.

Example Request:

GET /reset/my_counter

Endpoint 5: List All Counters and Their Values

  • Endpoint: GET /getall
  • Description: Get a list of all counters and their current values, providing an overview of the entire counter collection.

Usage:
To retrieve a list of all counters and their current values, make a GET request to /getall. This will provide an overview of all the counters in the collection, including their respective current values.

Example Request:

GET /getall

Endpoint 6: Clear All Counters

  • Endpoint: GET /delall
  • Description: Delete all counters, effectively clearing the entire collection of counters. This action is irreversible and removes all stored data.

Usage:
To clear all counters and remove all stored data, make a GET request to /delall. Please note that this action is irreversible and will permanently delete all counters in the collection.

Example Request:

GET /delall

Usage Tips:

  • Ensure that you use unique identifiers for each counter to avoid conflicts.
  • Regularly check and back up your counter data to prevent accidental data loss when clearing all counters.
  • Keep track of the counters and their values using the “List All Counters and Their Values” endpoint.

Enjoy using the Counters API by inUtil Labs for all your counting and tracking needs!