Skip to main content

Fetch Details from Phone Number API

Objective

The Fetch Details from Phone Number API retrieves basic details associated with a user's phone number.

InputOutput
The user's Nigerian phone number The first name, last name, gender and date of birth of the user

API Endpoint

getNameFromPhone

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

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
transactionIdMandatoryA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Input

The following table provides the complete information on the parameter used in the request body for the API calls.

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
phoneNumberThe user's Nigerian phone number, starting with a 0.MandatoryThe length of the phone number should be 11 digits Not Applicable

Sample Request

The following code shows a standard cURL request for the API.

curl --location --request POST 'https://zaf.thomas.hyperverge.co/v1/getNameFromPhone' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data '{
"phoneNumber": "<Enter_the_Phone_Number>"
}'

Success Response Sample

{
"statusCode": "200",
"status": "success",
"result": {
"data": {
"surname": "<Surname>",
"firstName": "<First_Name>",
"middlename": "<Middle_Name>",
"gender": "<Gender>",
"dateOfBirth": "<Date_Of_Birth_in_YYYY-MM-DD_Format>"
}
},
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

ParameterTypeDescription
statusstringA status code that represents the result of the request
surnamestringThe user's last name
firstNamestringThe user's first name
middlenamestringThe user's middle name
genderstringThe user's gender
dateOfBirthstringThe user's date of birth in the format YYYY-MM-DD

Failure Response Sample

The following is a sample response when no records of the entered phone number are found.

{
"status": "failure",
"statusCode": 404,
"error": "Phone number not found",
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Error Response Samples

{
"status": "failure",
"statusCode": 400,
"error": "Invalid phone number supplied",
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Failure and Error Response Details

A failure or error response from the module contains a failure status, with a relavant status code and error message. The following table lists all error responses.

Status CodeError MessageError Description
400Invalid phone number suppliedThe provided Phone number is invalid
400Input Validation Error: does not meet minimum length of 11The provided number does not meet the minimum length of 11
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
403Access DeniedPlease contact the HyperVerge team for resolution
404Phone number not foundThe provided phone number does not match any identity at this point
500Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
503Our data source has returned a timeout response, please retry the requestThe request to the data source timed out, please check your connection and try again
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: