SAP Knowledge Base Article - Public

2748097 - OData Photo Entity: Querying Photo Value with If-Modified-Since HTTP Header

Symptom

In this document we will discuss the standard HTTP request-header If-Modified-Since in the context of OData API. This header allows more efficient update of cached photos.

To retrieve a particular photo you must specify the userId and photoType. These are the business keys for the Photo entity.

Environment

  • BizX
  • SuccessFactors (SF)

Resolution

As of Q4 2018 release, the Photo entity supports the standard HTTP request-header If-Modified-Since. With this header,As of Q4 2018 release, the Photo entity supports the standard HTTP request-header If-Modified-Since. With this header, the API call can identify whether a photo has been modified since the time specified in this field. 

1. Example Query:  

Operation Query
HTTP Method GET
URI https://<hostname>/odata/v2/Photo(photoType=1, userId='cgrant')/photo/$value
Headers

Authorization: Basic <Base 64 encoded (“user@company:password”)

If-Modified-Since: Wed, 10 Oct 2018 09:00:00 GMT


    If the photo has been modified after the given date, the query returns the 200 status code and the new photo value will be updated in the cache.
    If the photo has not been modified since the specified date, the query returns the 304 status code without photo content.

2. $value:

   The If-Modified-Since header only works when you query the content of the photo with $value. 
   The correct date-time format must be provided: If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT. Incorrect format will be ignored.

See Also

 SAP SuccessFactors HCM Suite OData API: Reference Guide - Photo Entity

Keywords

  • OData
  • Photo Entity
  • If-Modified-Since
, KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM Core all versions