Structures

APIRateLimit

struct APIRateLimit

Information about MyDataHelps API request limits (throttling). The MyDataHelps API has a rate limiting feature to preserve stability for all customers. Failures due to rate limiting are indicated by the MyDataHelpsError.tooManyRequests error case.

The properties of APIRateLimit help you understand your rate limits and usage, which may vary based on project licensing and scope. See Rate Limits documentation for additional information.

maxRequestsPerHour
let maxRequestsPerHour: Int

Number of requests allowed per hour (total) for this scope.

remainingRequests
let remainingRequests: Int

Number of requests remaining this hour for this scope.

nextReset
let nextReset: Date

When the rate limit will be reset. If your API interactions are failing with the tooManyRequests error, they should work again if you retry after the nextReset date.

DeviceDataNamespace

struct DeviceDataNamespace : RawRepresentable, Equatable, Hashable, Decodable

Device data is grouped into namespaces, which represent the source frameworks that generate the data. There is also a separate project namespace, where projects can persist their own data. The static members of DeviceDataNamespace identify all supported namespace values.

RawValue
associatedtype RawValue
project
static let project: MyDataHelpsKit.DeviceDataNamespace

Project-specific device data.

fitbit
static let fitbit: MyDataHelpsKit.DeviceDataNamespace

Data imported from a linked Fitbit account.

appleHealth
static let appleHealth: MyDataHelpsKit.DeviceDataNamespace

Data imported from a linked Apple Health account.

googleFit
static let googleFit: MyDataHelpsKit.DeviceDataNamespace

Data imported from a linked Google Fit account.

airNowApi
static let airNowApi: MyDataHelpsKit.DeviceDataNamespace

Air quality index data imported from AirNow.gov.

weatherBit
static let weatherBit: MyDataHelpsKit.DeviceDataNamespace

Weather forecast data imported from WeatherBit.io.

omron
static let omron: MyDataHelpsKit.DeviceDataNamespace

Data imported from Omron wellness products.

rawValue
let rawValue: String

The raw value for the namespace as stored in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes a DeviceDataNamespace with an arbitrary value. Consider using static members such as DeviceDataNamespace.project instead for known values.

rawValue

The raw value for the namespace as stored in MyDataHelps.

DeviceDataPoint

struct DeviceDataPoint : Decodable

A single device data point stored in MyDataHelps.

id
let id: String

Auto-generated, globally-unique identifier.

namespace
let namespace: DeviceDataNamespace

Identifies device data as from a specific source system.

deviceDataContextID
let deviceDataContextID: String?

Auto-generated, globally-unique identifier for a group of device data points, which share some context.

insertedDate
let insertedDate: Date

Date when the data point was first added.

modifiedDate
let modifiedDate: Date

Date when the data point was last updated in the system.

identifier
let identifier: String?

String used to name a device data point.

type
let type: String

The type of device data within its namespace, e.g. “HeartRate”.

value
let value: String

The value of the recorded device data point.

units
let units: String?

The units, if any, that the device data was recorded in.

properties
let properties: [String : String]

Properties of the device data point.

source
let source: DeviceDataPointSource?

Identifying information about the device which recorded the data point.

startDate
let startDate: Date?

The date at which this device data point began being recorded (for data that is recorded over time).

observationDate
let observationDate: Date?

The date at which this device data point was completely recorded.

DeviceDataPointPersistModel

struct DeviceDataPointPersistModel : Encodable

Describes a device data point to create or update.

identifier
let identifier: String

String used to name a device data point. Natural Key property.

type
let type: String

The general category this device data point belongs in, or what the device data represents. Natural Key property.

value
let value: String

The value of the recorded data point.

units
let units: String?

The units, if any, that the data was recorded in.

properties
let properties: [String : String]

Properties of the device data point.

source
let source: DeviceDataPointSource?

Identifying information about the device which recorded the data point.

startDate
let startDate: Date?

The date at which this device data point began being recorded (for data that is recorded over time). Natural Key property.

observationDate
let observationDate: Date?

The date at which this device data point was completely recorded. Natural Key property.

init(identifier: type: value: units: properties: source: startDate: observationDate:)
init(identifier: String, type: String, value: String, units: String?, properties: [String : String], source: DeviceDataPointSource?, startDate: Date?, observationDate: Date?)

Initializes an object describing device data point to create or update.

identifier

String used to name a device data point. Natural Key property.

type

The general category this device data point belongs in, or what the device data represents. Natural Key property.

value

The value of the recorded data point.

units

The units, if any, that the data was recorded in.

properties

Properties of the device data point.

source

Identifying information about the device which recorded the data point.

startDate

The date at which this device data point began being recorded (for data that is recorded over time). Natural Key property.

observationDate

The date at which this device data point was completely recorded. Natural Key property.

DeviceDataPointSource

struct DeviceDataPointSource : Codable

Identifying information about the device which recorded a data point.

identifier
let identifier: String

Identifying string for the data source.

properties
let properties: [String : String]

Properties describing the device data source.

init(identifier: properties:)
init(identifier: String, properties: [String : String])

Initializes a new DeviceDataPointSource.

DeviceDataQuery

struct DeviceDataQuery : PagedQuery

Specifies filtering and page-navigation criteria for device data point queries.

All query properties are optional. Set non-nil/non-default values only for the properties you want to use for filtering.

You can filter device data by two different type of dates: modifiedBefore/After and observedBefore/After. Due to variations and limitations in device data synchronization, it is possible for older data points to turn up in the system unpredictably. Using the “observed” query parameters will search based on the date the data was observed or recorded by the device, while the “modified” parameters will search based on the date it arrived in the system. Use the modifiedAfter property to search for data that has arrived since a prior query.

defaultLimit
static let defaultLimit: Int

The default and maximum number of results per page.

namespace
let namespace: DeviceDataNamespace

Specifies the source framework for the device data.

types
let types: Set<String>?

Filter by one or more types/categories within the given namespace, e.g. “HeartRate”

observedAfter
let observedAfter: Date?

Search for device data points observed after this date.

observedBefore
let observedBefore: Date?

Search for device data points observed before this date.

modifiedAfter
let modifiedAfter: Date?

Search for device data points updated in the system after this date.

modifiedBefore
let modifiedBefore: Date?

Search for device data points updated in the system before this date.

limit
let limit: Int

Maximum number of results per page. Default and maximum value is 100.

pageID
let pageID: String?

Identifies a specific page of data to fetch. Use nil to fetch the first page of results. To fetch the page following a given DeviceDataResultPage use its nextPageID; the other parameters should be the same as the original DeviceDataQuery.

init(namespace: types: observedAfter: observedBefore: modifiedAfter: modifiedBefore: limit: pageID:)
init(namespace: DeviceDataNamespace, types: Set<String>? = nil, observedAfter: Date? = nil, observedBefore: Date? = nil, modifiedAfter: Date? = nil, modifiedBefore: Date? = nil, limit: Int = defaultLimit, pageID: String? = nil)

Initializes a new query for a page of device data with various filters.

namespace

Specifies the source framework for the device data.

types

Filter by one or more types/categories within the given namespace, e.g. “HeartRate”.

observedAfter

Search for device data points observed after this date.

observedBefore

Search for device data points observed before this date.

modifiedAfter

Search for device data points updated in the system after this date.

modifiedBefore

Search for device data points updated in the system before this date.

limit

Maximum number of results per page.

pageID

Identifies a specific page of data to fetch.

page(after:)
func page(after page: DeviceDataResultPage) -> DeviceDataQuery?

Initializes a new query for a page of results following the given page, with the same filters as the original query.

page

the previous page of results, which should have been produced with this query.

DeviceDataResultPage

struct DeviceDataResultPage : PagedResult, Decodable

A page of device data points.

deviceDataPoints
let deviceDataPoints: [DeviceDataPoint]

A list of DeviceDataPoints filtered by the query criteria.

nextPageID
let nextPageID: String?

An ID to be used with subsequent DeviceDataQuery requests. Results from queries using this ID as the pageID parameter will show the next page of results. nil if there isn’t a next page.

EmbeddableSurveyCompletionReason

struct EmbeddableSurveyCompletionReason : RawRepresentable, Equatable

Describes how a participant completed interaction with an embeddable survey.

See EmbeddableSurveyViewController for usage; note that your app must dismiss the EmbeddableSurveyViewController in all EmbeddableSurveyCompletionReason cases.

RawValue
associatedtype RawValue
completed
static let completed: MyDataHelpsKit.EmbeddableSurveyCompletionReason

Participant completed the survey, and the result was saved to MyDataHelps.

closed
static let closed: MyDataHelpsKit.EmbeddableSurveyCompletionReason

