Skip to main content

Get User Document by ID API

Overview

Retrieve detailed information about a specific user document by its document ID. This API is used to fetch individual document details for viewing, verification, or processing purposes.

API Details

Endpoint

GET https://api.gafapay.com:8443/gafapay/v3/user/user_document/{id}

Path Parameters

  • id (String, required): The unique identifier of the document to retrieve
    • Example: 1531d56243e74e89826d986ff3944025

Headers

authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNDc3N2I5ZDA3MmY0OWJiOGQzNjY0MjE2Mjg4MDVkMCIsInJvbGVzIjpbIlJPTEVfQUdFTlQiXSwiZXhwIjoxNzU3NTI1MjQxfQ.KlzfPocW-sPvxprUqwwiX5laJkQO-a4MAfrZo-1XqgA
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b35d332f-131e-44c1-892f-8322e022da74
Content-Type: application/json

Response

{
"success": 1,
"error": [],
"data": {
"document": {
"is_active": true,
"created_by": "24777b9d072f49bb8d366421628805d0",
"created_date": 1757471064,
"updated_by": null,
"updated_date": 1757471064,
"id": "1531d56243e74e89826d986ff3944025",
"user_id": "24777b9d072f49bb8d366421628805d0",
"document_user_type": 5,
"document_path": [
{
"value": "https://s3.ap-south-1.amazonaws.com/devdigipaypython/gafa-bucket/default/attachment-3_mGlqf2sGakdT8VsG.jpeg",
"type": 1,
"file_type_extension": "image/jpeg"
}
],
"document_status": null,
"document_type_id": null,
"document_extra_fields_values": null,
"expiry_date": null
}
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • document (object): Document details object

Document Object Fields

  • id (string): Document unique identifier
  • user_id (string): Associated user ID
  • document_user_type (integer): Type of user document
    • 5 = Agent documents
    • 2 = Customer documents
    • 3 = Merchant documents
  • document_path (array): Array of document file information
    • value (string): AWS S3 URL of the uploaded document
    • type (integer): Document type identifier (always 1 for uploaded files)
    • file_type_extension (string): MIME type of the file (e.g., "image/jpeg", "application/pdf")
  • document_status (integer|null): Document verification status
    • 1 = PENDING
    • 2 = VERIFIED
    • 3 = EXPIRED
    • 4 = REJECTED
    • null = Not set
  • document_type_id (string|null): Document type identifier
  • document_extra_fields_values (array|null): Additional field values for document validation
  • expiry_date (long|null): Document expiry timestamp (epoch)
  • is_active (boolean): Document active status
  • created_date (long): Document creation timestamp (epoch)
  • created_by (string): ID of the user who created the document
  • updated_by (string|null): ID of the user who last updated the document
  • updated_date (long|null): Last update timestamp (epoch)

Example Usage

Basic Document Retrieval

curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/user_document/1531d56243e74e89826d986ff3944025' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNDc3N2I5ZDA3MmY0OWJiOGQzNjY0MjE2Mjg4MDVkMCIsInJvbGVzIjpbIlJPTEVfQUdFTlQiXSwiZXhwIjoxNzU3NTI1MjQxfQ.KlzfPocW-sPvxprUqwwiX5laJkQO-a4MAfrZo-1XqgA' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74' \
--header 'Content-Type: application/json'

Document Path Structure

The document_path array contains file information for the uploaded document:

"document_path": [
{
"value": "https://s3.ap-south-1.amazonaws.com/bucket/path/file.jpg",
"type": 1,
"file_type_extension": "image/jpeg"
}
]

For Multiple Documents (e.g., Front and Back of ID)

"document_path": [
{
"value": "https://s3.ap-south-1.amazonaws.com/bucket/path/front.jpg",
"type": 1,
"file_type_extension": "image/jpeg"
},
{
"value": "https://s3.ap-south-1.amazonaws.com/bucket/path/back.jpg",
"type": 1,
"file_type_extension": "image/jpeg"
}
]

Document Status Constants

  • PENDING = 1: Document is uploaded and awaiting verification
  • VERIFIED = 2: Document has been verified and approved
  • EXPIRED = 3: Document has expired
  • REJECTED = 4: Document was rejected during verification

Document User Types

  • 5 = Agent documents
  • 2 = Customer documents
  • 3 = Merchant documents

Notes

  • Direct Access: S3 URLs in document_path are directly accessible
  • File Types: Use file_type_extension to determine file handling
  • Multiple Files: Documents can have multiple files (front/back of ID)
  • Status Tracking: Monitor document_status for verification progress
  • Expiry Management: Check expiry_date for document validity
  • Authentication: Requires valid authorization token and company ID