Register a Tracking Service

The Employee Wellness functionality in Oracle HCM Cloud can be supported by using an external tracking service. The tracking service operates as a bridge between HCM Wellness and a fitness device manufacturer's website. The bridge polls the manufacturer's website for new data and responds to notifications about new data.

When a bridge is registered as a tracking service, the user can authorize data access. Registration occurs when HCM Wellness receives a REST payload that contains information about the bridge and how it implements the authorization process.

To build the payload:
  1. Create the outer JSON object. This JSON object provides general information about the bridge such as the display name, the type of tracking service, and so on. The display name must be unique.
  2. Specify the AuthURLTemplate value for the inner JSON object. This provides the bridge server URL that initiates the authorization process for the bridge and the fitness device site. When the authorization process is complete, the bridge will be able to retrieve data for a given user. At the start of the authorization process, HCM Wellness redirects the user's browser to this URL, filling in the following template variables with the required information.
    • userID: Unique identifier for the user that the bridge uses later to create (POST) wellness activity data.
    • vendor: Name of the fitness device vendor.
    • redirectURL: URL that the user's browser should be redirected to after the authorization process is complete.
    • action: Action requested by HCM Wellness.
    • DataAttributionURL: Link to the fitness device website.
    • DataAttribution: Text used by the bridge server to describe the source of fitness data.
  3. Create the inner JSON object. This is a base64-encoded JSON text, which contains the details specific to the tracking service bridge.

    Note:

    If another type of tracking service is registered, the attributes for the JSON object will be different.
  4. Add this JSON text as the value for the ProtocolParams attribute in the outer JSON object.

To register the tracking service, send a POST request to HCM Wellness with the complete payload. If the request is successful, HCM Wellness returns the URL and related information for the new tracking service resource.

Once the tracking service is registered, the Wellness user interface is updated to make the bridge available as an option for HCM Wellness users.

Example URL

The following is the format of the resource URL.

POST

/hcmWorkforceReputationApi/resources/11.13.18.05/trackingServices

Example Request

The following is an example of the AuthURLTemplate value for the inner JSON object.

{
"Description":"Fitness bridge",
"Device":"Fit100",
"AuthURLTemplate":"https://<bridgeserver>/Register?userId=${userId}&vendor=${vendor}&redirectURL=${redirectURL}&action=${action}",
"DataAttributionURL":"https://www.dummies.com",
"DataAttribution":"Data from Fit100",
"TestMode":true}

The base64-encoded text for this object is:

eyJEZXNjcmlwdGlvbiI6IkZpdG5lc3MgYnJpZGdlIiwNCiJEZXZpY2UiOiJGaXQxMDAiLA0KIkF1dGhVUkxUZW1wbGF0ZSI6Imh0dHBzOi8vPGJyaWRnZXNlcnZlcj4vUmVnaXN0ZXI/dXNlcklkPSR7dXNlcklkfSZ2ZW5kb3I9JHt2ZW5kb3J9JnJlZGlyZWN0VVJMPSR7cmVkaXJlY3RVUkx9JmFjdGlvbj0ke2FjdGlvbn0iLCJEYXRhQXR0cmlidXRpb25VUkwiOiJodHRwczovL3d3dy5kdW1taWVzLmNvbSIsIkRhdGFBdHRyaWJ1dGlvbiI6IkRhdGEgZnJvbSB0aGUgRml0MTAwIiwNCiJUZXN0TW9kZSI6dHJ1ZX0NCg==

The complete payload is:

{"DisplayName":"DBbridge",
"State":"ORA_ENABLED",
"Vendor":"Fitness Vendor",
"Protocol":"TrackingServicesBridge",
"ProtocolParams":"eyJEZXNjcmlwdGlvbiI6IkZpdG5lc3MgYnJpZGdlIiwNCiJEZXZpY2UiOiJGaXQxMDAiLA0KIkF1dGhVUkxUZW1wbGF0ZSI6Imh0dHBzOi8vPGJyaWRnZXNlcnZlcj4vUmVnaXN0ZXI/dXNlcklkPSR7dXNlcklkfSZ2ZW5kb3I9JHt2ZW5kb3J9JnJlZGlyZWN0VVJMPSR7cmVkaXJlY3RVUkx9JmFjdGlvbj0ke2FjdGlvbn0iLCJEYXRhQXR0cmlidXRpb25VUkwiOiJodHRwczovL3d3dy5kdW1taWVzLmNvbSIsIkRhdGFBdHRyaWJ1dGlvbiI6IkRhdGEgZnJvbSB0aGUgRml0MTAwIiwNCiJUZXN0TW9kZSI6dHJ1ZX0NCg=="}

The payload can be sent to HCM Wellness programmatically or by using a command-line tool such as cURL. The following is an example of the cURL command. A POST operation is performed on the trackingServices resource to register the new tracking service.

curl -X POST --user name:password \ https://<hcmserver.oracle.com>/hcmRestApi/resources/11.13.18.05/trackingServices \-H 'content-type: application/vnd.oracle.adf.resourceitem+json' \-d ' {"DisplayName":"DBbridge","State":"ORA_ENABLED","Vendor":"DUMMY","Protocol":"TrackingServicesBridge","ProtocolParams":"eyJEZXNjcmlwdGlvbiI6IkZpdG5lc3MgYnJpZGdlIiwNCiJEZXZpY2UiOiJGaXQxMDAiLA0KIkF1dGhVUkxUZW1wbGF0ZSI6Imh0dHBzOi8vPGJyaWRnZXNlcnZlcj4vUmVnaXN0ZXI/dXNlcklkPSR7dXNlcklkfSZ2ZW5kb3I9JHt2ZW5kb3J9JnJlZGlyZWN0VVJMPSR7cmVkaXJlY3RVUkx9JmFjdGlvbj0ke2FjdGlvbn0iLCJEYXRhQXR0cmlidXRpb25VUkwiOiJodHRwczovL3d3dy5kdW1taWVzLmNvbSIsIkRhdGFBdHRyaWJ1dGlvbiI6IkRhdGEgZnJvbSB0aGUgRml0MTAwIiwNCiJUZXN0TW9kZSI6dHJ1ZX0NCg=="}'