Skip to main content

Create Profile

The following documentation details the process for integrating with the Add Candidate API, which is used to add candidates as per the form created on the portal.

API Endpoint

Endpoint URL: POST https://api.trential.dev/verification/api/1.0/ekyc-forms/:formId/diy-candidate

Try it out →

Request

To add a candidate, send a POST request with the following JSON payload:

{
"name": "Candidate Name",
"gender": "Male",
"mobile": "+91-9119216041",
"profession": "Other",
"verificationFields": {
"fatherName": "father name",
"dob": "02-01-1989"
}
}

cURL

curl -X POST 'https://api.trential.dev/verification/api/1.0/ekyc-forms/YOUR_FORM_ID/diy-candidate' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "Candidate Name",
"gender": "Male",
"mobile": "+91-9119216041",
"profession": "Other",
"verificationFields": {
"fatherName": "father name",
"dob": "02-01-1989"
}
}'

Parameters

  • name (string): The candidate's full name.(Required)
  • gender (string): The candidate's gender. Accepted values are Male, Female, Other.(Required)
  • mobile (string): The candidate's mobile phone number, including country code.(optional)
  • profession (string): The candidate's profession.(optional)
  • email (string): The candidate's email.(optional)
  • verificationFields (object): Additional fields for verification.(optional)
    • dob (string): The candidate's date of birth in DD-MM-YYYY format.(required if verificationFields is provided)
    • fatherName (string): The candidate's father's name.(optional)

Response

If the candidate is valid, the response will be as follows:

{
"code": 0,
"message": "Success",
"data": {
"transactionId": "6647408598332f345e0747ae"
}
}
Success Response
  • code (integer): Status code indicating the result of the request. 0 indicates success.
  • message (string): Description of the result. Success indicates the candidate was successfully added.
  • data (object): Contains additional data related to the request.
    • transactionId (string): A unique identifier for the transaction.

If the candidate is invalid, the response will be as follows:

{
"message": "name must be a string/dob must be a string/gender must be one of the following values: Male, Female, Other",
"code": -1
}
Error Response
  • message (string): Description of the error(s) encountered. This field provides detailed information about the specific validation issues.
  • code (integer): Status code indicating the result of the request. -1 indicates a failure due to invalid candidate data.