cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get employee image from SAP C4C odata?

monokizsolt7
Participant
0 Kudos

How can I get employee image from SAP C4C odata?

Accepted Solutions (1)

Accepted Solutions (1)

Felix_Wyskocil
Product and Topic Expert
Product and Topic Expert

Hi monokizsolt7,

the Employee Image is stored as Attachment, which is not part of the standard OData service (https://myXXXXXX.crm.ondemand.com/sap/c4c/odata/v1/employeeanduser/$metadata)

However, with some clicks, you can create a custom OData service for that:

  1. Go to work center Administrator --> OData Service Explorer.
    (If you don't see this view, you need to adapt your access rights.)
  2. Change the filter from "SAP OData Services" to "Custom OData Services"
  3. Create a new service, e.g. "employeeimages"
  4. Click the button "Select Business Objects" and choose Business Object: Employee, node: Root
  5. Select the Root node (mark the checkbox in the "Select" column)
  6. Select the AttachmentFolder node
  7. Expand the "IdentificationEmployeeID" and select: "BusinessPartnerID" and "EmployeeID"
    (you need these two fields to find/filter for employees by their EmployeeID or BusinessPartnerInternalID, the IdentificationEmployeeID node gets selected automatically)
  8. Assign a work center, e.g. BPM_EMPLOYEES (Employees view of the Admin work center)
  9. Save the service, and Activate it

This creates the service (e.g. https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/cust/v1/employeeimages/$metadata)

Now you can filter for an employee by its EmployeeID or BusinessPartnerInternalID and expand the AttachmentFolder node, where the Image is stored as Base64 in the Binary property:

https://myXXXXXX.crm.ondemand.com/sap/c4c/odata/cust/v1/employeeimages/EmployeeCollection?$expand=Em...

The result will look something like this:
(added &$format=json to the url to make it easier to read in comparison to XML).

 

Felix_Wyskocil_0-1714662764388.png

Hope that helps.

Best regards,
Felix

Answers (0)