1. Documentation
  2. Rest API Extended
  3. Achievements Extended Controller

Achievements 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 achievements

Retrieve earned achievements of given user.

Arguments

user

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

user_id

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

achievement_type

Achievement type’s slug of achievements to retrieve.

Definition

POST /wp/v2/gamipress/get-achievements

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/get-achievements -d "user=1&achievement_type=badge"

Award achievement

Award the desired achievement to the given user.

Arguments

user

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

user_id

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

achievement_id

Achievement that will be awarded.

Definition

POST /wp/v2/gamipress/award-achievement

Example Request

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

Revoke achievement

Revoke the desired achievement to the given user.

Arguments

user

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

user_id

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

achievement_id

Achievement that will be revoked.

Definition

POST /wp/v2/gamipress/revoke-achievement

Example Request

curl -X POST http://website.com/wp-json/wp/v2/gamipress/revoke-achievement -d "user=1&achievement_id=1"

How can we help?