Visitors module
This module provides authentication for visitors of your products. It uses a single-token authentication system.
NOTE: We will be introducing OAuth 2.0-based authentication in a future update. Make sure you follow the deprecation time of this module when announced.
URL Format
You can use GET or POST variables in your requests.
baseUrl/visitors.php?action=ACTION¶ms...
When the visitor token is required, add
&token=TOKEN_HERE
Device ID
To track device usage, you are required to submit a Device ID with all authentication requests. If you do not have one, do not submit it, and a new one will be created. This ID will be logged for limiting concurrent logins from visitors. Make sure to save it on your device (via persisent storage or cookies).
Reference
Some responses may return defined objects inside the JSON that refer to existing classes.
See related:
List of actions
The parameter "action" determines the action you would like to match. See below list.
login
Parameters:
- username (typically an email)
- password (in clear-text)
- device (Device ID if available)
Return:
{
data: {
visitor: Visitor Object
token: Token object
device: Current Device ID (optional)
}
}
login_token
Parameters:
- token (returned from a previous authentication)
- device (Device ID)
Return: see login request
login_facebook
Parameters:
- token (returned from Facebook)
- device (Device ID)
Return: see login request
login_google
Parameters:
- access_token (returned from Google)
- auth_code ()
- device (Device ID)
Return: see login request
login_apple
login_ipaddress
register
check_exists
send_forgot_password
activation_code_exists
reset_password
activate
edit
upload_profile_image
subscriptions
payment_details
logout
get_ip_tables
Get the list of IP addresses versus the visitor accounts that have them. Useful to do initial IP-based check for auto logins without initiating an API call for every new visit. You are highly advised to cache this value for at least 1 hour.
Make sure to use an authenticated API key for this request. This means that you can only perform this on server-side.