jobquestionsets
Represents a JobQuestionSet REST API structure
GET
URI
/services/apexrest/v1.0/jobquestionsets/*
Description
Returns job question sets with related job question records based on job question set name or job question set ID, and optionally custom fields of Job Question Set and Job Question objects that are passed as parameters in request URL
Input Parameters
ids
Comma-separated Salesforce record IDs of job question sets
names
Comma-separated names of job question sets
vanahcm__Job_Question_Set__c
Comma-separated API names of custom field to be queried for vanahcm__Job_Question_Set__c object
vanahcm__Job_Questions__c
Comma-separated API names of custom field to be queried for vanahcm__Job_Questions__c object
Sample Code
// GET Response
[{
"OwnerId": "00515000006AEwwAAG",
"Name": "Question Set 1",
"LastModifiedDate": "2016-04-25T12:29:27.000Z",
"LastModifiedById": "00515000006AEwwAAG",
"JobQuestions": [{
"Weight": 0.5,
"ScoreResponse": true,
"RequiredField": true,
"QuestionType": "Text",
"QuestionName": "Test Question 1",
"PickListValues": "Value 1, Value 2",
"OwnerId": "00515000006AEwwAAG",
"LastModifiedDate": "2016-04-25T12:29:28.000Z",
"LastModifiedById": "00515000006AEwwAAG",
"JobQuestionsName": "Question ID 59",
"JobQuestionnaire": "a2L15000000KI6yEAG",
"Id": "a2M15000000EQ0nEAG",
"CustomFields": [{
"Value": "Text",
"FieldName": "Custom_Field_Text__c"
}, {
"Value": "2.00",
"FieldName": "Custom_Field_Number__c"
}, {
"Value": "2015-02-02 00:00:00",
"FieldName": "Custom_Field_Date__c"
}, {
"Value": "true",
"FieldName": "Custom_Field_CheckBox__c"
}, {
"Value": "foo@bar.com",
"FieldName": "Custom_Field_Email__c"
}],
"CreatedDate": "2016-04-25T12:29:28.000Z",
"CreatedById": "00515000006AEwwAAG",
"CorrectAnswer": "Correct Answer"
}],
"Id": "a2L15000000KI6yEAG",
"Description": "Test Description",
"CustomFields": [{
"Value": "Text",
"FieldName": "Custom_Field_Text__c"
}, {
"Value": "2.00",
"FieldName": "Custom_Field_Number__c"
}, {
"Value": "2015-02-02 00:00:00",
"FieldName": "Custom_Field_Date__c"
}, {
"Value": "true",
"FieldName": "Custom_Field_CheckBox__c"
}, {
"Value": "foo@bar.com",
"FieldName": "Custom_Field_Email__c"
}],
"CreatedDate": "2016-04-25T12:29:27.000Z",
"CreatedById": "00515000006AEwwAAG"
}]
POST
URI
/services/apexrest/v1.0/jobquestionsets/*
Description
Insert job question set records with related job question records
Input Parameters
records
Job question set records that need to be inserted
Sample Code
// POST Request
{
"records": [{
"Description": "Test Description",
"Name": "Question Set 3",
"CustomFields": [{
"FieldName": "Custom_Field_Text__c",
"Value": "Test"
}, {
"FieldName": "Custom_Field_Number__c",
"Value": 2
}, {
"FieldName": "Custom_Field_Email__c",
"Value": "foo@bar.com"
}, {
"FieldName": "Custom_Field_Date__c",
"Value": "2015-02-02"
}, {
"FieldName": "Custom_Field_CheckBox__c",
"Value": "true"
}],
"JobQuestions": [{
"QuestionName": "Test Question 3",
"CorrectAnswer": "Correct Answer",
"PickListValues": "Value 1, Value 2",
"QuestionType": "Text",
"RequiredField": true,
"ScoreResponse": true,
"Weight": 0.5,
"CustomFields": [{
"FieldName": "Custom_Field_Text__c",
"Value": "Test"
}, {
"FieldName": "Custom_Field_Number__c",
"Value": 2
}, {
"FieldName": "Custom_Field_Email__c",
"Value": "foo@bar.com"
}, {
"FieldName": "Custom_Field_Date__c",
"Value": "2015-02-02"
}, {
"FieldName": "Custom_Field_CheckBox__c",
"Value": "true"
}]
}]
}]
}
// POST Response
[{
"RecordId": "a2L15000000KI79EAG",
"JobQuestionIds": ["a2M15000000EQ0yEAG"]
}]
PATCH
URI
/services/apexrest/v1.0/jobquestionsets/*
Description
Insert or update job question set records with related job question records
Input Parameters
records
Job question set records that need to be inserted or updated
Sample Code
// PATCH Request
{
"records": [{
"Id": "a2L15000000KI79EAG",
"Description": "Test Description",
"Name": "Question Set 2",
"CustomFields": [{
"FieldName": "Custom_Field_Text__c",
"Value": "Updated Test"
}, {
"FieldName": "Custom_Field_Number__c",
"Value": 3
}, {
"FieldName": "Custom_Field_Email__c",
"Value": "updatedfoo@bar.com"
}, {
"FieldName": "Custom_Field_Date__c",
"Value": "2016-02-02"
}, {
"FieldName": "Custom_Field_CheckBox__c",
"Value": "false"
}],
"JobQuestions": [{
"Id": "a2M15000000EQ0yEAG",
"QuestionName": "Test Question 2",
"CorrectAnswer": "Updated Correct Answer",
"PickListValues": "Value 1, Value 2",
"QuestionType": "Text",
"RequiredField": true,
"ScoreResponse": true,
"Weight": 0.5,
"JobQuestionnaire": "${#TestSuite#JobQuestionSet2_ID}",
"CustomFields": [{
"FieldName": "Custom_Field_Text__c",
"Value": "Updated Test"
}, {
"FieldName": "Custom_Field_Number__c",
"Value": 3
}, {
"FieldName": "Custom_Field_Email__c",
"Value": "updatedfoo@bar.com"
}, {
"FieldName": "Custom_Field_Date__c",
"Value": "2016-02-02"
}, {
"FieldName": "Custom_Field_CheckBox__c",
"Value": "false"
}]
}]
}]
}
// PATCH Response
[{
"RecordId": "a2L15000000KI79EAG",
"JobQuestionIds": ["a2M15000000EQ0yEAG"]
}]