Participant did not complete the survey.

rawValue
let rawValue: String

The raw value for the completion reason.

init(rawValue:)
init(rawValue: String)

Initializes a EmbeddableSurveyCompletionReason with an arbitrary value. Consider using static members such as EmbeddableSurveyCompletionReason.completed in equality checks or switch statements when inspecting completion reasons returned by embeddable surveys.

rawValue

The raw value for the completion reason.

ExternalAccount

struct ExternalAccount : Decodable

An external account that the participant is currently connected to.

id
let id: Int

Assigned identifier for this connected external account.

status
let status: ExternalAccountStatus

The current status for this connected external account.

provider
let provider: ExternalAccountProvider

The provider for this external account.

lastRefreshDate
let lastRefreshDate: Date?

Date when the account last successfully refreshed.

ExternalAccountAuthorization

struct ExternalAccountAuthorization

Information for presenting a provider connection authorization UI to the participant.

For detailed usage info, see documentation for ParticipantSession.connectExternalAccount.

provider
let provider: ExternalAccountProvider

The provider to connect.

authorizationURL
let authorizationURL: URL

To begin the provider connection flow, your app must present an SFSafariViewController configured with this URL so that the participant can authorize the connection with the provider.

This is a unique URL specific to the participant; it provides a temporary authenticated session for use in the browser.

finalRedirectURL
let finalRedirectURL: URL

The URL specified in ParticipantSession.connectExternalAccount to indicate completion of the provider connection flow. When your app receives an incoming URL (via Universal Links or a custom scheme) that matches finalRedirectURL, the provider connection is complete and you can dismiss the SFSafariViewController.

ExternalAccountProvider

struct ExternalAccountProvider : Decodable

An external account provider supported by MyDataHelps.

Use ParticipantSession.connectExternalAccount to initiate a connected account between the participant and this provider.

id
let id: Int

Assigned identifier for this external account provider.

name
let name: String

Name of the external account provider.

category
let category: ExternalAccountProviderCategory

Type of account provider.

logoURL
let logoURL: URL?

Full URL from which the logo can be retrieved, if one is available for the provider.

This URL returns image data, e.g. image/png, suitable for decoding directly into a UIImage object and presenting in image views. It is a public URL with no authentication required. Image dimensions may vary, so it is recommended to display these images with aspect-fit scaling.

ExternalAccountProviderCategory

struct ExternalAccountProviderCategory : RawRepresentable, Equatable, Hashable, Decodable

The type of external account provider.

RawValue
associatedtype RawValue
provider
static let provider: MyDataHelpsKit.ExternalAccountProviderCategory

A generic provider type.

healthPlan
static let healthPlan: MyDataHelpsKit.ExternalAccountProviderCategory

A provider that represents a health plan.

deviceManufacturer
static let deviceManufacturer: MyDataHelpsKit.ExternalAccountProviderCategory

A provider that represents a device manufacturer.

rawValue
let rawValue: String

The raw value for the provider category as stored in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes an ExternalAccountProviderCategory with an arbitrary value. Consider using static members such as ExternalAccountProviderCategory.provider instead for known values.

rawValue

The raw value for the provider category as stored in MyDataHelps.

ExternalAccountProvidersQuery

struct ExternalAccountProvidersQuery

Specifies filtering criteria for external account provider queries. All filter criteria are optional; specifying no criteria will produce a list of all available external account providers.

search
let search: String?

Limit search results to account providers whose keyword, postal code, city, or state begins with the search string. Case-insensitive.

category
let category: ExternalAccountProviderCategory?

Limit search results to account providers with the specified category.

init(search: category:)
init(search: String? = nil, category: ExternalAccountProviderCategory? = nil)

Initializes a new query for external account providers with various filters.

search

Limit search results to account providers whose keyword, postal code, city, or state begins with the search string. Case-insensitive.

category

Limit search results to account providers with the specified category.

ExternalAccountStatus

struct ExternalAccountStatus : RawRepresentable, Equatable, Hashable, Decodable

Describes the status of fetching data for a connected external account.

RawValue
associatedtype RawValue
error
static let error: MyDataHelpsKit.ExternalAccountStatus

An error occurred while fetching data.

fetchComplete
static let fetchComplete: MyDataHelpsKit.ExternalAccountStatus

The connected external account has successfully retrieved data.

fetchingData
static let fetchingData: MyDataHelpsKit.ExternalAccountStatus

