1. Rest API Extended
  2. Points Extended Controller

Points Extended Controller

Any endpoint of this controller requires an administrator logged in on rest API.
Check authentication chapter from WordPress rest API handbook for more information.

Get points

Retrieve the given user points balance.

Arguments

user

User to retrieve points balance. Accepts the user username, email or ID.

user_id

User to retrieve points balance (deprecated, use “user” parameter instead).

points_type

Points type’s slug of points balance to retrieve.

Definition

POST /wp/v2/gamipress/get-points

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/get-points -d "user=1&points_type=gem"

Award points

Award a desired points amount to the given user.

Arguments

user

User who points will be awarded. Accepts the user username, email or ID.

user_id

User who points will be awarded (deprecated, use “user” parameter instead).

points

Points amount to award.

points_type

Points type’s slug of points amount to award.

reason

Reason describing this points award (Optional). This text will appear on this points award log entry.

Definition

POST /wp/v2/gamipress/award-points

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/award-points -d "user=1&points=1&points_type=gem&reason=test"

Deduct points

Deduct a desired points amount to the given user.

Arguments

user

User who points will be deducted. Accepts the user username, email or ID.

user_id

User who points will be deducted (deprecated, use “user” parameter instead).

points

Points amount to deduct.

points_type

Points type’s slug of points amount to deduct.

reason

Reason describing this points deduction (Optional). This text will appear on this points deduction log entry.

Definition

POST /wp/v2/gamipress/deduct-points

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/deduct-points -d "user=1&points=1&points_type=gem&reason=test"

Was this article helpful to you? No Yes

How can we help?