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_id

User to retrieve achievement.

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_id=1&achievement_type=badge"

Award achievement

Award the desired achievement to the given user.

Arguments

user_id

User who achievement will be awarded.

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_id=1&achievement_id=1"

Revoke achievement

Revoke the desired achievement to the given user.

Arguments

user_id

User who achievement will be revoked.

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_id=1&achievement_id=1"

How can we help?