The connected external account is in the process of fetching data.

unauthorized
static let unauthorized: MyDataHelpsKit.ExternalAccountStatus

The external account connection was attempted, but not yet authorized.

rawValue
let rawValue: String

The raw value for the provider category as stored in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes an ExternalAccountProviderCategory with an arbitrary value. Consider using static members such as ExternalAccountProviderCategory.provider instead for known values.

rawValue

The raw value for the provider category as stored in MyDataHelps.

HTTPResponseError

struct HTTPResponseError : Error

Details about a failed HTTP request or an HTTP response that indicated an error.

statusCode
let statusCode: Int

HTTP status code, e.g. 500.

message
let message: String?

Error message encoded in the response body, if successfully parsed.

NotificationHistoryModel

struct NotificationHistoryModel : Decodable

Information about a notification for a participant.

id
let id: String

Auto-generated, globally-unique identifier for this notification.

identifier
let identifier: String

Identifier for the notification configuration.

sentDate
let sentDate: Date

If the notification was sent, the date at which the notification was sent.

statusCode
let statusCode: NotificationSendStatusCode

Describes whether the notification was sent.

content
let content: NotificationContent

The content of the notification, varying by the notification type.

Use content.type to determine the NotificationType value. The associated enum value of content contains the actual content, and may be nil if the notification was not sent successfully.

init(from:)
init(from decoder: Decoder) throws

Initializes from a decoder.

decoder

The decoder.

NotificationHistoryPage

struct NotificationHistoryPage : PagedResult, Decodable

A page of notifications.

notifications
let notifications: [NotificationHistoryModel]

A list of notifications filtered by the query criteria.

nextPageID
let nextPageID: String?

An ID to be used with subsequent NotificationHistoryQuery requests. Results from queries using this ID as the pageID parameter will show the next page of results. nil if there isn’t a next page.

NotificationHistoryQuery

struct NotificationHistoryQuery : PagedQuery

Specifies filtering and page-navigation criteria for participant notification queries.

All query properties are optional. Set non-nil/non-default values only for the properties you want to use for filtering.

defaultLimit
static let defaultLimit: Int

The default and maximum number of results per page.

identifier
let identifier: String?

Name of the configured notification.

sentAfter
let sentAfter: Date?

Notifications sent after this date.

sentBefore
let sentBefore: Date?

Notifications sent before this date.

type
let type: NotificationType?

Type of notification.

statusCode
let statusCode: NotificationSendStatusCode?

Describes whether the notification was sent.

limit
let limit: Int

Maximum number of results per page. Default and maximum value is 100.

pageID
let pageID: String?

Identifies a specific page of survey answers to fetch. Use nil to fetch the first page of results. To fetch the page following a given SurveyAnswersPage use its nextPageID; the other parameters should be the same as the original SurveyAnswersQuery.

init(identifier: sentAfter: sentBefore: type: statusCode: limit: pageID:)
init(identifier: String? = nil, sentAfter: Date? = nil, sentBefore: Date? = nil, type: NotificationType? = nil, statusCode: NotificationSendStatusCode? = nil, limit: Int = defaultLimit, pageID: String? = nil)

Initializes a new query for a page of notifications with various filters.

identifier

Name of the configured notification.

sentAfter

Notifications sent after this date.

sentBefore

Notifications sent before this date.

type

Type of notification.

statusCode

Describes whether the notification was sent.

limit

Maximum number of results per page.

pageID

Identifies a specific page of survey answers to fetch.

page(after:)
func page(after page: NotificationHistoryPage) -> NotificationHistoryQuery?

Initializes a new query for a page of results following the given page, with the same filters as the original query.

page

The previous page of results, which should have been produced with this query.

NotificationSendStatusCode

struct NotificationSendStatusCode : RawRepresentable, Equatable, Decodable

Describes whether a notification was sent to a participant.

RawValue
associatedtype RawValue
succeeded
static let succeeded: MyDataHelpsKit.NotificationSendStatusCode

The notification was sent. This does not guarantee it was received nor read.

unsubscribed
static let unsubscribed: MyDataHelpsKit.NotificationSendStatusCode

The notification could not be sent because the recipient unsubscribed their contact info from notifications.

missingContactInfo
static let missingContactInfo: MyDataHelpsKit.NotificationSendStatusCode

The notification could not be sent because contact info was not available.

