Wellness Campaign API v1
The HealtheIntent Wellness Campaign API enables systems to interact with campaign configuration and campaign memberships in HealtheIntent. A wellness campaign is an incentive program that is designed to motivate members to complete activities to help improve their health. Eligible people are assigned to campaigns to indicate their participation in a wellness incentive program.
URL: https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1
Campaign Memberships
A campaign membership indicates that a consumer is a part of a wellness campaign.
Add a Campaign Member
Example Request:
require 'httparty' # Using HTTParty 0.16.2
require 'json'
headers = {
'Authorization' => '<auth_header>',
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = HTTParty.post('https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships', headers: headers, body: { "campaignId": "22e8902c9e2908c69718f13503066bee", "consumerId": "33e8902c9e2908c69718f13503066bee",})
print JSON.pretty_generate(result)
# You can also use wget
curl -X POST https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships \
-H 'Authorization: {auth_header}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
Example response
{
"id": "11e8902c9e2908c69718f13503066bee",
"campaignId": "22e8902c9e2908c69718f13503066bee",
"consumerId": "33e8902c9e2908c69718f13503066bee",
"createdAt": "2018-12-15T12:23:12Z",
"updatedAt": "2018-05-15T12:23:12Z"
}
POST /memberships
Adds a consumer to a campaign by creating a campaign membership for the specified consumer and campaign.
Parameters
Parameter | In | Type | Required | Default | Description | Accepted Values |
---|---|---|---|---|---|---|
body | body | postMemberships | true | N/A | No description | - |
Response Statuses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | The campaign membership was created. | Membership |
400 | Bad Request | Bad Request | Error |
401 | Unauthorized | Unauthorized | Error |
403 | Forbidden | Forbidden | Error |
Retrieve a List of Campaign Memberships
Example Request:
require 'httparty' # Using HTTParty 0.16.2
require 'json'
headers = {
'Authorization' => '<auth_header>',
'Accept' => 'application/json'
}
result = HTTParty.get('https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships', headers: headers)
print JSON.pretty_generate(result)
# You can also use wget
curl -X GET https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships \
-H 'Authorization: {auth_header}' \
-H 'Accept: application/json'
Example response
{
"items": [
{
"id": "11e8902c9e2908c69718f13503066bee",
"campaignId": "22e8902c9e2908c69718f13503066bee",
"consumerId": "33e8902c9e2908c69718f13503066bee",
"createdAt": "2018-12-15T12:23:12Z",
"updatedAt": "2018-05-15T12:23:12Z"
}
],
"totalResults": 1,
"firstLink": "https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships?offset=0&limit=20",
"lastLink": "https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships?offset=0&limit=20"
}
GET /memberships
Retrieves a list of campaign memberships.
Parameters
Parameter | In | Type | Required | Default | Description | Accepted Values |
---|---|---|---|---|---|---|
campaignId | query | array[string] | false | N/A | The ID of the incentive campaign. | - |
consumerId | query | array[string] | false | N/A | The ID of the consumer. | - |
offset | query | integer(int32) | false | N/A | The number of results to skip from the beginning of the list of results (typically for the purpose of paging). The minimum offset is 0. There is no maximum offset. | - |
limit | query | integer(int32) | false | 20 | The maximum number of results to display per page. The minimum limit is 1. The maximum limit is 100. | - |
orderBy | query | string | false | updatedAt | A comma-separated list of fields by which to sort. | updatedAt, -updatedAt, campaignId, consumerId |
Response Statuses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Memberships |
400 | Bad Request | Bad Request | Error |
401 | Unauthorized | Unauthorized | Error |
403 | Forbidden | Forbidden | Error |
Remove a Campaign Member
Example Request:
require 'httparty' # Using HTTParty 0.16.2
require 'json'
headers = {
'Authorization' => '<auth_header>',
'Accept' => 'application/json'
}
result = HTTParty.delete('https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships/11e8902c9e2908c69718f13503066bee', headers: headers)
print JSON.pretty_generate(result)
# You can also use wget
curl -X DELETE https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships/11e8902c9e2908c69718f13503066bee \
-H 'Authorization: {auth_header}' \
-H 'Accept: application/json'
DELETE /memberships/{membershipId}
Removes a consumer from a campaign by deleting the specified campaign membership.
Parameters
Parameter | In | Type | Required | Default | Description | Accepted Values |
---|---|---|---|---|---|---|
membershipId | path | string | true | N/A | The ID of the campaign membership. | - |
Response Statuses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | The campaign membership was removed. | None |
401 | Unauthorized | Unauthorized | Error |
403 | Forbidden | Forbidden | Error |
404 | Not Found | Not Found | Error |
Retrieve a Single Campaign Membership
Example Request:
require 'httparty' # Using HTTParty 0.16.2
require 'json'
headers = {
'Authorization' => '<auth_header>',
'Accept' => 'application/json'
}
result = HTTParty.get('https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships/11e8902c9e2908c69718f13503066bee', headers: headers)
print JSON.pretty_generate(result)
# You can also use wget
curl -X GET https://cernerdemo.api.us.healtheintent.com/wellness-campaign/v1/memberships/11e8902c9e2908c69718f13503066bee \
-H 'Authorization: {auth_header}' \
-H 'Accept: application/json'
Example response
{
"id": "11e8902c9e2908c69718f13503066bee",
"campaignId": "22e8902c9e2908c69718f13503066bee",
"consumerId": "33e8902c9e2908c69718f13503066bee",
"createdAt": "2018-12-15T12:23:12Z",
"updatedAt": "2018-05-15T12:23:12Z"
}
GET /memberships/{membershipId}
Retrieves a single campaign membership by ID.
Parameters
Parameter | In | Type | Required | Default | Description | Accepted Values |
---|---|---|---|---|---|---|
membershipId | path | string | true | N/A | The ID of the campaign membership. | - |
Response Statuses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Membership |
401 | Unauthorized | Unauthorized | Error |
403 | Forbidden | Forbidden | Error |
404 | Not Found | Not Found | Error |
Schema Definitions
postMemberships
Name | Type | Required | Description | Accepted Values |
---|---|---|---|---|
campaignId | string | true | The ID of an incentive campaign. | - |
consumerId | string | true | The ID of a HealtheIntent consumer. See Consumer API for more information. | - |
Membership
Name | Type | Required | Description | Accepted Values |
---|---|---|---|---|
id | string | true | The ID of the campaign membership. | - |
campaignId | string | true | The ID of the incentive campaign. | - |
consumerId | string | true | The ID of the consumer. | - |
createdAt | string | false | The date and time when the campaign membership was created, in International Organization for Standardization (ISO) 8601 YYYY-MM-DDThh:mm:ss.SSSZ format. | - |
updatedAt | string | false | The date and time when the campaign membership was last updated, in ISO 8601 YYYY-MM-DDThh:mm:ss.SSSZ format. | - |
Error
Name | Type | Required | Description | Accepted Values |
---|---|---|---|---|
code | integer(int32) | true | The HTTP response status code that represents the error. | - |
message | string | true | A human-readable description of the error. | - |
errorDetails | [ErrorDetail] | false | A list of additional error details. | - |
ErrorDetail
Name | Type | Required | Description | Accepted Values |
---|---|---|---|---|
domain | string | false | A subsystem or context where an error occurred. | - |
reason | string | false | A codified value that represents the specific error that caused the current error status. | - |
message | string | false | A human-readable description of an error. | - |
locationType | string | false | The location or type of the field that caused an error. | query, header, path, formData, body |
location | string | false | The name of the field that caused an error. | - |
Memberships
Name | Type | Required | Description | Accepted Values |
---|---|---|---|---|
items | [Membership] | true | No description | - |
totalResults | integer(int32) | false | The total number of results for the specified parameters. | - |
firstLink | string | true | The first page of results. | - |
lastLink | string | false | The last page of results. | - |
prevLink | string | false | The previous page of results. | - |
nextLink | string | false | The next page of results. | - |