Fetch UAN API
Objective
The Fetch UAN API retrieves the Universal Account Number (UAN) associated with a user's mobile number, allotted by the Employee Provident Fund Organisation (EPFO).
| Input | Output |
|---|---|
| The user's mobile number and consent | The UAN associated with the user's mobile number |
API URL
https://ind.thomas.hyperverge.co/v1/fetchUAN
API Endpoint
fetchUAN
Overview
The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.
Authentication
You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.
API Request Details
Method - POST
Headers
| Parameter | Mandatory or Optional | Description | Allowed Values |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload | application/json |
| appId | Mandatory | The application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab. | This should be a unique value |
| appKey | Mandatory | The application key shared by HyperVerge. You can find the details in the dashboard's credentials tab. | This should be a unique value |
| transactionId | Mandatory | A unique identifier for tracking a user journey | This should be both unique and easily associated with the user's journey in your application(s) |
Inputs
The following table provides the details of the fields required for the API's request body:
| Parameter | Description | Mandatory or Optional | Allowed Values | Default Value |
|---|---|---|---|---|
mobileNumber | The 10 digit phone number associated with the EPFO account | Mandatory | A valid 10 digit mobile number | Not Applicable |
consent | The user's consent | Mandatory | "Y" for yes or "N" for no | Not Applicable |
Sample Request
The following code shows a standard curl request for the API.
curl --location --request POST 'https://ind.thomas.hyperverge.co/v1/fetchUAN' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data '{
"mobileNumber": "<Mobile_Number>",
"consent": "<Consent>"
}'
Success Response Sample
The following is a sample of a success response from the API.
{
"status": "success",
"statusCode": 200,
"result": {
"message": "UAN fetched from mobile.",
"uanList": [
"<UAN_Number>"
]
},
"metaData": {
"requestId": "<Request_ID>"
}
}
Success Response Details
| Parameter | Type | Description |
|---|---|---|
| uanList | string | The UAN retrieved against the user's mobile number |
Failure Response Sample
The API returns the following response when it fails to find a matching employment record associated with the user's mobile number:
{
"status": "success",
"statusCode": 200,
"result": {
"message": "Provided mobile number doesn't have any UAN."
},
"metaData": {
"requestId": "<Request_ID>"
}
}
Error Response Samples
The following are some sample error responses from the API:
- Invalid Mobile Number
- Input Validation Error
- Invalid Credentials
- Internal Server Error
The following is a sample response for an invalid mobile number.
{
"message": "Provide a valid mobile number",
"statusCode": 400,
"status": "failure",
"metaData": {
"requestId": "<Request_ID>"
}
}
The following is a sample response for input validation error.
{
"message": "Input Validation Error: does not meet minimum length of 10",
"statusCode": 400,
"status": "failure"
}
The following is a sample response when the input credentials are invalid.
{
"message": "Missing/Invalid credentials",
"statusCode": 401,
"status": "failure"
}
The following is a sample response for when an internal server error occurs.
{
"message": "Internal Server Error",
"statusCode": 500,
"status": "failure"
}
Failure and Error Response Details
failure status, with a relavant status code and error message. The following table lists all error responses. | Status Code | Error Message | Error Description |
| 400 | Missing required request parameters | Some mandatory request parameters are missing in the API request made. Check if "mobileNumber" and "consent" are given in request body |
| 401 | Missing/Invalid credentials | The appId/ appKey is missing or incorrect in the request headers |
| 403 | Access Denied | Please contact the HyperVerge team |
| 500 | Internal Server Error | Please check the request headers or contact the HyperVerge team for resolution |