Generating Tokens
Each ID type has its own configuration and parameters for generating tokens. Below are the steps to generate a token for the different types:
Tokens have a limited lifespan. Each token created is valid for 15 minutes from the time of generation.
Expired tokens will no longer be valid and cannot be used for verification purposes.
- Ghana Card
 - Voters ID
 - Passport
 - Drivers License
 
POST /initiate/token_verification
Descriptionβ
The /initiate/token_verification endpoint serves as the designated pathway for generating tokens required for remote verifications. Ensure that the body parameters are passed in the multipart/form-data format.
Required Body Paramaters (formdata)β
id_type: This is a string indicating the type of ID to be verified.
It should be one of the following options:"GHANA_CARD"|"VOTER"|"PASSPORT"|"DRIVER_LICENCE". For this particular request, the idtype is set to"GHANA_CARD".ghanacardnumber: This is a string representing the Ghana Card number of the individual being verified.
It should follow the formatGHA-XXXXXXXXX-Xwhere X represents a digit.send_token_to_client: This parameter has a value of1, indicating that an SMS will be sent to the individual being verified to receive the token.verificationtype: This parameter has a value of3phonenumber: This is the phone number of the individual being verified. An SMS containing the verification link will be sent to this number.referenceid: This is a string that can be used to track this verification. In this case, set the referenceid as the client's phone number.purpose: This is a string describing the purpose for the verification, such as"Identity Verification".email: (optional) This is an optional email to send the remote verification link to.with_instructions: (optional) This optional field has a defaults value of1. Set it to0to skip verification guidelines and confirmation screens, proceeding directly to the liveness capture session. Include this parameter if needed.require_location: (optional) This parameter determines whether the user's device location should be captured during the verification process. Set to1to enable location capture or0to omit it.require_address_location: (optional) This parameter determines whether the user's device home address should be captured after the verification process. Set to1to enable home address capture or0to omit it.
- Example Request
 - Example Response
 
curl --location 'https://service-prod.metric.africa/api/identification/initiate/token_verification' \
--header 'X-API-AUTH: abcdefghijklmnopqrstuvwxyz' \
--form 'id_type="GHANA_CARD"' \
--form 'ghanacardnumber="GHA-XXXXXXXXX-X"' \
--form 'send_token_to_client="1"' \
--form 'verificationtype="3"' \
--form 'phonenumber="0300000000"' \
--form 'referenceid="0300000000"' \
--form 'purpose="Testing purpose"' \
--form 'email="email@email.com"' \
--form 'with_instructions="1"' \
HTTP/1.1 200 OK
Content-Type: application/json
{
  "responsemessage": "Verification token generated successfully",
  "phonenumber": "0300000000",
  "verificationtoken": "XXXXXXXXX"
}
POST /initiate/token_verification
Descriptionβ
The /initiate/token_verification endpoint serves as the designated pathway for generating tokens required for remote verifications. Ensure that the body parameters are passed in the multipart/form-data format.
Required Body Paramaters (formdata)β
id_type: This is a string indicating the type of ID to be verified.
It should be one of the following options:"GHANA_CARD"|"VOTER"|"PASSPORT"|"DRIVER_LICENCE". For this particular request, the idtype is set to"VOTER".voterid: This is a string representing the Voter ID of the individual being verified.send_token_to_client: This parameter has a value of1, indicating that an SMS will be sent to the individual being verified to receive the token.verificationtype: This parameter has a value of3phonenumber: This is the phone number of the individual being verified. An SMS containing the verification link will be sent to this number.referenceid: This is a string that can be used to track this verification. In this case, set the referenceid as the client's phone number.purpose: This is a string describing the purpose for the verification, such as"Identity Verification".email: (optional) This is an optional email to send the remote verification link to.with_instructions: (optional) This optional field has a defaults value of1. Set it to0to skip verification guidelines and confirmation screens, proceeding directly to the liveness capture session. Include this parameter if needed.require_location: (optional) This parameter determines whether the user's device location should be captured during the verification process. Set to1to enable location capture or0to omit it.require_address_location: (optional) This parameter determines whether the user's device home address should be captured after the verification process. Set to1to enable home address capture or0to omit it.
- Example Request
 - Example Response
 
