Skip to main content

Get All User Documents API

Overview

Retrieve all documents associated with a specific user. This API is commonly used for KYC (Know Your Customer) document management and verification processes.

API Details

Endpoint

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

Query Parameters

Required Parameters

  • user_id (String): The unique identifier of the user whose documents to retrieve
    • Example: 24777b9d072f49bb8d366421628805d0

Optional Parameters

  • skip (Integer): Number of records to skip (pagination)
    • Default: 0
    • Example: 0, 10, 20
  • limit (Integer): Maximum number of records to return (pagination)
    • Default: 10
    • Example: 10, 25, 50
  • sorting (String): Sorting criteria (JSON format)
    • Example: {"created_date": "DESC"}

Headers

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

Response

{
"success": 1,
"error": [],
"data": {
"documents": [
{
"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
    • documents (array): Array of document objects

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
  • 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 Request

curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/user_document?user_id=24777b9d072f49bb8d366421628805d0' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNDc3N2I5ZDA3MmY0OWJiOGQzNjY0MjE2Mjg4MDVkMCIsInJvbGVzIjpbIlJPTEVfQUdFTlQiXSwiZXhwIjoxNzU3NTI1MjQxfQ.KlzfPocW-sPvxprUqwwiX5laJkQO-a4MAfrZo-1XqgA' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74'

Request with Pagination

curl --location 'https://api.gafapay.com:8443/gafapay/v3/user/user_document?user_id=24777b9d072f49bb8d366421628805d0&skip=0&limit=5' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID'

Document Path Structure

The document_path array contains file information for uploaded documents:

"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

Notes

  • AWS S3 Integration: Documents must be uploaded to AWS S3 bucket first to get the URL
  • File Type Support: Supports various file types including images (JPEG, PNG) and PDFs
  • Multiple Documents: For documents requiring multiple files (like ID front/back), add multiple objects to the document_path arrayverification workflows
  • Pagination: Use skip and limit parameters for efficient data retrieval