noRegisteredMobileDevice
static let noRegisteredMobileDevice: MyDataHelpsKit.NotificationSendStatusCode

The notification could not be sent because a verified mobile device was not available.

noAssociatedUser
static let noAssociatedUser: MyDataHelpsKit.NotificationSendStatusCode

The notification could not be sent because the participant has not registered an account on MyDataHelps.

serviceError
static let serviceError: MyDataHelpsKit.NotificationSendStatusCode

The notification was not sent due to an error.

rawValue
let rawValue: String

The raw value for the status code as stored in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes a NotificationSendStatusCode with an arbitrary value. Consider using static members such as NotificationSendStatusCode.succeeded instead for known values.

rawValue

The raw value for the status code as stored in MyDataHelps.

Organization

struct Organization : Decodable

Information about an organization.

id
let id: String

Unique organization identifier.

name
let name: String

Organization name.

description
let description: String?

Organization description.

logoURL
let logoURL: URL

Full URL to the organization’s logo image.

This URL returns image data, e.g. image/png, suitable for decoding directly into a UIImage object and presenting in image views. It is a public URL with no authentication required. Image dimensions may vary, so it is recommended to display these images with aspect-fit scaling.

color
let color: String

The organization’s brand color, expressed as a hexadecimal string. For example, "#000000".

ParticipantAccessToken

struct ParticipantAccessToken

Represents an access token for a single participant.

See documentation on Participant Tokens for more information about obtaining an access token.

Warning: Never expose a service token in a client application or to the SDK. Use participant tokens instead.

init(token:)
init(token: String)

Initializes an access token with a given token value.

token

The token string, returned from an authentication provider.

ParticipantDemographics

struct ParticipantDemographics : Decodable

Demographic fields populated for a participant.

email
let email: String?

Participant’s email address.

mobilePhone
let mobilePhone: String?

Participant’s mobile phone number

firstName
let firstName: String?

Participant’s first name.

middleName
let middleName: String?

Participant’s middle name.

lastName
let lastName: String?

Participant’s last name.

street1
let street1: String?

A component of a participant’s street address.

street2
let street2: String?

A component of a participant’s street address.

city
let city: String?

A component of a participant’s street address.

state
let state: String?

A component of a participant’s street address.

postalCode
let postalCode: String?

A component of a participant’s street address.

dateOfBirth
let dateOfBirth: String?

Participant’s date of birth, with format yyyy-MM-dd.

preferredLanguage
let preferredLanguage: String?

Participant’s preferred language, as an ISO language code.

gender
let gender: ParticipantGender?

Participant’s gender.

utcOffset
let utcOffset: String?

Participant’s local time zone represented as a UTC offset, e.g., “-04:00:00”.

timeZone
let timeZone: String?

Participant’s local time zone identifier, e.g. "America/New_York".

isUnsubscribedFromEmails
var isUnsubscribedFromEmails: Bool { get }

Indicates that the participant has unsubscribed from MyDataHelps email notifications.

ParticipantGender

struct ParticipantGender : RawRepresentable, Equatable, Decodable

Participant’s gender.

RawValue
associatedtype RawValue
rawValue
let rawValue: String

The raw string encoding the gender value in MyDataHelps.

female
static let female: MyDataHelpsKit.ParticipantGender

Female gender as represented in MyDataHelps.

male
static let male: MyDataHelpsKit.ParticipantGender

Male gender as represented in MyDataHelps.

other
static let other: MyDataHelpsKit.ParticipantGender

Other gender as represented in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes a ParticipantGender with an arbitrary value. Consider using static members such as ParticipantGender.female instead for known values.

rawValue

The raw string value as represented in MyDataHelps.

ParticipantInfo

struct ParticipantInfo : Decodable

Information about a participant.

participantID
let participantID: String

Auto-generated internal ID for the participant.

projectID
let projectID: String

Auto-generated internal ID for the project.

participantIdentifier
let participantIdentifier: String

Project-specific participant identifier.

secondaryIdentifier
let secondaryIdentifier: String?

Project-specific secondary identifier.

linkIdentifier
let linkIdentifier: String?

Auto-generated identifier used to complete surveys via link, if that feature is enabled for the project.

demographics
let demographics: ParticipantDemographics

All demographic fields populated for the participant. Unpopulated values are nil.

customFields
let customFields: [String : String]

Key/value pairs representing project-specific custom fields.

enrollmentDate
let enrollmentDate: Date?

