Skip to content

Reset

Resets the current counter value to zero.

Method:

PUT

Endpoint URL

The xxxx.backendless.app is a subdomain assigned to your application. For more information see the Client-side Setup section of this documentation.

https://xxxx.backendless.app/api/counters/<counterName>/reset

where:

Argument                Description
<counterName> Name of the counter to reset to zero.

Request headers

user-token: optional value obtained as a result of the login operation.

where:

Argument                Description
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the currently logged in user will be assigned to the ownerId property of the user object which is being saved.  Additionally, the operation will be executed with the security policy associated currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless.

Request body

N/A

Response body

N/A

Example

Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.

curl -X PUT \  
https://xxxx.backendless.app/api/counters/mycounter/reset

Codeless Reference

codeless_atomic_counters_reset_counter_to_zero_1

where:

Argument                Description
counter name Name of the counter whose value must be set to 0.

This operation does not return a value.

Consider the following counter:

codeless_atomic_counters_set_counter_if_2

The example below resets the value of the "CarsParkingLot" counter 0.

codeless_atomic_counters_reset_counter_to_zero_3

The result of this operation will look as shown below after the Codeless logic runs:

codeless_atomic_counters_increment_1_return_previous_2