BrandKwikID Documentation
Form Flow

Integrations

APIs

KwikID API Integration Guide

Environments

KwikID provides two environments for integration:

UAT Environment

  • Base URL: https://<YOUR-DOMAIN>.<ENV>.getkwikid.com
  • Used for testing and development
  • Sandbox environment with test data

Production Environment

  • Base URL: https://<YOUR-DOMAIN>.<ENV>.getkwikid.com
  • Used for live transactions
  • Handles real user data

Note: Replace <YOUR-DOMAIN> from SaaS portal and <ENV> with either test for UAT or app for Production in all example endpoints below. e.g. BASE-URL = company-domain.test.getkwikid.com

Authentication

Before making any API calls, you'll need to generate an authentication token.

Generate Authentication Token

POST https://<BASE-URL>/agentapi/v1/agent/generate_token

Request Headers

{
  "accept": "application/json",
  "Content-Type": "application/json"
}

Request Body

{
  "username": "<>",
  "password": "<>"
}

Example Request

curl -X POST "https://<BASE-URL>/agentapi/v1/agent/generate_token" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "<>",
    "password": "<>"
  }'

Response

The API will return an authentication token that should be used in subsequent requests.


Send a link to a user for various purposes like authentication or verification.

POST https://<BASE-URL>/agentapi/v1/agent/sendLink/

Request Headers

{
  "auth": "YOUR_AUTH_TOKEN",
  "accept": "application/json",
  "Content-Type": "application/json"
}

Request Body Parameters

ParameterTypeDescription
user_idstringUnique identifier for the user
phone_numberstringUser's phone number
session_typestringType of session to create
originstringOrigin of the request
send_notificationstringWhether to send notification
link_typestringType of link to send
extrasobjectAdditional parameters

Example Request

curl -X POST "https://<BASE-URL>/agentapi/v1/agent/sendLink/" \
  -H "auth: YOUR_AUTH_TOKEN" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "",
    "phone_number": "",
    "session_type": "",
    "origin": "",
    "send_notification": "",
    "link_type": "",
    "extras": {}
  }'

Get Session Details

Retrieve details about a specific session.

GET https://<BASE-URL>/agentapi/v1/session/get_details/{session_id}

Request Headers

{
  "auth": "YOUR_AUTH_TOKEN",
  "accept": "application/json"
}

Path Parameters

ParameterTypeDescription
session_idstringThe ID of the session to retrieve

Example Request

curl -X GET "https://<BASE-URL>/agentapi/v1/session/get_details/YOUR_SESSION_ID" \
  -H "auth: YOUR_AUTH_TOKEN" \
  -H "accept: application/json"

Environment Variables

For easier environment management, consider using environment variables in your application:

# UAT Environment
KWIKID_API_URL=https://<YOUR-DOMAIN>.test.getkwikid.com
 
# Production Environment
KWIKID_API_URL=https://<YOUR-DOMAIN>.app.getkwikid.com

Error Handling

All endpoints may return the following HTTP status codes:

Status CodeDescription
200Success
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Security Considerations

  1. Always store authentication credentials securely
  2. Use HTTPS for all API calls
  3. Implement proper error handling
  4. Don't expose authentication tokens in client-side code
  5. Implement rate limiting in your applications
  6. Use appropriate credentials for each environment
  7. Never use production credentials in UAT environment

Best Practices

  1. Cache authentication tokens appropriately
  2. Implement retry logic with exponential backoff
  3. Log all API interactions for debugging
  4. Validate all input before sending to the API
  5. Keep your integration code modular and maintainable
  6. Test thoroughly in UAT before moving to production
  7. Use environment variables to manage different endpoint URLs
  8. Implement proper error handling for each environment

Environment-Specific Configurations

Create separate configuration files for each environment:

// config.js
const config = {
  uat: {
    baseUrl: 'https://<YOUR-DOMAIN>.test.getkwikid.com',
    timeout: 30000,
    retryAttempts: 3
  },
  production: {
    baseUrl: 'https://<YOUR-DOMAIN>.app.getkwikid.com',
    timeout: 15000,
    retryAttempts: 5
  }
};