Create or find user
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.
Authorization
bearer In: header
Header Parameters
Host name of the dashboard, ex: mydomain.tagmango.com
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/users" \ -H "x-whitelabel-host: string" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "phone": 9876543210, "name": "John Doe", "country": "IN" }'{
"_id": "6659ca9e5f2acb7abfdcd8fd",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": 1234567890,
"country": "India",
"dialCode": "+91",
"currency": "USD",
"isNew": true
}{
"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. :::info You can also add other query parameters to the URL while adding your application in the dashboard (Settings -> Platform Settings -> Customise Menu). :::
Get User By Email or Phone GET
## Overview This endpoint can be used to look up a user by email or phone number. At least one of email or phone must be provided. If both are provided, the lookup requires both to match the same user, else it will respond with not found.