Human Capital Management Blogs by Members
Gain valuable knowledge and tips on SAP SuccessFactors and human capital management from member blog posts. Share your HCM insights with a post of your own.
cancel
Showing results for 
Search instead for 
Did you mean: 

Overview


The possibilities given for uploading a photo to SuccessFactors (KBA 2094242) are quite limited and rely on uploading physical photo-files (jpg/png) in any case. Recommended transfer via sFTP.

Also naming convention is quite limited, the photo has to be named like the userId, which in some cases might not be possible. So identification of photo and user gets more tricky.

Scenario


In this scenario I will explain using OData to upload a SuccessFactors profile picture.

The OData endpoint of SuccessFactors can be triggered by your choice (SAP Cloud Integration, Other Webservice Mechanisms). This is not part of this blog post.

Goal


The goal is to provide a soluation other than those mentioned in KBA 2094242

 

Realization



  1. You require the following RBP authorizations (e.g. when creating a service user for this request)
    - Admin access to OData
    - Employee data to edit the profile picture

  2. Determine your OData Endpoint:
    For example in DC12 this would be: https://api12preview.sapsf.eu/odata/v2/upsert?$format=json

  3. Encode photo into a base64-string (e.g. via ABAP or other tools like in SAP Cloud Integration base64 encoder)

  4. Send a POST HTTP request to the mentioned endpointHTTP Header: Authorization and your preferred Authentication type
    HTTP Header: Accept: application/json
    HTTP Header: Content-Type: application/jsonHTTP Body:
    [
    {
    "__metadata": {
    "uri": "Photo(photoType=1,userId='USERID')",
    "type": "SFOData.Photo"
    },
    "photoType" : 1,
    "userId": "USERID",
    "photoName" : null,
    "photo": "BASE64_ENCODED_STRING"
    },
    {
    "__metadata": {
    "uri": "Photo(photoType=1,userId='USERID2')",
    "type": "SFOData.Photo"
    },
    "photoType" : 1,
    "userId": "USERID2",
    "photoName" : null,
    "photo": "BASE64_ENCODED_STRING"
    }
    ]​



 

Conclusion


A straight forward approach to upload profile pictures when you are able to use Webservice technologies in your environment.

 

Cheers

Chris