SAP Knowledge Base Article - Public

2538937 - recordLearningEvents OData - "400 Error: 'componentTypeID' can not be mapped as a property or an annotation"

Symptom

When trying to record learning via OData API web service you receive 400 HTTP error response with error message: 'componentTypeID' can not be mapped as a property or an annotation"

Environment

SuccessFactors Learning Management System (All supported versions)

Reproducing the Issue

Make call to recordLearningEvents OData Webservice using the following call and payload:

https://**YOUR_LMS_URL_GOES_HERE**/learning/odatav4/public/user/learningEvent/v1/recordLearningEvents

Payload

{

"@odata.type":"#recordLearningEvents",
"componentTypeID": "VALID_ITEM_TYPE",
"componentID": "VALID_ITEM_ID",
"studentID": "AnyStudentID",
"completionStatusID": "COMPL_STAT",
"completionDate": 1458842820000

}

Error message

{"error":{"code":null,"message":"'componentTypeID' can not be mapped as a property or an annotation."}}

Cause

Incorrect payload format/construct/convention

Resolution

Include the collection property "recordLearningEvents" in the body payload, as shown in the example below:

{

"@odata.type":"#recordLearningEvents",
"recordLearningEvents" :[ {
"componentTypeID": "VALID_ITEM_TYPE",
"componentID": "VALID_ITEM_ID",
"studentID": "AnyStudentID",
"completionStatusID": "COMPL_STAT",
"completionDate": 1458842820000
}
]
}

See Also

Keywords

Successfactors, LMS, OData, web service, recordLearningEvent, API, 400 error , KBA , LOD-SF-LMS-ODA , LMS Web Services OData , LOD-SF-LMS , SuccessFactors Learning , Problem

Product

SAP SuccessFactors Learning all versions