Retrieve Contact By ID
Overview
The Retrieve Contact By ID API allows financial institutions to fetch detailed information about a specific customer contact using their unique identifier.
Command Details
Command Name: RetrieveContactByIdQuery
Operation Type: Query (Read Operation)
Use Cases
- Customer Profile View: Display complete customer information
- Transaction Verification: Verify customer details before transactions
- Customer Service: Access customer information during support calls
- Administrative Review: Review customer data for updates or verification
API Endpoint
POST /api/bpm/qry
Content-Type: application/json
Authorization: Bearer {access_token}
Request Structure
Request Body
{
"queryName": "RetrieveContactByIdQuery",
"data": {
"id": 12345
}
}
Request Fields
| Field Name | Type | Mandatory | Description |
|---|---|---|---|
id | Integer | Yes | Client ID |
Sample Requests
1. Retrieve Contact
{
"queryName": "RetrieveContactByIdQuery",
"data": {
"id": 12345
}
}
Response Structure
Success Response
{
"isSuccessful": true,
"statusCode": "00",
"message": "Client with ID 12345 found.",
"data": {
"id": 12345,
"encodedKey": "8a8e87e87d1234567890abcd",
"customerNumber": "CUST1000245",
"firstName": "John",
"lastName": "Doe",
"middleName": "Michael",
"emailAddress": "john.doe@email.com",
"phoneNumber": "+234 123 456 7890",
"dateOfBirth": "1990-05-15T00:00:00Z",
"gender": "Male",
"maritalStatus": 1,
"maritalStatusDescription": "Single",
"address": "123 Main Street",
"city": "Lagos",
"state": "Lagos State",
"country": "Nigeria",
"identificationType": "National ID",
"identificationNumber": "NIN12345678901",
"customerType": "Individual",
"clientState": 1,
"clientStateDescription": "Active",
"isBlacklisted": false,
"branchId": 100,
"branchEncodedKey": "8a8e87e87d1234567890abcd",
"branchName": "Main Branch",
"accountOfficerId": 50,
"accountOfficerName": "Jane Smith",
"dateCreated": "2025-01-01T00:00:00Z",
"lastModified": "2025-12-15T10:30:00Z"
}
}
Response Fields
| Field Name | Type | Description |
|---|---|---|
id | Integer | Client ID |
encodedKey | String | Unique encoded identifier |
customerNumber | String | Customer account number |
firstName | String | Customer's first name |
lastName | String | Customer's last name |
middleName | String | Customer's middle name (optional) |
emailAddress | String | Email address |
phoneNumber | String | Phone number |
dateOfBirth | String | Date of birth (ISO 8601) |
gender | String | Gender |
maritalStatus | Integer | Marital status code (see MaritalStatusEnum) |
maritalStatusDescription | String | Human-readable marital status |
address | String | Street address |
city | String | City |
state | String | State/Province |
country | String | Country |
identificationType | String | Type of ID document |
identificationNumber | String | ID document number |
customerType | String | Customer category |
clientState | Integer | Client state code (see ClientStateEnum) |
clientStateDescription | String | Human-readable client state |
isBlacklisted | Boolean | Whether client is blacklisted |
branchId | Integer | Branch ID |
branchEncodedKey | String | Branch encoded key |
branchName | String | Branch name |
accountOfficerId | Integer | Account officer ID |
accountOfficerName | String | Account officer name |
dateCreated | String | Creation date (ISO 8601) |
lastModified | String | Last modification date (ISO 8601) |
Enumerations
ClientStateEnum
| Value | Name | Description |
|---|---|---|
| 0 | All | All states (filter value) |
| 1 | Active | Client is active |
| 3 | PendingApproval | Awaiting approval |
| 4 | Approved | Approved but not yet active |
| 5 | Rejected | Application rejected |
| 6 | BlackListed | Client is blacklisted |
| 7 | Exited | Client has exited |
MaritalStatusEnum
| Value | Name | Description |
|---|---|---|
| 1 | Single | Single/unmarried |
| 3 | Married | Married |
| 4 | Separated | Separated |
| 5 | Widow | Widow/widower |
| 6 | Others | Other status |
Error Handling
Common Error Responses
Contact Not Found
{
"isSuccessful": false,
"statusCode": "CBS_404",
"message": "Client with ID 12345 not found."
}
Missing ID
{
"isSuccessful": false,
"statusCode": "CBS_400",
"message": "Client ID is required."
}
Error Codes
| Status Code | Message | Cause |
|---|---|---|
CBS_400 | Invalid request | Missing or invalid client ID |
CBS_401 | Unauthorized | Invalid authentication |
CBS_403 | Forbidden | Insufficient permissions |
CBS_404 | Contact not found | Invalid client ID |
CBS_500 | Internal server error | System error |
Code Examples
cURL
curl -X POST https://api.example.com/api/bpm/qry \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"queryName": "RetrieveContactByIdQuery",
"data": {
"id": 12345
}
}'
C# Example
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
var request = new
{
queryName = "RetrieveContactByIdQuery",
data = new
{
id = 12345
}
};
var response = await client.PostAsJsonAsync(
"https://api.example.com/api/bpm/qry",
request
);
var result = await response.Content.ReadFromJsonAsync<ApiResponse>();
JavaScript/TypeScript Example
const response = await fetch('https://api.example.com/api/bpm/qry', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({
queryName: 'RetrieveContactByIdQuery',
data: {
id: 12345
}
})
});
const result = await response.json();
Implementation Notes
- This query internally uses
RetrieveContactListQuerywith ID filter - Returns complete customer profile information
- Includes blacklist status and client state
- Requires appropriate user permissions
- Returns single contact record or error if not found
Best Practices
- Validation: Validate client ID before making request
- Error Handling: Handle "not found" scenarios appropriately
- Permissions: Ensure user has permission to view client data
- Caching: Consider caching frequently accessed client data
- Security: Never expose sensitive client data in logs or error messages
Related APIs
- Create Contact - Create new client
- Update Contact - Update client information
- Retrieve Contact List - Search multiple clients
- Blacklist Customer - Blacklist a client
Handler: AdministrationCoreContactCommandHandlers