SAP Knowledge Base Article - Public

3035195 - Error "Illegal unquoted character ((CTRL-CHAR, code 9))" is returned in Upsert call - OData API

Symptom

You have performed an OData API Upsert in SuccessFactors and an error similar to the one below occurred:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>BadRequestException</code>
    <message lang="en-US">The post data are in the bad JSON format: Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value
 at [Source: (String)"{    "__metadata": {        "uri": "User('TestingCW ')",        "type": "SFOData.User"    },    "userId": "TestingCW",    "username": "TestingCW",    "status": "t",    "firstName": "Testing",    "lastName": "CW",    "hr": {          "__metadata": {            "type": "SFOData.User",            "uri": "User('NO_HR')"        }    }}"; line: 1, column: 53]</message>
</error>

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SuccessFactors
    • OData API

Reproducing the Issue

Send the Upsert call below:

{
    "__metadata": {
        "uri": "User('TestingCW ')",
        "type": "SFOData.User"
    },
    "userId": "TestingCW",
    "username": "TestingCW",
    "status": "t",
    "firstName": "Testing",
    "lastName": "CW",
    "hr": {
          "__metadata": {
            "type": "SFOData.User",
            "uri": "User('NO_HR')"
        }
    }
}

Cause

A horizontal tab (ASCII code 09) character was typed in your Upsert payload. In the example shown in the "Reproducing the Issue" section of this KBA, the horizontal tab can be seen in the "uri" field (the space after TestingCW).

Resolution

Remove the horizontal tab characters from the payload.

See Also

The horizontal tab has decimal code 9 in the ASCII table.

Keywords

ascii, horizontal, tab, space, json, odata, api, upsert, insert, change, update, modify, error, sf, successfactors, syntax, structure, typo,  , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HXM Suite all versions