API for Paid and UnPaid Days of user in uKnowva

User Rating:  / 0
PoorBest 

Description:

This document gives detailed information about How to add paid and unpaid days of users via API. Records are imported with 500 max records by default, this max records can be changed from configuration.

If any previous record exists for the user then that record will be updated with the new values.

 

API EndPoint:

  1. Sample endpoint: https://mukul.uknowva-stage.in/api.php/attendance/attendancedb/pushUsersPaidUnPaidDays
  2. Your endpoint:https://<your_instance>/api.php/attendance/attendancedb/pushUsersPaidUnPaidDays  

Bearer Token: It will be shared personally over the email

Method Type: POST

 

Mandatory Fields:

“month”, 

“year”, 

“Paid_days”,

“username” are the mandatory fields which will return errors otherwise.

 

Payload:

{ 
   “test” : { // Username Mandatory
     “month”: 3, // Month Mandatory
     “year”: 2000, // Year Mandatory
     “username”: “test”, // Username Mandatory
     “days_in_month”: 30, //Days in Month Non-Mandatory
     “paid_days”: 24, // Paid days Mandatory
     “unpaid_days”: 7 // Unpaid days Non-Mandatory
   },
   “test1” : { // Username Mandatory
     “month”: 3, // Month Mandatory
     “year”: 2000, // Year Mandatory
     “username”: “test”, // Username Mandatory
     “days_in_month”: 30, // Days in Month Non-Mandatory
     “paid_days”: 24, // Paid days Mandatory
     “unpaid_days”: 7 // Unpaid days Non-Mandatory
   }
}

Sample CURL:

curl --location 'https://<your_instance>/api.php/attendance/attendancedb/pushUsersPaidUnPaidDays' \

--header 'Authorization: provided_token\

--header 'Content-Type: application/json' \

--data '

{
   "test": {
     "month": 3,
     "year": 2000,
     "username": "test",
     "days_in_month": 30,
     "paid_days": 24,
     "unpaid_days": 7
   },
   “test1” : {
     “month”: 3,
     “year”: 2000,
     “username”: “test1”,
     “days_in_month”: 30,
     “paid_days”: 24,
     “unpaid_days”: 7
   }
}

'

 

Responses:

  1. All records imported successfully” for successfully importing all the records.
  2. Bearer Token is not correct.” when the token is wrong.
  3. No Data Present” when no data is sent.
  4. Records count is <the_data> which is greater than allowed records <record_set_in_config>” when records to be imported are greater than the set records.
  5. No User found  with the provided <biometric_code> - <username>” when the API has different biometric code then the set biometric code set in config.
  6. Either month or year not found for the - <username>” when no month and year are sent in the API.
  7. Either month or year are in the wrong format, Please enter in number for - <username>” when the month or year is not present in numeric form.
  8. Please provide the number of paid days for - <username>” when the paid days are not provided.
  9. Error in saving data for <config_biometric_code> - <username>” when some mandatory fields or columns are not given while saving the data.
Was this Article helpful?