Date when the participant completed enrollment.

ProjectDataCollectionSettings

struct ProjectDataCollectionSettings : Decodable

Settings related to data collection for a participant and their project.

fitbitEnabled
let fitbitEnabled: Bool

Indicates whether Fitbit data collection is enabled for this project.

ehrEnabled
let ehrEnabled: Bool

Indicates whether Electronic Health Record data collection is enabled for this project.

airQualityEnabled
let airQualityEnabled: Bool

Indicates whether Air Quality data collection is enabled for this project.

weatherEnabled
let weatherEnabled: Bool

Indicates whether Weather data collection is enabled for this project.

queryableDeviceDataTypes
let queryableDeviceDataTypes: Set<QueryableDeviceDataType>

A collection of device data types that are supported by the current project configuration and can be queried using ParticipantSession.queryDeviceData. A participant may not have data available for all data types.

sensorDataCollectionEndDate
let sensorDataCollectionEndDate: Date?

Date when sensor data collection ended or will end for this participant.

More Info: Stopping Device Data Collection.

ProjectInfo

struct ProjectInfo : Decodable

Information about the project and its settings.

id
let id: String

Unique project identifier.

name
let name: String

Project’s display name, localized based on participant’s language settings.

description
var description: String?

Project’s display description, localized based on participant’s language settings.

code
let code: String

Code used by participants to enroll in this project, if code enrollment is allowed.

type
let type: ProjectType

Project type, displayed to participants and used to filter search results.

organization
let organization: Organization

Information about the organization for this project.

supportEmail
var supportEmail: String?

Contact email for project support displayed to participants.

supportPhone
var supportPhone: String?

Contact number for project support displayed to participants.

learnMoreURL
var learnMoreURL: URL? { get }

A URL where participants can learn more about the project.

learnMoreTitle
let learnMoreTitle: String?

Site name or title to use as a label for the learnMoreURL, localized based on participant’s language settings.

ProjectType

struct ProjectType : RawRepresentable, Equatable, Decodable

Describes the type of a MyDataHelps project.

rawValue
let rawValue: String

The raw value for the project type as stored in MyDataHelps.

researchStudy
static let researchStudy: MyDataHelpsKit.ProjectType

A research study.

wellnessProgram
static let wellnessProgram: MyDataHelpsKit.ProjectType

A wellness program.

clinicalProgram
static let clinicalProgram: MyDataHelpsKit.ProjectType

A clinical program.

init(rawValue:)
init(rawValue: String)

Initializes a ProjectType with an arbitrary value. Consider using static members such as ProjectType.researchStudy instead for known values.

rawValue

The raw value for the project type as stored in MyDataHelps.

QueryableDeviceDataType

struct QueryableDeviceDataType : Decodable, Equatable, Hashable

Information about a single device data type that is supported by the current project configuration and can be queried using the Device Data API.

namespace
let namespace: DeviceDataNamespace

The namespace to use when querying for device data.

type
let type: String

The type to use when querying for device data.

SurveyAnswer

struct SurveyAnswer : Decodable

A single survey answer completed by a participant.

id
let id: String

Auto-generated, globally-unique identifier.

surveyResultID
let surveyResultID: String

Auto-generated, globally-unique identifier for the survey submission containing this answer.

surveyID
let surveyID: String

Auto-generated, globally-unique identifier for the survey containing the step this answer was provided for.

surveyVersion
let surveyVersion: Int

Version number of the survey that the participant completed.

taskID
let taskID: String?

Auto-generated, globally-unique identifier for the task which prompted the participant to complete the survey, if any.

surveyName
let surveyName: String

Internal name for the survey in MyDataHelps.

surveyDisplayName
let surveyDisplayName: String

Name of the survey displayed to the participant.

date
let date: Date?

Date and time at which the survey answer was recorded by the participant.

insertedDate
let insertedDate: Date

Date and time at which the was submitted to the system.

stepIdentifier
let stepIdentifier: String

Identifier for the survey step for which the answer was submitted.

resultIdentifier
let resultIdentifier: String

Identifier for the result provided to a survey step, and which contains this survey answer.

answers
let answers: [String]

List of answers contained in the result for this step of the survey.

SurveyAnswersPage

struct SurveyAnswersPage : PagedResult, Decodable

A page of survey answers.

surveyAnswers
let surveyAnswers: [SurveyAnswer]

A list of SurveyAnswers filtered by the query criteria.

