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

SAP SuccessFactors Learning

Reproducing the Issue

Make call to recordLearningEvents OData web service 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

2539023 - Required fields for recordLearning OData web service

Keywords

learning, successfactors, odata, web, service, api, recordLearningEvent, 400, error, 'componentTypeID' can not be mapped as a property or an annotation , KBA , LOD-SF-LMS-ODA , Web Services OData , LOD-SF-LMS , Learning Management System , Problem

Product

SAP SuccessFactors Learning all versions