Using the API with your Points System
The API has been updated to allow for managing point values on your users.
Note: These new methods require the use of your Enjin API key. You can find this key within your admin panel > settings > Enjin API section.
How to get the points of users using the API
Use the POST method with the URL yourwebsite.com/api/get-points
With your POST request, include the following parameters
- key=<Secret API Key>
- user_id=<Enjin User ID> OR player=<Minecraft Player Name>
How to add points using the API
Use the POST method with the URL yourwebsite.com/api/add-points
With your POST request, include the following parameters
- key=<Secret API Key>
- user_id=<Enjin User ID> OR player=<Minecraft Player Name>
- points=<Number of points to add>
How to remove points using the API
Use the POST method with the URL yourwebsite.com/api/remove-points
With your POST request, include the following parameters
- key=<Secret API Key>
- user_id=<Enjin User ID> OR player=<Minecraft Player Name>
- points=<Number of points to remove>
How to set points using the API
Use the POST method with the URL yourwebsite.com/api/set-points
With your POST request, include the following parameters
- key=<Secret API Key>
- user_id=<Enjin User ID> OR player=<Minecraft Player Name>
- points=<Total points player will have>
API Points Example
In this example we will remove 50 points from a user with the ID 123456 on the website enjin.com using a simple html form. My secret Enjin key in this example will be "abc123".
HTML
<form method="post" action="enjin.com/api/remove-points">
<input type="hidden" name="key" value="abc123" />
<input type="hidden" name="user_id" value="123456" />
<input type="hidden" name="points" value="50" />
<input type="submit" value="Submit" />
</form>
API Documentation - http://www.enjin.com/apidocumentation
Comments
0 comments
Please sign in to leave a comment.