Job Creation API

Description 

 

This document gives detailed information about How to create a job via API. Through this API job will be created in the uKnowva System. All the required validations are there before the job is created in the uKnowva System.

 

Note: The job title should be configured in the designation master.

 


API Endpoint

https://<your_instance>/api.php/recruitment/jobportalapi/createJob

Bearer Token 

 

Please refer to the token generation documentation for generating API tokens to invoke uKnowva APIs. (Token Generation Docs)

 

Method Type

 

  •  POST

Mandatory Fields

“job_title”,“job_description”,“skills_keywords”

Non-Mandatory Fields

“job_num_positions”,“job_type”,“job_country”,“job_location”,“job_requirement”,“experience”,“education”,“job_salary”,“expiry_date”,“job_duties”,“allowed_sources”,“visible_to”

Example Request


cURL

curl --location 
'https://<your_instance>/api.php/recruitment/jobportalapi/createJob' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token'\
--data-raw '{
 "company": "uKnowva",
"job_category": "Computer and Information Technology",
"job_title": "UI/UX Designer",
"job_type": 1,
"job_num_postions": 1,
"job_country": "India",
"job_location": "Mumbai",
"job_requirement": "new",
"experience": 3,
"education": "2",
"skills_keywords": ".Net, Array",
"job_salary": 100000,
"expiry_date": "2024-01-20",
"job_description": "Test JD",
"job_duties": "Test Job Duties",
"allowed_sources": "linkedin, Facebook",
"visible_to": 2,
"approved_by": "uKnowva",
"assigned_to": "This email address is being protected from spambots. You need JavaScript enabled to view it., testUser2"
}'

PHP Code Snippet

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<your_instance>/api.php/recruitment/jobportalapi/createJob',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "company": "uKnowva",
    "job_category": "Computer and Information Technology",
    "job_title": "UI/UX Designer",
    "job_type": 1,
    "job_num_postions": 1,
    "job_country": "India",
    "job_location": "Mumbai",
    "job_requirement": "new",
    "experience": 3,
    "education": "2",
    "skills_keywords": ".Net, Array",
    "job_salary": 100000,
    "expiry_date": "2024-01-20",
    "job_description": "Test JD",
    "job_duties": "Test Job Duties",
    "allowed_sources": "linkedin, Facebook",
    "visible_to": 2,
    "approved_by": "uKnowva",
    "assigned_to": "This email address is being protected from spambots. You need JavaScript enabled to view it., testUser2"
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer Token'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Python Code Snippet

import requests
import json

url = "https://<your_instance>/api.php/recruitment/jobportalapi/createJob"

payload = json.dumps({
  "company": "uKnowva",
  "job_category": "Computer and Information Technology",
  "job_title": "UI/UX Designer",
  "job_type": 1,
  "job_num_postions": 1,
  "job_country": "India",
  "job_location": "Mumbai",
  "job_requirement": "new",
  "experience": 3,
  "education": "2",
  "skills_keywords": ".Net, Array",
  "job_salary": 100000,
  "expiry_date": "2024-01-20",
  "job_description": "Test JD",
  "job_duties": "Test Job Duties",
  "allowed_sources": "linkedin, Facebook",
  "visible_to": 2,
  "approved_by": "uKnowva",
  "assigned_to": "This email address is being protected from spambots. You need JavaScript enabled to view it., testUser2"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer Token'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Java Code Snippet

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{    "company": "uKnowva",    "job_category": "Computer and Information Technology",    "job_title": "UI/UX Designer",    "job_type": 1,    "job_num_postions": 1,    "job_country": "India",    "job_location": "Mumbai",    "job_requirement": "new",    "experience": 3,    "education": "2",    "skills_keywords": ".Net, Array",    "job_salary": 100000,    "expiry_date": "2024-01-20",    "job_description": "Test JD",    "job_duties": "Test Job Duties",    "allowed_sources": "linkedin, Facebook",    "visible_to": 2,    "approved_by": "uKnowva",    "assigned_to": "This email address is being protected from spambots. You need JavaScript enabled to view it., testUser2"}");
Request request = new Request.Builder()
  .url("https://<your_instance>/api.php/recruitment/jobportalapi/createJob")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer Token")
  .build();
Response response = client.newCall(request).execute();

Payload

{
    "company": "uKnowva",
    "job_category": "Computer and Information Technology",
    "job_title": "UI/UX Designer",
    "job_type": 1,
    "job_num_postions": 1,
    "job_country": "India",
    "job_location": "Mumbai",
    "job_requirement": "new",
    "experience": 3,
    "education": "2",
    "skills_keywords": ".Net, Array",
    "job_salary": 100000,
    "expiry_date": "2024-01-20",
    "job_description": "Test JD",
    "job_duties": "Test Job Duties",
    "allowed_sources": "linkedin, Facebook",
    "visible_to": 2,
    "approved_by": "uKnowva",
    "assigned_to": "This email address is being protected from spambots. You need JavaScript enabled to view it., testUser2"
} 

Sample Response


  • Success
  1. “Bearer token is not correct” when you have invalid bearer token.
  2. “Job Title is empty” when you have an empty job title.
  3. “Job Description is empty” when the job description is sent empty.
  4. “Skills & Keywords are empty” when skills & keywords (tags) are sent empty.
  5. “Invalid Job Category” wwhen a job category is sent but it is invalid or not found with the present job categories table.
  6. “Country not found” when a country is sent but is invalid or not found in the present countries table.
  7. “Allowed source not found” when the allowed sources are sent but the source sent is not present in the allowed source table.
  8. “Invalid Job title” when the job title is not present in the designation master table.
  9. “Invalid Job type”” when the job type is sent but not present in the types table, if sent empty then it is a full-time job.
  10. “Invalid Job Career level” when experience is sent but not present in the career table.
  11. Invalid Job Education” when education provided is sent but not valid with the present education table.
  12. “Tags are not valid” when comma separated tags are sent but are invalid with the present tags table.
  13. “Invalid Username or Email” when the approved by and assigned to has invalid username or email address.
  14. “All and Only Internal (Not visible on career page) only allowed” when visible to have more value greater than 2 as only “All” and “Only Internal (Not visible on career page)” is allowed.
  15. “Some Allowed source not found” when the comma separated allowed sources are sent but the source sent is not present in the allowed source table.
  16. “Only one approver allowed” can have only one approver.
  17. “Invalid Username or Email for Assigned To for <username_or_email>” when the job is created successfully in uKnowva.
  18. “Job Created Successfully” when comma separated assigned to have invalid username or email.
  19. “Number of positions cannot be negative or zero” when the number of positions sent is negative or zero.

Sample Collection

Download Job Creation API Collection

In case you face any problems, then please write to This email address is being protected from spambots. You need JavaScript enabled to view it., our awesome support team will surely help you!