nextPageID
let nextPageID: String?

An ID to be used with subsequent SurveyAnswersQuery requests. Results from queries using this ID as the pageID parameter will show the next page of results. nil if there isn’t a next page.

SurveyAnswersQuery

struct SurveyAnswersQuery : PagedQuery

Specifies filtering and page-navigation criteria for survey answers.

All query properties are optional. Set non-nil/non-default values only for the properties you want to use for filtering.

You can filter survey answers by two different types of dates: before/after and insertedBefore/After. The former properties use the date the answer was recorded by the participant; the latter ones use the date the answer was submitted to the system. The dates may be appreciably different if the participant started a survey, answered a few questions, and then submitted it much later. There may also be minor variations due to the participant’s device time compared to the server time. Use the insertedAfter property to search for new answers since a prior query.

defaultLimit
static let defaultLimit: Int

The default and maximum number of results per page.

surveyResultID
let surveyResultID: String?

Auto-generated, globally-unique identifier for the survey submission containing the answer.

surveyID
let surveyID: String?

Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.

surveyNames
let surveyNames: Set<String>?

Filter by one or more internal names of the surveys which have the answers.

after
let after: Date?

Search for answers recorded by the participant after a specific date.

before
let before: Date?

Search for answers recorded by the participant before a specific date.

insertedAfter
let insertedAfter: Date?

Search for answers submitted to the system after a specific date.

insertedBefore
let insertedBefore: Date?

Search for answers submitted to the system before a specific date.

stepIdentifiers
let stepIdentifiers: Set<String>?

Filter by one or more identifiers for the survey steps for which answers were submitted.

resultIdentifiers
let resultIdentifiers: Set<String>?

Filter by one or more identifiers for the result provided to a survey step, and which contain survey answers.

answers
let answers: Set<String>?

Filter by one or more specific text values the answer contains.

limit
let limit: Int

Maximum number of results per page. Default and maximum value is 100.

pageID
let pageID: String?

Identifies a specific page of survey answers to fetch. Use nil to fetch the first page of results. To fetch the page following a given SurveyAnswersPage use its nextPageID; the other parameters should be the same as the original SurveyAnswersQuery.

init(surveyResultID: surveyID: surveyNames: after: before: insertedAfter: insertedBefore: stepIdentifiers: resultIdentifiers: answers: limit: pageID:)
init(surveyResultID: String? = nil, surveyID: String? = nil, surveyNames: Set<String>? = nil, after: Date? = nil, before: Date? = nil, insertedAfter: Date? = nil, insertedBefore: Date? = nil, stepIdentifiers: Set<String>? = nil, resultIdentifiers: Set<String>? = nil, answers: Set<String>? = nil, limit: Int = defaultLimit, pageID: String? = nil)

Initializes a new query for a page of survey answers with various filters.

surveyResultID

Auto-generated, globally-unique identifier for the survey submission containing the answer.

surveyID

Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.

surveyNames

Filter by one or more internal names of the surveys which have the answers.

after

Search for answers recorded by the participant after a specific date.

before

Search for answers recorded by the participant before a specific date.

insertedAfter

Search for answers submitted to the system after a specific date.

insertedBefore

Search for answers submitted to the system before a specific date.

stepIdentifiers

Filter by one or more identifiers for the survey steps for which answers were submitted.

resultIdentifiers

Filter by one or more identifiers for the result provided to a survey step, and which contain survey answers.

answers

Filter by one or more specific text values the answer contains.

limit

Maximum number of results per page.

pageID

Identifies a specific page of survey answers to fetch.

page(after:)
func page(after page: SurveyAnswersPage) -> SurveyAnswersQuery?

Initializes a new query for a page of results following the given page, with the same filters as the original query.

page

The previous page of results, which should have been produced with this query.

SurveyTask

struct SurveyTask : Decodable

A single survey task assigned to a participant.

id
let id: String

Auto-generated, globally-unique identifier.

linkIdentifier
let linkIdentifier: String?

Secure and unique identifier for the task, to be used publicly when providing links to a survey.

surveyID
let surveyID: String

Auto-generated, globally-unique identifier for the survey which this task assigns.

surveyName
let surveyName: String

Internal name for the survey in MyDataHelps which this task assigns.

surveyDisplayName
let surveyDisplayName: String

Name of the survey displayed to the participant, which this task assigns.

surveyDescription
let surveyDescription: String

