☑️Quick Start
This guide will walk you through the steps to register, log in, and fetch a user profile using the API. It also explains how to use the AuthKey
header for authorized requests and BrandUrl
header for all requests.
Prerequisites
Ensure you have access to the API base URL (e.g.,
https://api.example.com
) that mean you has already brand.Tools like
curl
, Postman, or any HTTP client to make API requests.
Step 1: Register a New User
To use the API, you first need to register a new user. Send a POST
request to the registration endpoint with the required user details. Visit Register a new user
Request
Response
On successful registration, you will receive a response with the user details:
Step 2: Sign In to Get AuthKey
After registration, sign in to obtain the AuthKey
, which is required for authorized API requests. Visit Authentication
Request
bashCopy
Response
On successful authentication, you will receive an AuthKey
in the response:
Save the authKey
value for use in subsequent requests.
Step 3: Fetch User Profile (Authorized Request)
To fetch the user profile, you need to include the AuthKey
in the request header. This API requires authorization.
Request
AuthKey
: The key obtained from the login response.BrandUrl
: A required header for authorized requests (replaceexample.com
with your brand's URL).
Response
The response will include the user's profile details:
Step 4: Using AuthKey for Other Authorized APIs
For any API that requires authorization, you must include the AuthKey
headers in your request. For example:
Example: Fetch User notifications
Example: Update User Profile
Step-by-Step Workflow
Register a new user using the
/api/user/register
endpoint.Log in using the
/api/v1/users/auth
endpoint to obtain theAuthKey
.Fetch the user profile using the
/api/user/me
endpoint with theAuthKey
andBrandUrl
headers.Use the
AuthKey
for other authorized APIs as needed.
Best Practices
Always include the
BrandUrl
header in every request to identify the brand.Store the
AuthKey
securely and do not expose it in client-side code.Handle API errors gracefully (e.g., invalid
AuthKey
, expired session).
Last updated
Was this helpful?