Work History Service

The WorkHistory Service provides the Work History registered in the IMSS (Social Security Mexican Institute). Allowing to know first-hand the companies and the time that a resource has worked with them. In addition to the salary registered with the Mexican authority and dates of registers and recessions of contract.

Work History by NSS

This method obtains the information related with Work History in the IMSS (Social Security Mexican Institute) throw the CURP (Single Population Registry Code) and NSS (Social Security Number) of the person.

~/api/WorkHistory/workhistory

Headers

Tag Type Required Description
apikey string yes Customer key.

Parameters FormData

Tag Type Required Description
CURP String Yes Clave Única de Registro de Población.
NSS String Yes Número de Seguridad Social.

200 Success

{
  "valid": true,
  "data": {
    "success": true,
    "verificationId": "string",
    "generaldata": {
      "workHistory": [
        {
          "employerName": "string",
          "employerIdNumber": "string",
          "state": "string",
          "dateRegistration": "2023-04-28T15:02:29.018Z",
          "dateTermination": "2023-04-28T15:02:29.018Z",
          "baseSalary": 0.00,
          "movements": [
            {
              "typeMovement": "string",
              "dateMovement": "2023-04-28T15:02:29.018Z",
              "baseSalary": 0.00
            }
          ]
        }
      ],
      "quotationweeks": {
        "quotedWeeks": 0,
        "discountedWeeks": 0,
        "reintegratedWeeks": 0
      },
      "employeeName": "string",
      "dateInsurance": "2023-04-28T15:02:29.019Z",
      "numberQuotationWeeks": 0,
      "nss": "string",
      "curp": "string",
    }
  },
   "warnings": []
}
Response:
Name Type Description
Correct:
valid boolean true: Data was found, false: Data was not found.
data
success: boolean true: The request was done.
verificationId: Guid String Number Ticket assigned for information request.
generaldata
workHistory: Array Work History information (if avaliable) (Employer, Registration Date, Termination Date, Salary Base)
quotationweeks: Array Quotation weeks related information (if avaliable)
employeeName: string Name of the Work History owner.
dateInsurance: boolean Date on which the request for information was made.
numberQuotationWeeks: integer Quotations Weeks reported to the IMSS

200 NotFound

When the information was not found in the source of verification. The CURP and the NSS maybe were not valids.

{
  "valid": false,
  "data": {
    "success": true,
    "verificationId": "string",
    "generaldata": null
  },
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "fullMessage": "string"
    }
  ]
}
200 NotFound Example of json response
{
  "valid": false,
  "data": {
    "success": true,
    "verificationId": "8f2cabb2-b809-4f15-8b6d-857c4568b10b",
    "generaldata": null
  },
  "warnings": [
    {
      "code": "WH007",
      "message": "There is no Work History information for CURP, NSS in the source of verification. Please review the search information.",
      "fullMessage": "WH007: There is no Work History information for CURP, NSS in the source of verification. Please review the search information."
    }
  ]
}

202 Accepted

The request made, may take longer than normal, so if it were the case a 202 code be response (Accepted). The verification id will be returned.

The next step should be to call ~api/workhistoy/verificationstatus with the verificationId parameter, leaving a time lapse between retries, to allow the information to be available.

{
 "verificationId": "string",
  "code": "string",
  "message": "string",
  "fullMessage": "string"
}
202 Example of json response
{
  "verificationId": "763d6019-d40b-490b-8b94-478cc53db3db",
  "code": "WH004",
  "message": "Data is not available yet, please try again with VerificationStatus",
  "fullMessage": "WH004: Data is not available yet, please try again with VerificationStatus"
}

Error (400,401,500)

{
  "code": "string",
  "message": "string",
  "fullMessage": "string"
}
Example of json response Error
{
  "code": "WH006",
  "message": "The VerificationId is invalid or not found",
  "fullMessage": "WH006: The VerificationId is invalid or not found"
}

