SAP Knowledge Base Article - Public

2317289 - How to query the SF Odata Photo entity and retrieve the image - SuccessFactors Integration

Symptom

This document explains:

  1. How to perform a query operation using the Odata API entity?
  2. What is the API response in this case?
  3. How to retrieve profile Photo from the API response without Provisioning job?

Environment

SAP SuccessFactors Employee Profile

Reproducing the Issue

Using API response to retrieve profile photo/image.

Cause

Alternative procedure to retrieve profile photo besides a Provisioning job to download the photos.

Resolution

Using Photo entity

  1. Odata API request to fetch the user's photo.

    /odata/v2/Photo?$filter=userId%20eq%20%27admin%27&$select=photo

    Understanding the Query url:

    Entity used - Photo (Odata)

    Filter - User id is filtered (where user id = admin)

    Select - Photo.

  2. Odata API response for the above call.

    Please refer to the attachment API response.txt

    The binary data for the photo is extracted and attached in the attachments section.

  3. How to retrieve the photo back to jpg?

You would require another tool to decode binary data to another format like jpg.

In this document, we have used a third party online tool to perform the decode.

binary to jpg.jpg

   You could use any relevant application/tool to generate the image.

See Also

The system stores several images for a single user's profile picture in different sizes to be used in different applications.

For example, thumbnail size images are used in the org chart, quick card and faces page, while larger size images are used in the employee profile.

The different photo types are categorized by the photoType field. You can query for a specified photoType. All photos with the identified photoType for all active users are returned.
To retrieve photos for a given userId but different photoType, you need to specify the userId in the query.

To retrieve a single photo for a given userId and photoType, you need to put both of them into query criteria.

Keywords

SuccessFactors; Photo Entity; Integration Center; Exporte Profile Photo; Exporte Profile Image; Exporte Profile Picture; Without SFTP Server; Without SFTP Job; How to Get Photo Using API; , KBA , LOD-SF-INT , Integrations , LOD-SF-INT-API , API & Adhoc API Framework , How To

Product

SAP SuccessFactors HCM all versions

Attachments

API response.txt