SAP Knowledge Base Article - Public

3285478 - Odata API is not supporting to upsert photoType 20 for Photo entity

Symptom

Response code 500 Error: "upserted failed: Invalid photo type for Key Photo/photoType=20" for Entity: Photo

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

Environment

SAP SuccessFactors HXM Suite

  • Photo Odata API Entity

Reproducing the Issue

Scenario #1.

Upsert Photo entity with photoType 20 from OData API.

eg. https://apisalesdemo8.successfactors.com/odata/v2/upsert?$format=json

Payload:

 {
 "__metadata": {
 "uri": "Photo(photoType=20,userId='sfadmin')",
 "type": "SFOData.Photo"
 },
 "photoType": 20,
 "userId": "sfadmin",
 "photo":"iVBORw0KGgoAAAANSUhEU
   -------",
  "photoName": "test.jpg"
 }
 
Response: 
{
    "d": [
        {
            "key": "Photo/photoType=20,Photo/userId=sfadmin",
            "status": "ERROR",
            "editStatus": null,
            "message": "upserted failed: Invalid photo type for Key Photo/photoType=20, Photo/userId=sfadmin with the index 0",
            "index": 0,
            "httpCode": 400,
            "inlineResults": null
        }
    ]
}
 
Scenario #2.
 
Upsert Photo with photoType 20 from Integration Center, and the error message is below:
Photo: UPSERT failed for the row with key: Photo/photoType=20, Photo/userId=108743. Reason: upserted failed: Invalid photo type. The row will not be processed for subsequent entities 
 
Screenshot please refer to:

Cause

After b2211, Photo entity is not supporting to upsert the original-sized photo with photoType 20.

Resolution

Please use the valid photoType value in this Help Portal: Photo Types

Keywords

EDU-18263, upserted failed: Invalid photo type for Key Photo/photoType=20, photoType 20 , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HXM Core 2211