Skip to content

User Authentication

This guide provides information on how to register and log in to an account using the REST API.

Register

To register a user, you need to use the POST account/register endpoint.

There are two types of account registration: Capturit and Facebook. Below are the required request body for each type:

Capturit

{
"user_first_name": "Jane",
"user_last_name": "Doe",
"user_username": "rat",
"user_email": "rat@gmail.com",
"user_password": "rat123",
"user_password_confirmation": "rat123",
"user_login_option_type": 1, //Capturit
"device_id": "DeviceID",
"user_timezone": "Asia/Manila",
"user_device_platform": "android"
}

Facebook

{
"user_first_name": "Jane",
"user_last_name": "Doe",
"user_username": "rat",
"user_email": "rat@gmail.com",
"user_login_option_type": 3, //Facebook
"user_login_option_unique_identifier": "125213213", //Facebook ID
"user_password": "Authentication_Token", // Facebook Authentication Token
"device_id": "DeviceID",
"user_timezone": "Asia/Manila",
"user_device_platform": "android"
}

See: Registration Request Body

After submitting the request, a response containing the user information, authentication token, and token expiration will be returned. You need to store this information, as it will be required for accessing other endpoints and displaying the user’s information.

After registering the user’s information, you can upload their avatar by calling upload avatar endpoint. Then, use the authentication token to authorize the upload.

Login

To sign in a user, you need to use the POST account/login endpoint.

There are two types of singning an account: Capturit and Facebook. Below are the required request body for each type:

Capturit

{
"user_login_option_type": 1,
"user_login_id": "rat", //username or email
"user_password": "rat123",
"device_id": "DeviceID",
"user_timezone": "Asia/Manila",
"user_device_platform": "android"
}

Facebook

{
"user_login_option_type": 3,
"user_login_id": "125213213", //Facebook ID
"user_password": "Authentication_Token", // Facebook Authentication Token
"device_id": "DeviceID",
"user_timezone": "Asia/Manila",
"user_device_platform": "android"
}

See: Login Request Body

After submitting the request, a response containing the user information, authentication token, and token expiration will be returned. You need to store this information, as it will be required for accessing other endpoints and displaying the user’s information.