Verification Status

This method obtains the information that was pending from a request made to the Work History Service previously, using the verificationId parameter.

~/api/WorkHistory/verificationstatus

Headers

Tag Type Required Description
apikey string yes Customer key.

Parameters FormData

Tag Type Required Description
verificationId GUID String Yes Ticket returned by Work history Service, in case of delay in the information.

200 Success

{
  "valid": true,
  "data": {
    "success": true,
    "verificationId": "string",
    "generaldata": {
      "workHistory": [
        {
          "employerName": "string",
          "employerIdNumber": "string",
          "state": "string",
          "dateRegistration": "2023-04-28T15:02:29.018Z",
          "dateTermination": "2023-04-28T15:02:29.018Z",
          "baseSalary": 0.00,
          "movements": [
            {
              "typeMovement": "string",
              "dateMovement": "2023-04-28T15:02:29.018Z",
              "baseSalary": 0.00
            }
          ]
        }
      ],
      "quotationweeks": {
        "quotedWeeks": 0,
        "discountedWeeks": 0,
        "reintegratedWeeks": 0
      },
      "employeeName": "string",
      "dateInsurance": "2023-04-28T15:02:29.019Z",
      "numberQuotationWeeks": 0,
      "nss": "string",
      "curp": "string"
    }
  },
   "warnings": []
}
Response:
Name Type Description
Correct:
valid boolean true: Data was found, false: Data was not found.
data
success: boolean true: The request was finishing.
verificationId: Guid String Number Ticket assigned for information request.
generaldata
workHistory: Array Work History information (if avaliable) (Employer, Registration Date, Termination Date, Salary Base)
quotationweeks: Array Quotation weeks related information (if avaliable)
employeeName: string Name of the Work History owner.
dateInsurance: boolean Date on which the request for information was made.
numberQuotationWeeks: integer Quotations Weeks reported to the IMSS

200 NotFound

When the information was not found in the source of verification. The CURP and the NSS maybe were not valids.

{
  "valid": false,
  "data": {
    "success": true,
    "verificationId": "string",
    "generaldata": null
  },
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "fullMessage": "string"
    }
  ]
}
200 NotFound Example of json response
{
  "valid": false,
  "data": {
    "success": true,
    "verificationId": "8f2cabb2-b809-4f15-8b6d-857c4568b10b",
    "generaldata": null
  },
  "warnings": [
    {
      "code": "WH007",
      "message": "There is no Work History information for CURP, NSS in the source of verification. Please review the search information.",
      "fullMessage": "WH007: There is no Work History information for CURP, NSS in the source of verification. Please review the search information."
    }
  ]
}

202 Accepted

The information may not be avalaible yet, so if it were the case a 202 response (Accepted) will be returned.

{
  "verificationId": "string",
  "code": "string",
  "message": "string",
  "fullMessage": "string"
}
202 Example of json response
{
  "verificationId": "763d6019-d40b-490b-8b94-478cc53db3db",
  "code": "WH004",
  "message": "Data is not available yet, please try again with VerificationStatus",
  "fullMessage": "WH004: Data is not available yet, please try again with VerificationStatus"
}

Error (400,401,500)

{
  "code": "string",
  "message": "string",
  "fullMessage": "string"
}
Example of json response
{
  "code": "WH006",
  "message": "The VerificationId is invalid or not found",
  "fullMessage": "WH006: The VerificationId is invalid or not found"
}

Service messages

Code Message Description
WH001 The WorkHistory Service has not avaliable.
WH002/WH003/WH005 Fail to get the WorkHistory.
WH004 Data is not available yet, please try again with VerificationStatus.
WH006 The VerificationId is invalid or not found.
WH007 There is no Work History information for CURP, NSS in the source of verification. Please review the search information.
WH008 There are no listed weeks, it does not present history at IMSS.
WH014 CURP or NSS parameters have invalid structure.