Create a wellness activity

post

/hcmRestApi/resources/11.13.18.05/wellnessActivities

Request

Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Nested Schema : Activity Measures
Type: array
Title: Activity Measures
The activityMeasures resource is a child of the wellnessActivities resource. It includes measures to track fitness activities. For example, a daily activity summary includes a value for the number of steps equivalent to the activities recorded for that day, as well as the time spent at low, moderate, and high activity levels.
Show Source
Nested Schema : schema
Type: object
Show Source
  • Maximum Length: 80
    Unique identifier for the units used to measure the activity being tracked. For example, oracle:apps:odin:domain:unit:distance:miles for distance.
  • Maximum Length: 80
    Unique identifier of the activity being tracked.
  • Value of the measurement specified by the resource URI in the units specified by UnitsURI.
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Body ()
Root Schema : wellnessActivities-item-response
Type: object
Show Source
  • Activity Measures
    Title: Activity Measures
    The activityMeasures resource is a child of the wellnessActivities resource. It includes measures to track fitness activities. For example, a daily activity summary includes a value for the number of steps equivalent to the activities recorded for that day, as well as the time spent at low, moderate, and high activity levels.
  • Maximum Length: 80
    Name of the fitness tracking device.
  • Links
  • Start date and time of the tracking period. This is optional.
  • End date and time of the tracking period. This is optional and can be the same as the start time for a daily summary.
  • Maximum Length: 80
    Unique identifier for the unit of measure of the tracking period. For example, oracle:apps:odin:domain:unit:time_period:daily for a daily summary.
  • Maximum Length: 80
    Unique identifier for the fitness tracker account.
  • Maximum Length: 80
    Identifier for the Wellness user, typically Person ID or the value supplied by Oracle HCM Cloud to an external bridge when a user opts-in to Wellness.
  • Maximum Length: 80
    Name of the manufacturer of the fitness tracking device.
Nested Schema : Activity Measures
Type: array
Title: Activity Measures
The activityMeasures resource is a child of the wellnessActivities resource. It includes measures to track fitness activities. For example, a daily activity summary includes a value for the number of steps equivalent to the activities recorded for that day, as well as the time spent at low, moderate, and high activity levels.
Show Source
Nested Schema : wellnessActivities-activitymeasures-item-response
Type: object
Show Source
  • Links
  • Maximum Length: 80
    Unique identifier for the units used to measure the activity being tracked. For example, oracle:apps:odin:domain:unit:distance:miles for distance.
  • Maximum Length: 80
    Unique identifier of the activity being tracked.
  • Value of the measurement specified by the resource URI in the units specified by UnitsURI.
Back to Top

Examples

The following example shows how to create a wellness activity by submitting a POST request on the REST resource using cURL.

curl -X POST -H "<username>:<password>" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -H "Cache-Control: no-cache" -d <payload> http://<host>:<port>/hcmRestApi/resources/11.13.18.05/wellnessActivities"

Example of Payload

The following shows an example of the payload.

{
  "UserId":"300000049043637",
  "StartTime":"2019-03-07",
  "StopTime":"2019-03-07",
  "URI":"oracle:apps:hcm:hwr:cardea:activity:summary",
  "TimePeriodUnitsURI":"oracle:apps:odin:domain:unit:time_period:daily",
  "DeviceName":"FitnessBand",
  "VendorName":"FitnessTracker",
  "activitymeasures":
    [
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:steps",
         "UnitURI":"oracle:apps:odin:domain:unit:simple_count:count",
         "Value":"8001"
       },                                    
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:distance",
         "UnitURI":"oracle:apps:odin:domain:unit:distance:miles",
         "Value":"4.1"
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:high_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"22"
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:moderate_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"10"},
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:low_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"50"
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:calories",
         "UnitURI":"oracle:apps:odin:domain:unit:energy:kcal",
         "Value" : "1801"
       }
    ]
}

Example of Response Header

The following shows an example of the response header.

Status: HTTP/1.1 201 Created
Content-Type : application/json

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "UserId":"300000049043637",
  "StartTime":"2019-03-07",
  "StopTime":"2019-03-07",
  "URI":"oracle:apps:hcm:hwr:cardea:activity:summary",
  "TimePeriodUnitsURI":"oracle:apps:odin:domain:unit:time_period:daily",
  "DeviceName":"FitnessBand",
  "VendorName":"FitnessTracker",
  "activitymeasures":
    [
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:steps",
         "UnitURI":"oracle:apps:odin:domain:unit:simple_count:count",
         "Value":"8001"
         "links":[ 
                {
                  ...}
         ]           
       },                                    
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:distance",
         "UnitURI":"oracle:apps:odin:domain:unit:distance:miles",
         "Value":"4.1"
         "links":[ 
                {
                  ...}
         ]
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:high_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"22"
         "links":[ 
                {
                  ...}
          ]
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:moderate_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"10"},
         "links":[ 
                {
                  ...}
          ]
       },
       {
         "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:low_activity_time",
         "UnitURI":"oracle:apps:odin:domain:unit:time:min",
         "Value":"50"
         "links":[ 
                {
                  ...}
          ]
       },
       {
        "URI":"oracle:apps:hcm:hwr:cardea:activitymeasure:calories",
        "UnitURI":"oracle:apps:odin:domain:unit:energy:kcal",
        "Value" : "1801"
        "links":[ 
                {
                  ...}
          ]
       }
    ]
}
Back to Top