Empuls Software Development Kit
Integration Guide for Intranet Sites
Business Objective
To build a white-labelled rewards solution within the intranet to address the branding needs of the organization.
Goals
Build a white-labelled rewards and recognition solution that can be adopted by organizations via integrations.
Non-Goals
Additional Empuls features like Leaderboard, Surveys, Groups, etc are not in scope for this program.
Assumptions
The white-labeled product solution is targeted towards the end-users i.e. employee and manager persona. Admin functions like HR associated with managing the reward program will access the Empuls web app to configure the rewards program.
Features Index
Here are the features covered as part of this documentation. Click on the respective link to view the sample request and response.
1. Authentication & Authorisation
The customer will be able to initiate the integration using the Client ID, Client Secret, and Refresh Token. These inputs will be provided by the Empuls team upon request.
Few things to note while setting up this integration
The client is required to generate the access token using the Client ID, Client Secret, and Refresh token provided. This access token will be valid for 1 day.
The refresh token gets updated every time a new access token is generated. The refresh token will be valid for 60 days.
Here are the request and the response templates for the Empuls OAuth authentication flow
Request:
Response in case of a valid request:
Error Response:
The client can now use the access token to access the Empuls API and Webview on behalf of the user. The authorization for web-view generation and API requests are provided in the next section.
Authorization for Web view
Here is the request preview for the authorization request format for the generation of a web view for Empuls features.
Request URL:
authorization
Access Token
Required. Token obtained from Authentication For eg. xoxoc-eysdkhsdbjbdfsxxxx
as_user
URL encoded email id of the user who is performing the action
timestamp
Epoch unix timestamp in milliseconds
Required. The timestamp of the request must be not older than 5 minutes. For eg. 1679556062000
hash
This is the SHA512 hash generated from the following String.as_user
timestamp
landing_page
This value will determine the page to be loaded on the web view. Supported values - appreciation, redemption, home
Optional. If not mentioned home will be the landing page by default.
Authorization for API Requests
The client can access the protected resources on the server via API’s by following the request format provided.
Few points to note:
The Get requests may not require an access token whereas POST requests pertaining to write functions may require a taken with a specific scope.
The client also needs to share the end-user email id as registered on Empuls in the as_user request header to call the API on behalf of a particular user.
2. Appreciate
The users can send appreciations, and awards or submit nominations using the Appreciate feature on Empuls. The same capability can be made available within the client systems by means of webview.
Here is the video preview of the web view of Appreciate feature
Appreciate Webview on MS Teams App
Request URL for Appreciate Web-view:
Refer Authorization for Web-view section for more details.
Appreciate API Request
Appreciate API allows you to automate rewarding end users for various business use cases. This option best suits performance management systems that automatically reward employees for achieving their quarterly/annual goals.
Request Message
Header
Header KeyValueCommentsauthorization
Bearer Token
Token obtained from Authorisation
as_user
URL encoded email id of the user who is performing the action
String. Required.
content-type
application/json
Payload
JSON KeyValueCommentsaward_id
Id of the award created on the Empuls platform.
String. Required. Only Spot/Instant awards can be given. Approval-based awards are not supported.
recipients
An array of email ids of the recipients
String Array. At least one recipient email id is required.
citation_message
Message to be added as part of the appreciation
String. Required. Upto 1000 characters supported.
budget_id
Unsigned Integer. Optional. If not provided, the system will automatically choose the relevant budget based on the award_id and the sender.
points
Points to be given to the recipients. If more than one recipient is provided, then based on the award configuration, it will either be split or given equally.
Unsigned Integer. Optional. If not provided, will be taken as default/minimum points for the award.
group_id
The id of the group where the appreciation message should be posted.
String. Optional. If not provided, the default (homepage) group would be chosen for posting.
Response
JSON KeyValueCommentssuccess
0 or 1
Unsigned Integer. 1 indicates success, and 0 for failure.
status
200, 201, or Global Error codes
Unsigned Integer. 200, 201 indicates success, and others for failure. Refer global error handling section below for other error codes.
message
Human readable description regarding the API response
String.
appreciation_id
Unique id for the resource created
String. Optional. blank in case of error.
error_code
null or one of the unique error identifier
String
3. Send Gifts In Testing
Send Gifts API allows you to automate gifting end users for various business use cases. This option is best suited for referral, learning management systems, and other business applications that intend to incentive employees with points for actions that are not associated with their performance at their job. Here is a video walkthrough of the gifts feature on Empuls.
Send Gifts Experience (For Integrations)
P.S: Unlike Awards, Gifts do not generate any feed messages on townhall or any groups.
API Request
Header
Header KeyValueCommentsauthorization
Bearer Token
Token obtained from Authorisation
as_user
URL encoded email id of the user who is performing the action
String. Required.
content-type
application/JSON
Payload
JSON KeyValueCommentsgift_id
String. Required.
recipients
An array of email ids of the recipients. The email id should have an enabled user account on Empuls.
String Array. Required. At least one recipient email id is a must.
Response
JSON KeyValueCommentssuccess
0 or 1
Unsigned Integer. 1 indicates success, and 0 for failure.
status
200, 201, and Global Error codes defined below
Unsigned Integer. 200, 201 indicates success, and others for failure. Refer global error handling section below for other error codes.
message
Human readable description regarding the API response
String.
gift_transaction_id
Unique id for the resource created
String. Optional. Blank in case of error.
error_code
null or one of the unique error identifier
String. Blank in case of the successful transaction.
4. Redeem Reward Points
The users can redeem the reward points they have accumulated in their Empuls account on Empuls Store. The client system can allow users with points to open the Empuls store on a web view to allow them to purchase gift cards using the points.
Here is the video preview of the web view of the redemption feature
Request URL for Redemption Web-view
Refer Authorization for Web-view section for more details.
5. Home
The home page is a common landing page that allows users to do everything that the Empuls web app offers. This includes the option to give awards, redeem points, view updates of your organization, and more.
Here is the video preview of the web view of the home page
Request URL for Home Page Web-view:
6 Reports In Testing
Reports API shares the various details captured as part of the Empuls reports. This will span across features and provides you insights about different aspects of the rewards program on Empuls.
6.1 Fetch Awards Issued API
This API allows you to fetch the list of all awards issued within a given time period.
API Request
Header
Header KeyValueCommentsauthorization
Bearer Token
Token obtained from Authorisation
content-type
application/JSON
Payload
JSON KeyValueCommentslimit
Indicates the maximum number of records you intend to fetch.
String.
start_date
Starting date of the date range you intend to get the appreciations.
Required.
end_date
Ending date of the date range you intend to get the appreciations.
Required.
timezone
UTC offset to indicate the timezone for consideration of date.
Required. Incase the date requested is for India region, send +5:30, For US EST timezone send -5:00 and so on
sorting
Ordering of the messages between the timezone
Only fdc:desc & fdc:asc are accepted.
Response
JSON KeyValueCommentssuccess
0 or 1
Unsigned Integer. 1 indicates success, and 0 for failure.
status
200, 201, and Global Error codes defined below
Unsigned Integer. 200, 201 indicates success, and others for failure. Refer global error handling section below for other error codes.
approval_status
Status of the award.
Possible values include
Approved: if the award is issued,
Revoked: If the award issued was taken back | | budget_owner | Owner of the budget used to issue this award | | | nominator_details | User who nominated the recipients for this award | | | nominee_details | Recipients of the award | Can consist of 1 or more users. | | approver_details | Details of the user who reviewed this nomination at the final level | Blank in case of spot / Instant awards. | | citation | Recognition message shared by the nominator for giving this award/ submitting the nomination | | | image_url | Recognition image published on Empuls feeds | | | error_code | null or one of the unique error identifier | String. Blank in case of a successful transaction. |
6.2 Fetch Core Values API
This API allows you to fetch the list of all non-monetary recognitions i.e. core values issued between a given time period.
API Request
Header
Header KeyValueCommentsauthorization
Bearer Token
Token obtained from Authorisation
content-type
application/JSON
Payload
JSON KeyValueCommentslimit
Indicates the maximum number of records you intend to fetch.
String.
start_date
Starting date of the date range you intend to get the appreciations.
Required.
end_date
Ending date of the date range you intend to get the appreciations.
Required.
timezone
UTC offset to indicate the timezone for consideration of date.
Required. In case the date requested is for the India region, send +5:30, For the US EST timezone send -5:00, and so on
sorting
Ordering of the messages between the timezone
Only fdc:desc & fdc:asc are accepted.
Response
JSON KeyValueCommentssuccess
0 or 1
Unsigned Integer. 1 indicates success, and 0 for failure.
status
200, 201, and Global Error codes defined below
Unsigned Integer. 200, 201 indicates success, and others for failure. Refer global error handling section below for other error codes.
status
Status of the award.
Possible values include
Published: if the recognition is published on an Empuls group
Deleted: If the published recognition message was deleted | | group_id | Id of the Empuls group where the message is published | String. | | citation | Recognition message shared by the sender | | | image_url | Recognition image published on Empuls feeds | | | error_code | null or one of the unique error identifier | String. Blank in case of a successful transaction. |
Global Error Handling
The OAuth API returns different error codes and messages depending on the nature of the error. The client can handle these errors to fail gracefully. These messages can also be used to provide guidance on expected actions from end users.
Here are some common error codes and messages that the OAuth API may return:
400 Bad Request: Invalid request parameters.
award.InvalidEmailFormat
award.awardNotFound
401 Unauthorised: Invalid or expired access token.
403 Forbidden: The client does not have permission to access the requested resource.
500 Internal Server Error: An error occurred on the server.
Last updated
Was this helpful?