node-behind-api-client 2.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +20 -0
- package/README.md +65 -0
- package/docs/behind-api-client/easyjob/JobDescriptions/README.md +654 -0
- package/docs/behind-api-client/easyjob/README.md +647 -0
- package/docs/behind-api-client/easyjob/applicants/README.md +494 -0
- package/docs/behind-api-client/easyjob/applications/README.md +754 -0
- package/docs/behind-api-client/easyjob/candidateProfiles/README.md +940 -0
- package/docs/behind-api-client/easyjob/jd-candidate-questions/README.md +372 -0
- package/docs/behind-api-client/payments/payture/README.21.md +901 -0
- package/docs/behind-api-client/payments/payture/README.cards.md +1497 -0
- package/docs/behind-api-client/payments/payture/README.md +1497 -0
- package/docs/behind-api-client/payments/payture/README.rukitchen.md +396 -0
- package/docs/behind-api-client/payments/payture/README.subscriptions.md +1266 -0
- package/docs/behind-api-client/payments/stripe/README.flow.md +254 -0
- package/docs/behind-api-client/rag/storage/README.md +519 -0
- package/example.js +35 -0
- package/index.cjs +14 -0
- package/index.js +15 -0
- package/lib/behind-api-auth-client/BehindApiAuthClient.js +91 -0
- package/lib/behind-api-auth-client/authorisation/AuthorisationApp.js +9 -0
- package/lib/behind-api-auth-client/authorisation/AuthorisationV10.js +9 -0
- package/lib/behind-api-auth-client/authorisation/AuthorisationV10Code.js +30 -0
- package/lib/behind-api-auth-client/example.js +47 -0
- package/lib/behind-api-auth-client/package.json +9 -0
- package/lib/behind-api-client/BehindApiClient.js +137 -0
- package/lib/behind-api-client/chat/ChatApp.js +11 -0
- package/lib/behind-api-client/chat/ChatV10.js +13 -0
- package/lib/behind-api-client/chat/ChatV10Chat.js +87 -0
- package/lib/behind-api-client/chat/ChatV10Chats.js +14 -0
- package/lib/behind-api-client/chat/ChatV10Message.js +57 -0
- package/lib/behind-api-client/chat/ChatV20.js +11 -0
- package/lib/behind-api-client/chat/ChatV20Chat.js +14 -0
- package/lib/behind-api-client/chat/ChatV20Message.js +27 -0
- package/lib/behind-api-client/easyjob/EasyjobApp.js +9 -0
- package/lib/behind-api-client/easyjob/EasyjobV10.js +31 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Answers.js +16 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Applicants.js +29 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Applications.js +39 -0
- package/lib/behind-api-client/easyjob/EasyjobV10CandidateProfileArtifacts.js +31 -0
- package/lib/behind-api-client/easyjob/EasyjobV10CandidateProfiles.js +99 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Companies.js +36 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Cv.js +15 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Departments.js +37 -0
- package/lib/behind-api-client/easyjob/EasyjobV10JobDescriptionArtifacts.js +29 -0
- package/lib/behind-api-client/easyjob/EasyjobV10JobDescriptionCandidateQuestions.js +63 -0
- package/lib/behind-api-client/easyjob/EasyjobV10JobDescriptions.js +93 -0
- package/lib/behind-api-client/easyjob/EasyjobV10Reports.js +35 -0
- package/lib/behind-api-client/example.js +47 -0
- package/lib/behind-api-client/global/GlobalApp.js +9 -0
- package/lib/behind-api-client/global/GlobalV10.js +11 -0
- package/lib/behind-api-client/global/GlobalV10Sockets.js +16 -0
- package/lib/behind-api-client/global/GlobalV10Storage.js +29 -0
- package/lib/behind-api-client/gpt/GptApp.js +15 -0
- package/lib/behind-api-client/gpt/GptV10.js +15 -0
- package/lib/behind-api-client/gpt/GptV10Prompt.js +17 -0
- package/lib/behind-api-client/gpt/GptV10Request.js +16 -0
- package/lib/behind-api-client/gpt/GptV10Storedprompts.js +14 -0
- package/lib/behind-api-client/gpt/GptV10Whisper.js +23 -0
- package/lib/behind-api-client/gpt/GptV20.js +9 -0
- package/lib/behind-api-client/gpt/GptV20Prompt.js +15 -0
- package/lib/behind-api-client/gpt/GptV30.js +13 -0
- package/lib/behind-api-client/gpt/GptV30Chat.js +19 -0
- package/lib/behind-api-client/gpt/GptV30Prompt.js +41 -0
- package/lib/behind-api-client/gpt/GptV30Prompts.js +32 -0
- package/lib/behind-api-client/gpt/GptV40.js +11 -0
- package/lib/behind-api-client/gpt/GptV40Prompt.js +24 -0
- package/lib/behind-api-client/gpt/GptV40Prompts.js +30 -0
- package/lib/behind-api-client/mailer/MailerApp.js +11 -0
- package/lib/behind-api-client/mailer/MailerV10.js +15 -0
- package/lib/behind-api-client/mailer/MailerV10Bulk.js +21 -0
- package/lib/behind-api-client/mailer/MailerV10Message.js +83 -0
- package/lib/behind-api-client/mailer/MailerV10Settings.js +44 -0
- package/lib/behind-api-client/mailer/MailerV10Template.js +23 -0
- package/lib/behind-api-client/mailer/MailerV20.js +9 -0
- package/lib/behind-api-client/mailer/MailerV20Message.js +21 -0
- package/lib/behind-api-client/mastogram/MastogramApp.js +9 -0
- package/lib/behind-api-client/mastogram/MastogramV10.js +13 -0
- package/lib/behind-api-client/mastogram/MastogramV10Bluesky.js +42 -0
- package/lib/behind-api-client/mastogram/MastogramV10Mastodon.js +45 -0
- package/lib/behind-api-client/mastogram/MastogramV10Telegram.js +39 -0
- package/lib/behind-api-client/monitor/MonitorApp.js +9 -0
- package/lib/behind-api-client/monitor/MonitorV10.js +13 -0
- package/lib/behind-api-client/monitor/MonitorV10Finances.js +39 -0
- package/lib/behind-api-client/monitor/MonitorV10Record.js +15 -0
- package/lib/behind-api-client/monitor/MonitorV10Records.js +22 -0
- package/lib/behind-api-client/oauth/OauthApp.js +9 -0
- package/lib/behind-api-client/oauth/OauthV10.js +9 -0
- package/lib/behind-api-client/oauth/OauthV10Authorisation.js +15 -0
- package/lib/behind-api-client/package.json +9 -0
- package/lib/behind-api-client/payments/PaymentsApp.js +13 -0
- package/lib/behind-api-client/payments/PaymentsV10.js +15 -0
- package/lib/behind-api-client/payments/PaymentsV10Gift.js +32 -0
- package/lib/behind-api-client/payments/PaymentsV10Payture.js +30 -0
- package/lib/behind-api-client/payments/PaymentsV10Product.js +15 -0
- package/lib/behind-api-client/payments/PaymentsV10Telegram.js +44 -0
- package/lib/behind-api-client/payments/PaymentsV20.js +9 -0
- package/lib/behind-api-client/payments/PaymentsV20Payture.js +32 -0
- package/lib/behind-api-client/payments/PaymentsV21.js +15 -0
- package/lib/behind-api-client/payments/PaymentsV21Cards.js +14 -0
- package/lib/behind-api-client/payments/PaymentsV21Payture.js +29 -0
- package/lib/behind-api-client/payments/PaymentsV21Stripe.js +28 -0
- package/lib/behind-api-client/payments/PaymentsV21Subscriptions.js +21 -0
- package/lib/behind-api-client/questionnaire/QuestionnaireApp.js +9 -0
- package/lib/behind-api-client/questionnaire/QuestionnaireV10.js +9 -0
- package/lib/behind-api-client/questionnaire/QuestionnaireV10Form.js +22 -0
- package/lib/behind-api-client/raet/RaetApp.js +11 -0
- package/lib/behind-api-client/raet/RaetV10.js +21 -0
- package/lib/behind-api-client/raet/RaetV10Cv.js +87 -0
- package/lib/behind-api-client/raet/RaetV10Individual.js +43 -0
- package/lib/behind-api-client/raet/RaetV10Individuals.js +38 -0
- package/lib/behind-api-client/raet/RaetV10Jd.js +47 -0
- package/lib/behind-api-client/raet/RaetV10Project.js +61 -0
- package/lib/behind-api-client/raet/RaetV10Projects.js +14 -0
- package/lib/behind-api-client/raet/RaetV10Report.js +39 -0
- package/lib/behind-api-client/raet/RaetV20.js +11 -0
- package/lib/behind-api-client/raet/RaetV20Cv.js +31 -0
- package/lib/behind-api-client/raet/RaetV20Individuals.js +25 -0
- package/lib/behind-api-client/rag/RagApp.js +9 -0
- package/lib/behind-api-client/rag/RagV10.js +9 -0
- package/lib/behind-api-client/rag/RagV10Storage.js +27 -0
- package/lib/behind-api-client/ruKitchen/RuKitchenApp.js +9 -0
- package/lib/behind-api-client/ruKitchen/RuKitchenV10.js +11 -0
- package/lib/behind-api-client/ruKitchen/RuKitchenV10Importer.js +29 -0
- package/lib/behind-api-client/ruKitchen/RuKitchenV10SeoArticle.js +14 -0
- package/lib/behind-api-client/sales/SalesApp.js +11 -0
- package/lib/behind-api-client/sales/SalesV10.js +23 -0
- package/lib/behind-api-client/sales/SalesV10Catalogue.js +58 -0
- package/lib/behind-api-client/sales/SalesV10Categories.js +15 -0
- package/lib/behind-api-client/sales/SalesV10Companies.js +55 -0
- package/lib/behind-api-client/sales/SalesV10Company.js +120 -0
- package/lib/behind-api-client/sales/SalesV10Group.js +70 -0
- package/lib/behind-api-client/sales/SalesV10Groups.js +21 -0
- package/lib/behind-api-client/sales/SalesV10Logs.js +14 -0
- package/lib/behind-api-client/sales/SalesV10Notes.js +38 -0
- package/lib/behind-api-client/sales/SalesV20.js +11 -0
- package/lib/behind-api-client/sales/SalesV20Companies.js +26 -0
- package/lib/behind-api-client/sales/SalesV20Notes.js +17 -0
- package/lib/behind-api-client/sip/SipApp.js +9 -0
- package/lib/behind-api-client/sip/SipV10.js +15 -0
- package/lib/behind-api-client/sip/SipV10Call.js +83 -0
- package/lib/behind-api-client/sip/SipV10Phone.js +44 -0
- package/lib/behind-api-client/sip/SipV10Transcript.js +21 -0
- package/lib/behind-api-client/sip/SipV10Transcripts.js +21 -0
- package/lib/behind-api-client/storage/StorageApp.js +9 -0
- package/lib/behind-api-client/storage/StorageV10.js +11 -0
- package/lib/behind-api-client/storage/StorageV10File.js +35 -0
- package/lib/behind-api-client/storage/StorageV10Upload.js +21 -0
- package/lib/behind-api-client/tests/TestsApp.js +9 -0
- package/lib/behind-api-client/tests/TestsV10.js +15 -0
- package/lib/behind-api-client/tests/TestsV10Cases.js +29 -0
- package/lib/behind-api-client/tests/TestsV10CasesExtended.js +14 -0
- package/lib/behind-api-client/tests/TestsV10Core.js +14 -0
- package/lib/behind-api-client/tests/TestsV10Mail.js +14 -0
- package/lib/behind-api-client/tools/ToolsApp.js +9 -0
- package/lib/behind-api-client/tools/ToolsV10.js +9 -0
- package/lib/behind-api-client/tools/ToolsV10Pdf.js +30 -0
- package/package.json +25 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
# Job Description Candidate Questions API Extension
|
|
2
|
+
|
|
3
|
+
This document extends the main EasyJob JavaScript API Client Documentation with detailed information about the Job Description Candidate Questions API methods.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Job Description Candidate Questions API allows you to manage custom questions that can be asked to candidates applying for specific job positions. These questions can be categorized and weighted based on their importance to the hiring process.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Job Description Candidate Questions API
|
|
12
|
+
|
|
13
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.create(jobDescriptionId, question, type, weight, category)
|
|
14
|
+
Creates a new candidate question for a job description.
|
|
15
|
+
|
|
16
|
+
**Parameters:**
|
|
17
|
+
- `jobDescriptionId` (string, required) - The job description UUID where the question belongs
|
|
18
|
+
- `question` (string, required) - The question text
|
|
19
|
+
- `type` (string, required) - The question type. Valid values: `"binary_check"`, `"open_response"`, `"short_answer"`, `"integer"`
|
|
20
|
+
- `weight` (integer, required) - The question weight (numeric value indicating importance)
|
|
21
|
+
- `category` (string, required) - The question category. Valid values: `"custom"`, `"basic"`
|
|
22
|
+
|
|
23
|
+
**Usage:**
|
|
24
|
+
```javascript
|
|
25
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.create(
|
|
26
|
+
"770e8400-e29b-41d4-a716-446655440002",
|
|
27
|
+
"How many years of experience do you have with React?",
|
|
28
|
+
"integer",
|
|
29
|
+
5,
|
|
30
|
+
"custom"
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// Response:
|
|
34
|
+
{
|
|
35
|
+
success: true,
|
|
36
|
+
data: {
|
|
37
|
+
question_id: "cc0e8400-e29b-41d4-a716-446655440007"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.delete(questionId)
|
|
43
|
+
Deletes a specific candidate question by its ID.
|
|
44
|
+
|
|
45
|
+
**Parameters:**
|
|
46
|
+
- `questionId` (string, required) - The question UUID to delete
|
|
47
|
+
|
|
48
|
+
**Usage:**
|
|
49
|
+
```javascript
|
|
50
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.delete("cc0e8400-e29b-41d4-a716-446655440007");
|
|
51
|
+
|
|
52
|
+
// Response:
|
|
53
|
+
{
|
|
54
|
+
success: true
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.deleteAll(jobDescriptionId)
|
|
59
|
+
Deletes all candidate questions for a specific job description.
|
|
60
|
+
|
|
61
|
+
**Parameters:**
|
|
62
|
+
- `jobDescriptionId` (string, required) - The job description UUID to delete all questions for
|
|
63
|
+
|
|
64
|
+
**Usage:**
|
|
65
|
+
```javascript
|
|
66
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.deleteAll("770e8400-e29b-41d4-a716-446655440002");
|
|
67
|
+
|
|
68
|
+
// Response:
|
|
69
|
+
{
|
|
70
|
+
success: true
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getList(jobDescriptionId)
|
|
75
|
+
Retrieves all candidate questions for a specific job description.
|
|
76
|
+
|
|
77
|
+
**Parameters:**
|
|
78
|
+
- `jobDescriptionId` (string, required) - The job description UUID to get questions for
|
|
79
|
+
|
|
80
|
+
**Usage:**
|
|
81
|
+
```javascript
|
|
82
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getList("770e8400-e29b-41d4-a716-446655440002");
|
|
83
|
+
|
|
84
|
+
// Response:
|
|
85
|
+
{
|
|
86
|
+
success: true,
|
|
87
|
+
data: [
|
|
88
|
+
{
|
|
89
|
+
question_id: "cc0e8400-e29b-41d4-a716-446655440007",
|
|
90
|
+
job_description_id: "770e8400-e29b-41d4-a716-446655440002",
|
|
91
|
+
question: "How many years of experience do you have with React?",
|
|
92
|
+
type: "integer",
|
|
93
|
+
weight: 5,
|
|
94
|
+
category: "custom",
|
|
95
|
+
created_at: "2024-01-15T10:30:00Z",
|
|
96
|
+
updated_at: "2024-01-15T10:30:00Z"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getByCategory(jobDescriptionId, category)
|
|
103
|
+
Retrieves candidate questions for a specific job description filtered by category.
|
|
104
|
+
|
|
105
|
+
**Parameters:**
|
|
106
|
+
- `jobDescriptionId` (string, required) - The job description UUID to get questions for
|
|
107
|
+
- `category` (string, required) - The category to filter by. Valid values: `"general"`, `"custom"`, `"basic"`
|
|
108
|
+
|
|
109
|
+
**Usage:**
|
|
110
|
+
```javascript
|
|
111
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getByCategory(
|
|
112
|
+
"770e8400-e29b-41d4-a716-446655440002",
|
|
113
|
+
"custom"
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// Response:
|
|
117
|
+
{
|
|
118
|
+
success: true,
|
|
119
|
+
data: [
|
|
120
|
+
{
|
|
121
|
+
question_id: "cc0e8400-e29b-41d4-a716-446655440007",
|
|
122
|
+
job_description_id: "770e8400-e29b-41d4-a716-446655440002",
|
|
123
|
+
question: "How many years of experience do you have with React?",
|
|
124
|
+
type: "integer",
|
|
125
|
+
weight: 5,
|
|
126
|
+
category: "custom",
|
|
127
|
+
created_at: "2024-01-15T10:30:00Z",
|
|
128
|
+
updated_at: "2024-01-15T10:30:00Z"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.edit(questionId, text, weight)
|
|
135
|
+
Edits an existing candidate question.
|
|
136
|
+
|
|
137
|
+
**Parameters:**
|
|
138
|
+
- `questionId` (string, required) - The question UUID to edit
|
|
139
|
+
- `text` (string, optional) - The new question text
|
|
140
|
+
- `weight` (integer, optional) - The new question weight
|
|
141
|
+
|
|
142
|
+
**Usage:**
|
|
143
|
+
```javascript
|
|
144
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.edit(
|
|
145
|
+
"cc0e8400-e29b-41d4-a716-446655440007",
|
|
146
|
+
"How many years of professional experience do you have with React development?",
|
|
147
|
+
7
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Response:
|
|
151
|
+
{
|
|
152
|
+
success: true
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Data Types and Constraints
|
|
159
|
+
|
|
160
|
+
### Question Types
|
|
161
|
+
- **`binary_check`** - Yes/No or True/False questions
|
|
162
|
+
- **`open_response`** - Long-form text responses
|
|
163
|
+
- **`short_answer`** - Brief text responses
|
|
164
|
+
- **`integer`** - Numeric responses
|
|
165
|
+
|
|
166
|
+
### Question Categories
|
|
167
|
+
- **`general`** - Standard questions applicable to most positions (only available for filtering)
|
|
168
|
+
- **`custom`** - Job-specific questions tailored to the position
|
|
169
|
+
- **`basic`** - Fundamental screening questions
|
|
170
|
+
|
|
171
|
+
**Note:** When creating questions, only `"custom"` and `"basic"` categories are allowed.
|
|
172
|
+
|
|
173
|
+
### Weight System
|
|
174
|
+
- Question weights are integer values that indicate the relative importance of each question
|
|
175
|
+
- Higher weights typically indicate more critical questions in the evaluation process
|
|
176
|
+
- Weight values can be any positive integer
|
|
177
|
+
- Default weight is 0 if not specified
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Complete Usage Example
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
// Complete workflow for managing candidate questions
|
|
185
|
+
async function setupCandidateQuestions(jobDescriptionId) {
|
|
186
|
+
try {
|
|
187
|
+
// 1. Create basic screening questions
|
|
188
|
+
const basicQuestions = [
|
|
189
|
+
{
|
|
190
|
+
question: "Are you legally authorized to work in this country?",
|
|
191
|
+
type: "binary_check",
|
|
192
|
+
weight: 10,
|
|
193
|
+
category: "basic"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
question: "Are you willing to relocate if necessary?",
|
|
197
|
+
type: "binary_check",
|
|
198
|
+
weight: 3,
|
|
199
|
+
category: "basic"
|
|
200
|
+
}
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
// 2. Create technical questions
|
|
204
|
+
const technicalQuestions = [
|
|
205
|
+
{
|
|
206
|
+
question: "Describe your experience with microservices architecture",
|
|
207
|
+
type: "open_response",
|
|
208
|
+
weight: 8,
|
|
209
|
+
category: "custom"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
question: "How many years of experience do you have with Node.js?",
|
|
213
|
+
type: "integer",
|
|
214
|
+
weight: 6,
|
|
215
|
+
category: "custom"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
question: "What is your preferred development methodology?",
|
|
219
|
+
type: "short_answer",
|
|
220
|
+
weight: 4,
|
|
221
|
+
category: "custom"
|
|
222
|
+
}
|
|
223
|
+
];
|
|
224
|
+
|
|
225
|
+
// 3. Create general questions
|
|
226
|
+
const generalQuestions = [
|
|
227
|
+
{
|
|
228
|
+
question: "Why are you interested in this position?",
|
|
229
|
+
type: "open_response",
|
|
230
|
+
weight: 5,
|
|
231
|
+
category: "custom"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
question: "What are your salary expectations?",
|
|
235
|
+
type: "short_answer",
|
|
236
|
+
weight: 2,
|
|
237
|
+
category: "custom"
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
|
|
241
|
+
// Create all questions
|
|
242
|
+
const allQuestions = [...basicQuestions, ...technicalQuestions, ...generalQuestions];
|
|
243
|
+
const createdQuestions = [];
|
|
244
|
+
|
|
245
|
+
for (const q of allQuestions) {
|
|
246
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.create(
|
|
247
|
+
jobDescriptionId,
|
|
248
|
+
q.question,
|
|
249
|
+
q.type,
|
|
250
|
+
q.weight,
|
|
251
|
+
q.category
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
if (result.success) {
|
|
255
|
+
createdQuestions.push(result.data.question_id);
|
|
256
|
+
console.log(`Created question: ${q.question}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// 4. Retrieve and display questions by category
|
|
261
|
+
const customQs = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getByCategory(
|
|
262
|
+
jobDescriptionId,
|
|
263
|
+
"custom"
|
|
264
|
+
);
|
|
265
|
+
console.log(`Created ${customQs.data.length} custom questions`);
|
|
266
|
+
|
|
267
|
+
const basicQs = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getByCategory(
|
|
268
|
+
jobDescriptionId,
|
|
269
|
+
"basic"
|
|
270
|
+
);
|
|
271
|
+
console.log(`Created ${basicQs.data.length} basic questions`);
|
|
272
|
+
|
|
273
|
+
// 5. Get complete list of all questions
|
|
274
|
+
const allQsList = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getList(jobDescriptionId);
|
|
275
|
+
console.log(`Total questions created: ${allQsList.data.length}`);
|
|
276
|
+
|
|
277
|
+
// 6. Edit a question if needed
|
|
278
|
+
if (createdQuestions.length > 0) {
|
|
279
|
+
await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.edit(
|
|
280
|
+
createdQuestions[0],
|
|
281
|
+
"Are you legally authorized to work in the United States?", // Updated text
|
|
282
|
+
10 // Keep same weight
|
|
283
|
+
);
|
|
284
|
+
console.log("Updated first question");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
console.log("Candidate questions setup completed successfully!");
|
|
288
|
+
return createdQuestions;
|
|
289
|
+
|
|
290
|
+
} catch (error) {
|
|
291
|
+
console.error("Error setting up candidate questions:", error);
|
|
292
|
+
return [];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Example: Clean up questions for a job description
|
|
297
|
+
async function cleanupQuestions(jobDescriptionId) {
|
|
298
|
+
try {
|
|
299
|
+
// Delete all questions for the job description
|
|
300
|
+
const result = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.deleteAll(jobDescriptionId);
|
|
301
|
+
|
|
302
|
+
if (result.success) {
|
|
303
|
+
console.log("All questions deleted successfully");
|
|
304
|
+
} else {
|
|
305
|
+
console.log("Failed to delete questions");
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
} catch (error) {
|
|
309
|
+
console.error("Error cleaning up questions:", error);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Example: Selective question management
|
|
314
|
+
async function manageQuestions(jobDescriptionId) {
|
|
315
|
+
try {
|
|
316
|
+
// Get all current questions
|
|
317
|
+
const currentQuestions = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getList(jobDescriptionId);
|
|
318
|
+
|
|
319
|
+
// Delete questions with weight less than 5
|
|
320
|
+
for (const question of currentQuestions.data) {
|
|
321
|
+
if (question.weight < 5) {
|
|
322
|
+
await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.delete(question.question_id);
|
|
323
|
+
console.log(`Deleted low-weight question: ${question.question}`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Get updated list
|
|
328
|
+
const updatedQuestions = await behindAPI.easyjob.V10.jobDescriptionCandidateQuestions.getList(jobDescriptionId);
|
|
329
|
+
console.log(`Remaining questions: ${updatedQuestions.data.length}`);
|
|
330
|
+
|
|
331
|
+
} catch (error) {
|
|
332
|
+
console.error("Error managing questions:", error);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Best Practices
|
|
340
|
+
|
|
341
|
+
1. **Question Weight Strategy**: Use a consistent weighting system (e.g., 1-10 scale) where higher weights indicate more critical questions for the position.
|
|
342
|
+
|
|
343
|
+
2. **Category Organization**:
|
|
344
|
+
- Use "basic" for fundamental screening questions that apply to most positions
|
|
345
|
+
- Use "custom" for job-specific questions tailored to the particular role
|
|
346
|
+
- Note that "general" category is only available for filtering existing questions, not for creating new ones
|
|
347
|
+
- Use `getByCategory()` to filter questions by their assigned categories
|
|
348
|
+
|
|
349
|
+
3. **Question Types**:
|
|
350
|
+
- Use "binary_check" for qualification requirements
|
|
351
|
+
- Use "integer" for quantifiable experience questions
|
|
352
|
+
- Use "short_answer" for brief descriptive responses
|
|
353
|
+
- Use "open_response" for detailed explanations
|
|
354
|
+
|
|
355
|
+
4. **Error Handling**: Always check the `success` property in responses before proceeding with dependent operations.
|
|
356
|
+
|
|
357
|
+
5. **Bulk Operations**: When creating multiple questions, consider implementing retry logic and proper error handling for each individual creation.
|
|
358
|
+
|
|
359
|
+
6. **Parameter Validation**: Ensure question types match the accepted values and weights are positive integers. Remember that category is now required for creation.
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## API Method Summary
|
|
364
|
+
|
|
365
|
+
| Method | Purpose | Required Parameters | Optional Parameters |
|
|
366
|
+
|--------|---------|-------------------|-------------------|
|
|
367
|
+
| `create` | Create new question | `jobDescriptionId`, `question`, `type`, `weight`, `category` | None |
|
|
368
|
+
| `delete` | Delete specific question | `questionId` | None |
|
|
369
|
+
| `deleteAll` | Delete all questions for job | `jobDescriptionId` | None |
|
|
370
|
+
| `getList` | Get all questions for job | `jobDescriptionId` | None |
|
|
371
|
+
| `getByCategory` | Get questions by category | `jobDescriptionId`, `category` | None |
|
|
372
|
+
| `edit` | Update existing question | `questionId` | `text`, `weight` |
|