What are tokens?
Tokens are a short little piece of text that allows you to get some type of data from your WordPress website, which can then be used in your API calls. Tokens can be used within the admin area of WPGetAPI to allow you to create API dynamic calls without having to write code.
Looking at the image below, we have some examples of what tokens look like in action.
How to use tokens
- A token must start with an opening bracket and end with a closing bracket
- The ‘type’ of token (see below) must be the first word ie. (date or (system or (post or (user
- The token can be used anywhere in the WPGetAPI admin areas
Types of tokens
There are 5 types of tokens that we can use:
- Post tokens
- User tokens
- System tokens
- Date tokens
- WooCommerce order tokens
- Lifter LMS order tokens
Let’s now look at each token and see the settings we can use for each token.