SAP Knowledge Base Article - Public

2971392 - UserBadge Odata API Shows only Badge info of current API requester

Symptom

  • When running query for UserBadge Odata API without filter you expect to get all userBadges record
  • The API returns badges for the currently logged in user when no userId is specified.

Environment

SAP Successfactors HXM Suite/Core

  • SAP SuccessFactors HXM Suite OData API

Reproducing the Issue

Run the API query for SF.Odata.UserBadge query :

https://<API-Server>/odata/v2/UserBadges?$format=json

You Get logged in user/API users UserBadge record only.

Cause

The current application of this entity does not support to query all user when no Id is specified in the filter per current design.

This is documented in SAP SuccessFactors HXM Suite OData API: Reference Guide

Property

Description

badgeInstanceId

The unique identifier for a user badge record.

userId

The unique ID for the badge owner. The API returns badges for the currently logged in user if no userId is specified.

badgeCreatorName

The name of the person who created the badge

badgeId

The ID of the badge.

badgeTitle

The title of the badge.

comment

Comment for the badge.

creatorUserID

The ID of the person who created the badge.

lastModified

The date and time on which the badge was created.

photo

The photo for the badge.

Resolution

1. To get the Badge of another user, * have to indicate the user * in the filter.

Sample query:

https://<API-Endpoint-URL>/odata/v2/UserBadges?$filter=userId eq 'admin'

where <API-Endpoint-URL> can be checked via KBA - 2215682 - Successfactors API URLs for different Data Centers 

2. If this is a feature you consider to be needed per your business use case you can raise an enhancement for this and the Product team will review feasibility and/or applicability. See 2090228 - How to Submit Ideas for SAP SuccessFactors Products

See Also

Keywords

UserBadges, Odata API Badge , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HCM Core all versions