Get Authenticated User By Token
Overview
This endpoint is used to get the basic user details by JWT token. Its crucial for closely integrating your application with TagMango Dashboard. TagMango doesn't provide independent login solution to custom applications, in that case you can use this endpoint to get the user details by JWT token.
TagMango will include JWT token(refresh token) of the current logged in user as a query parameter to the registered domain of the application. When user clicks on the custom application from the dashboard navigation menu, it will redirect to the registered domain of the application with this token as a query parameter.
Query Parameters Example
https://your-app.domain.com?refreshToken={your-refresh-token}
Then you can extract the refresh token from the query parameter and use it to get the user details by calling this endpoint.
:::info You can also add other query parameters to the URL while adding your application in the dashboard (Settings -> Platform Settings -> Customise Menu). :::
Authorization
bearer In: header
Query Parameters
Current logged in user JWT token
Header Parameters
Host name of the dashboard, ex: mydomain.tagmango.com
Response Body
application/json
application/json
application/json
curl -X GET "https://api-prod-new.tagmango.com/api/v1/external/auth/v2/verify-token?token=your-jwt-token" \ -H "x-whitelabel-host: string"{
"_id": "6659ca9e5f2acb7abfdcd8fd",
"name": "John Doe",
"email": "john.doe@example.com",
"host": "yourhost.tagmango.com",
"userSlug": "john-doe",
"phone": 1234567890,
"profilePicUrl": "https://linktoprofilepic.com/pic.jpg",
"onboarding": "creator_completed",
"isDeactivated": false,
"country": "India",
"dialCode": "+91",
"currency": "USD",
"score": {
"lifetime": 100,
"month": 20,
"week": 5
},
"leaderboardRank": {
"lifetime": 1,
"month": 2,
"week": 3
},
"creator": "6149b1e5612c4e5fd96041d3",
"badges": [
{
"_id": "6659ca9e5f2acb7abfdcd8fd",
"creator": "6149b1e5612c4e5fd96041d3",
"name": "Hall Of Fame",
"description": "Something about the badge",
"imageUrl": "https://testing.tagmango.com/assets/badge-icon-922e7f499bc0045d7af8ac771eebe2fe.png",
"enableAutomation": true,
"pointsThreshold": 100,
"pointCategoryForAutomation": "lifetime",
"automationEnabledMangoes": [
"6659ca9e5f2acb7abfdcd8fd",
"6659ca9e5f2acb7abfdcd8fd"
],
"createdAt": "2024-05-31T13:03:26.375Z",
"updatedAt": "2024-07-19T12:32:51.071Z"
}
],
"hasGamificationAccess": false
}{
"code": 400,
"type": "Bad request",
"statusMessage": "BAD_REQUEST",
"message": "Invalid request",
"success": false
}{
"code": 401,
"type": "Unauthorized",
"statusMessage": "UNAUTHORIZED",
"message": "Invalid token",
"success": false
}Get Authenticated User By Token GET
## Overview This endpoint is used to get the basic user details by JWT token. Its crucial for closely integrating your application with TagMango Dashboard. TagMango doesn't provide independent login solution to custom applications, in that case you can use this endpoint to get the user details by JWT token. TagMango will include JWT token(refresh token) of the current logged in user as a query parameter to the registered domain of the application. When user clicks on the custom application from the dashboard navigation menu, it will redirect to the registered domain of the application with this token as a query parameter. ## Query Parameters Example `https://your-app.domain.com?refreshToken={your-refresh-token}` Then you can extract the refresh token from the query parameter and use it to get the user details by calling this endpoint. You can also add other query parameters to the URL while adding your application in the dashboard (Settings -> Platform Settings -> Customise Menu).
Create or find user POST
## Overview This endpoint creates a new user on the customhost or returns an existing user if a match is found by email or phone. At least one of email or phone is required.