curl --location 'https://service-prod.metric.africa/api/identification/initiate/token_verification' \
--header 'X-API-AUTH: abcdefghijklmnopqrstuvwxyz' \
--form 'id_type="VOTER"' \
--form 'voterid="XXXXXXXXXXX"' \
--form 'send_token_to_client="1"' \
--form 'verificationtype="3"' \
--form 'phonenumber="0300000000"' \
--form 'referenceid="0300000000"' \
--form 'purpose="Testing purpose"' \
--form 'email="email@email.com"' \
--form 'with_instructions="1"' \
HTTP/1.1 200 OK
Content-Type: application/json
{
  "responsemessage": "Verification token generated successfully",
  "phonenumber": "0300000000",
  "verificationtoken": "XXXXXXXXX"
}
POST /initiate/token_verification
Descriptionβ
The /initiate/token_verification endpoint serves as the designated pathway for generating tokens required for remote verifications. Ensure that the body parameters are passed in the multipart/form-data format.
Required Body Paramaters (formdata)β
id_type: This is a string indicating the type of ID to be verified.
It should be one of the following options:"GHANA_CARD"|"VOTER"|"PASSPORT"|"DRIVER_LICENCE". For this particular request, the idtype is set to"PASSPORT".passportnumber: This is a string representing the passport number of the individual being verified.send_token_to_client: This parameter has a value of1, indicating that an SMS will be sent to the individual being verified to receive the token.verificationtype: This parameter has a value of3phonenumber: This is the phone number of the individual being verified. An SMS containing the verification link will be sent to this number.referenceid: This is a string that can be used to track this verification. In this case, set the referenceid as the client's phone number.purpose: This is a string describing the purpose for the verification, such as"Identity Verification".email: (optional) This is an optional email to send the remote verification link to.with_instructions: (optional) This optional field has a defaults value of1. Set it to0to skip verification guidelines and confirmation screens, proceeding directly to the liveness capture session. Include this parameter if needed.require_location: (optional) This parameter determines whether the user's device location should be captured during the verification process. Set to1to enable location capture or0to omit it.require_address_location: (optional) This parameter determines whether the user's device home address should be captured after the verification process. Set to1to enable home address capture or0to omit it.
- Example Request
 - Example Response
 
curl --location 'https://service-prod.metric.africa/api/identification/initiate/token_verification' \
--header 'X-API-AUTH: abcdefghijklmnopqrstuvwxyz' \
--form 'id_type="PASSPORT"' \
--form 'passportnumber="GXXXXXXX"' \
--form 'send_token_to_client="1"' \
--form 'verificationtype="3"' \
--form 'phonenumber="0300000000"' \
--form 'referenceid="0300000000"' \
--form 'purpose="Testing purpose"' \
--form 'email="email@email.com"' \
--form 'with_instructions="1"' \
HTTP/1.1 200 OK
Content-Type: application/json
{
  "responsemessage": "Verification token generated successfully",
  "phonenumber": "0300000000",
  "verificationtoken": "XXXXXXXXX"
}
POST /initiate/token_verification
Descriptionβ
The /initiate/token_verification endpoint serves as the designated pathway for generating tokens required for remote verifications. Ensure that the body parameters are passed in the multipart/form-data format.
Required Body Paramaters (formdata)β
id_type: This is a string indicating the type of ID to be verified.
It should be one of the following options:"GHANA_CARD"|"VOTER"|"PASSPORT"|"DRIVER_LICENCE". For this particular request, the idtype is set to"DRIVER_LICENCE".driverid: This is a string representing the ID or Ref number of the individual being verified.dob: This is a string representing the date of birth of the individual being verified. It should follow theYYYY-MM-DDformatsend_token_to_client: This parameter has a value of1, indicating that an SMS will be sent to the individual being verified to receive the token.verificationtype: This parameter has a value of3phonenumber: This is the phone number of the individual being verified. An SMS containing the verification link will be sent to this number.referenceid: This is a string that can be used to track this verification. In this case, set the referenceid as the client's phone number.purpose: This is a string describing the purpose for the verification, such as"Identity Verification".email: (optional) This is an optional email to send the remote verification link to.with_instructions: (optional) This optional field has a defaults value of1. Set it to0to skip verification guidelines and confirmation screens, proceeding directly to the liveness capture session. Include this parameter if needed.require_location: (optional) This parameter determines whether the user's device location should be captured during the verification process. Set to1to enable location capture or0to omit it.require_address_location: (optional) This parameter determines whether the user's device home address should be captured after the verification process. Set to1to enable home address capture or0to omit it.
- Example Request
 - Example Response
 
curl --location 'https://service-prod.metric.africa/api/identification/initiate/token_verification' \
--header 'X-API-AUTH: abcdefghijklmnopqrstuvwxyz' \
--form 'id_type="DRIVER_LICENCE"' \
--form 'driverid="XXXXXXXXX"' \
--form 'dob="1990-09-09"' \
--form 'send_token_to_client="1"' \
--form 'verificationtype="3"' \
--form 'phonenumber="0300000000"' \
--form 'referenceid="0300000000"' \
--form 'purpose="Testing purpose"' \
--form 'email="email@email.com"' \
--form 'with_instructions="1"' \
HTTP/1.1 200 OK
Content-Type: application/json
{
  "responsemessage": "Verification token generated successfully",
  "phonenumber": "0300000000",
  "verificationtoken": "XXXXXXXXX"
}