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
GET /add/{counter_id}
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
GET /inc/{counter_id}
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
GET /get/{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
GET /reset/{counter_id}
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
GET /getall
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
GET /delall
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:
Enjoy using the Counters API by inUtil Labs for all your counting and tracking needs!