I had followed the steps mentioned in the documentation but still gettting 400 bad request as response.
This is the endpoint which I used to create content item. /hcmRestApi/resources/11.13.18.05/learningContentItems
Documentation link :
https://docs.oracle.com/en/cloud/saas/human-resources/23b/farws/op-learningcontentitems-post.html
Code Snippet :
Below one is the curl req which I used.
var settings = {
“url”: “{{serviceurl}}/hcmRestApi/resources/11.13.18.05/learningContentItems”,
“method”: “POST”,
“timeout”: 0,
“headers”: {
“Content-Type”: “application/vnd.oracle.adf.batch+json”,
“Authorization”: “Basic *****************************”
},
“data”: JSON.stringify({
“Title”: “API_GEN_Asssesment”,
“Status”: “ORA_CONT_ACTIVE”,
“TrackingType”: “ORA_ASSESSMENT”,
“Description”: “Checking understanding of LMS”,
“StartDate”: “2023-04-27”,
“AssessmentCode”: “3000002563102342”,
“AssessmentMasteryScore”: 40,
“AssessmentAttempts”: 2
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});