Symptom
API Call convertAssignmentIdExternal failing with java.lang.Integer cannot be cast to java.lang.String
Environment
SAP SuccessFactors HXM Suite
Reproducing the Issue
In this example we will be using Postman to do API call.
Testing 1:Request payload:
https://apisalesdemo4.successfactors.com/odata/v2/convertAssignmentIdExternal?oldAssignmentIdExternal=britney&newAssignmentIdExternal=test1234
- Response Payload:
{
"d": {
"convertAssignmentIdExternal": "test123"
}
}
Testing 2:Request payload:
https://apisalesdemo4.successfactors.com/odata/v2/convertAssignmentIdExternal?oldAssignmentIdExternal=jonsnow&newAssignmentIdExternal=1234&$format=json
- Response payload:
"error": {
"code": "ServerErrorException",
"message": {
"lang": "en-US",
"value": "java.lang.Integer cannot be cast to java.lang.String"
Cause
The values for AssignmentIdExternal could not be pure numeric values or values that start with numbers in the API request query, but with single quote will always work.
Resolution
If value starts with numeric, use single quote.
See Also
2825052 - Assignment ID
Keywords
convertAssignmentIdExternal ServerErrorException, java.lang.Integer cannot be cast to java.lang.String , KBA , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , Problem