Brief explanation of the survey provided to the participant.

startDate
let startDate: Date?

Initial time the task is available to the participant.

endDate
let endDate: Date?

Time at which the task becomes unavailable to the participant, because it was completed or closed.

status
let status: SurveyTaskStatus

Describes the status of the survey task.

hasSavedProgress
let hasSavedProgress: Bool

Indicates that the participant has opened the assigned survey and submitted at least one answer, without completing the task.

dueDate
let dueDate: Date?

Time that the survey becomes past due and closed.

insertedDate
let insertedDate: Date

Date when the survey task was first created.

modifiedDate
let modifiedDate: Date

Date when the survey task was last modified.

SurveyTaskQuery

struct SurveyTaskQuery : PagedQuery

Specifies filtering and page-navigation criteria for survey task queries.

All query properties are optional. Set non-nil/non-default values only for the properties you want to use for filtering or sorting.

SortOrder
enum MyDataHelpsKit.SurveyTaskQuery.SortOrder : String, Codable

Specifies sorting order for survey task results.

defaultLimit
static let defaultLimit: Int

The default and maximum number of results per page.

statuses
let statuses: Set<SurveyTaskStatus>?

Filter by one or more survey task status values.

surveyID
let surveyID: String?

Auto-generated, globally-unique identifier for the survey which this task assigns.

surveyNames
let surveyNames: Set<String>?

Internal name for the survey in MyDataHelps which this task assigns. Filter by one or more values.

linkIdentifier
let linkIdentifier: String?

Secure and unique identifier for the task, to be used publicly when providing links to a survey.

sortOrder
let sortOrder: SortOrder?

Return results in the specified order. Defaults to dateDescending.

limit
let limit: Int

Maximum number of results per page. Default and maximum value is 100.

pageID
let pageID: String?

Identifies a specific page of survey tasks to fetch. Use nil to fetch the first page of results. To fetch the page following a given SurveyTaskResultPage use its nextPageID; the other parameters should be the same as the original SurveyTaskQuery.

init(statuses: surveyID: surveyNames: linkIdentifier: sortOrder: limit: pageID:)
init(statuses: Set<SurveyTaskStatus>? = nil, surveyID: String? = nil, surveyNames: Set<String>? = nil, linkIdentifier: String? = nil, sortOrder: SurveyTaskQuery.SortOrder? = nil, limit: Int = defaultLimit, pageID: String? = nil)

Initializes a new query for a page of survey tasks with various filters.

statuses

Filter by one or more survey task status values.

surveyID

Auto-generated, globally-unique identifier for the survey which this task assigns.

surveyNames

Internal name for the survey in MyDataHelps which this task assigns.

linkIdentifier

Secure and unique identifier for the task, to be used publicly when providing links to a survey.

sortOrder

Return results in the specified order.

limit

Maximum number of results per page.

pageID

Identifies a specific page of survey tasks to fetch.

page(after:)
func page(after page: SurveyTaskResultPage) -> SurveyTaskQuery?

Initializes a new query for a page of results following the given page, with the same filters as the original query.

page

The previous page of results, which should have been produced with this query.

SurveyTaskResultPage

struct SurveyTaskResultPage : PagedResult, Decodable

A page of survey tasks.

surveyTasks
let surveyTasks: [SurveyTask]

A list of SurveyTasks filtered by the query criteria.

nextPageID
let nextPageID: String?

An ID to be used with subsequent SurveyTaskQuery requests. Results from queries using this ID as the pageID parameter will show the next page of results. nil if there isn’t a next page.

SurveyTaskStatus

struct SurveyTaskStatus : RawRepresentable, Equatable, Hashable, Decodable

Describes the status of a survey task assigned to a participant.

RawValue
associatedtype RawValue
incomplete
static let incomplete: MyDataHelpsKit.SurveyTaskStatus

Task is open and incomplete.

complete
static let complete: MyDataHelpsKit.SurveyTaskStatus

Task was completed.

closed
static let closed: MyDataHelpsKit.SurveyTaskStatus

Task was closed without being completed.

rawValue
let rawValue: String

The raw value for the task status as stored in MyDataHelps.

init(rawValue:)
init(rawValue: String)

Initializes a SurveyTaskStatus with an arbitrary value. Consider using static members such as SurveyTaskStatus.incomplete instead for known values.

rawValue

The raw value for the task status as stored in MyDataHelps.