1. Rest API Extended
  2. Ranks Extended Controller

Ranks 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 rank

Retrieve current rank of given user.

Arguments

user

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

user_id

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

rank_type

Rank type’s slug of rank to retrieve.

Definition

POST /wp/v2/gamipress/get-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/get-rank -d "user=1&rank_type=level"

Get next rank

Retrieve next reachable rank of given user. If there isn’t one will return the current one.

Arguments

user

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

user_id

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

rank_type

Rank type’s slug of rank to retrieve.

Definition

POST /wp/v2/gamipress/get-next-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/get-next-rank -d "user=1&rank_type=level"

Get previous rank

Retrieve previous reached rank of given user. If there isn’t one will return the current one.

Arguments

user

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

user_id

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

rank_type

Rank type’s slug of rank to retrieve.

Definition

POST /wp/v2/gamipress/get-previous-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/get-previous-rank -d "user=1&rank_type=level"

Award rank

Award the desired rank to the given user.

Arguments

user

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

user_id

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

rank_id

Rank that will be awarded.

Definition

POST /wp/v2/gamipress/award-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/award-rank -d "user=1&rank_id=1"

Revoke rank

Revoke the desired rank to the given user.

Arguments

user

User who rank will be revoked. Accepts the user username, email or ID.

user_id

User who rank will be revoked (deprecated, use “user” parameter instead).

rank_id

Rank that will be revoked.

new_rank_id

New rank that will be assigned to the user (Optional). By default, previous rank of the same type will be assigned.

Definition

POST /wp/v2/gamipress/revoke-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/revoke-rank -d "user=1&rank_id=1&new_rank_id=2"

Upgrade to next rank

Upgrade given user to the next rank if possible.

Arguments

user

User who rank will be upgraded. Accepts the user username, email or ID.

user_id

User who rank will be upgraded (deprecated, use “user” parameter instead).

rank_type

Rank type’s slug of rank to upgrade.

Definition

POST /wp/v2/gamipress/upgrade-to-next-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/upgrade-to-next-rank -d "user=1&rank_type=level"

Downgrade to previous rank

Downgrade given user to the previous rank if possible.

Arguments

user

User who rank will be downgraded. Accepts the user username, email or ID.

user_id

User who rank will be downgraded (deprecated, use “user” parameter instead).

rank_type

Rank type’s slug of rank to downgrade.

Definition

POST /wp/v2/gamipress/downgrade-to-previous-rank

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/downgrade-to-previous-rank -d "user=1&rank_type=level"

Was this article helpful to you? No Yes

How can we help?