TPM Workforce API

Comprehensive documentation for using TPM Workforce API endpoints and features.

Authentication

All requests must be authenticated using a signature in the X-Signature header and domain_url in the origin header.

X-Signature: <signature_here>
origin: <domain_url>

Response Codes

HTTP Status Condition Response Body
200 OK / Success Returns the requested data.
401 Unauthorized – invalid or missing auth {"error": "Unauthorized Request"}
404 Not Found – resource not found {"error": "Applicant not found"}
422 Validation Error {"errors": { ... }}

API Endpoints

POST

/api/workforce/job-applicant-hired

Mark a job application as hired.

Request

POST /api/workforce/job-applicant-hired
          Content-Type: application/json
          X-Signature: <signature_here>
          origin: <domain_url>

          {
            "job_application_id": "12345",
            "time_stamp": "2025-09-18T12:34:56+05:30"
          }
        

Response

{
          "status": "received"
        }
GET

/api/workforce/getAllApplicants

Retrieve all applicants for the company.

Request

GET /api/workforce/getAllApplicants?company_id=6789
          X-Signature: <signature_here>
        origin: <domain_url>

Response

{
          "success": true,
          "data": [
          {
            "application_id": "12345",
            "application_status": "pending",
            "user_id": "54321",
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@example.com",
            "job_title": "Backend Developer"
          },
          {
            "application_id": "12346",
            "application_status": "hired",
            "user_id": "54322",
            "first_name": "Jane",
            "last_name": "Smith",
            "email": "jane@example.com",
            "job_title": "Frontend Developer"
          }
          ]
        }
GET

/api/workforce/getApplicationDetails

Get detailed info about a specific applicant.

Request

GET /api/workforce/getApplicationDetails
          Headers:
          application_id: 12345
          company_id: 6789
          X-Signature: <signature_here>
        origin: <domain_url>

Response

{
          "success": true,
          "data": {
            "applicant_id": "54321",
            "application_id": "12345",
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@example.com",
            "mobile": "1234567890",
            "address": "123 Street",
            "country": "CountryName",
            "state": "StateName",
            "city": "CityName",
            "zipcode": "123456",
            "job_title": "Backend Developer",
            "job_country": "CountryName",
            "job_state": "StateName",
            "job_city": "CityName",
            "job_zipcode": "123456",
            "accepted_at": "2025-09-18T12:45:00+05:30"
          }
        }
GET

/api/workforce/live-status

Check if the API is live and able to fetch data.

Request

GET /api/workforce/live-status
          X-Signature: <signature_here>
        origin: <domain_url>

Response (Live)

{
          "success": true,
          "status": "live",
          "message": "API is live and data fetching is working"
        }

Response (Non-live/Error)

{
          "success": false,
          "status": "non-live",
          "message": "API is down or data fetching failed: <error message>"
        }