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.
let maxRequestsPerHour: Int
Number of requests allowed per hour (total) for this scope.
let remainingRequests: Int
Number of requests remaining this hour for this scope.
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.
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.
associatedtype RawValue
static let project: MyDataHelpsKit.DeviceDataNamespace
Project-specific device data.
static let fitbit: MyDataHelpsKit.DeviceDataNamespace
Data imported from a linked Fitbit account.
static let appleHealth: MyDataHelpsKit.DeviceDataNamespace
Data imported from a linked Apple Health account.
static let googleFit: MyDataHelpsKit.DeviceDataNamespace
Data imported from a linked Google Fit account.
static let airNowApi: MyDataHelpsKit.DeviceDataNamespace
Air quality index data imported from AirNow.gov.
static let weatherBit: MyDataHelpsKit.DeviceDataNamespace
Weather forecast data imported from WeatherBit.io.
static let omron: MyDataHelpsKit.DeviceDataNamespace
Data imported from Omron wellness products.
let rawValue: String
The raw value for the namespace as stored in MyDataHelps.
init(rawValue: String)
Initializes a DeviceDataNamespace
with an arbitrary value. Consider using static members such as DeviceDataNamespace.project
instead for known values.
The raw value for the namespace as stored in MyDataHelps.
struct DeviceDataPoint : Decodable
A single device data point stored in MyDataHelps.
let id: String
Auto-generated, globally-unique identifier.
let namespace: DeviceDataNamespace
Identifies device data as from a specific source system.
let deviceDataContextID: String?
Auto-generated, globally-unique identifier for a group of device data points, which share some context.
let insertedDate: Date
Date when the data point was first added.
let modifiedDate: Date
Date when the data point was last updated in the system.
let identifier: String?
String used to name a device data point.
let type: String
The type of device data within its namespace, e.g. “HeartRate”.
let value: String
The value of the recorded device data point.
let units: String?
The units, if any, that the device data was recorded in.
let properties: [String : String]
Properties of the device data point.
let source: DeviceDataPointSource?
Identifying information about the device which recorded the data point.
let startDate: Date?
The date at which this device data point began being recorded (for data that is recorded over time).
let observationDate: Date?
The date at which this device data point was completely recorded.
struct DeviceDataPointPersistModel : Encodable
Describes a device data point to create or update.
let identifier: String
String used to name a device data point. Natural Key property.
let type: String
The general category this device data point belongs in, or what the device data represents. Natural Key property.
let value: String
The value of the recorded data point.
let units: String?
The units, if any, that the data was recorded in.
let properties: [String : String]
Properties of the device data point.
let source: DeviceDataPointSource?
Identifying information about the device which recorded the data point.
let startDate: Date?
The date at which this device data point began being recorded (for data that is recorded over time). Natural Key property.
let observationDate: Date?
The date at which this device data point was completely recorded. Natural Key property.
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.
String used to name a device data point. Natural Key property.
The general category this device data point belongs in, or what the device data represents. Natural Key property.
The value of the recorded data point.
The units, if any, that the data was recorded in.
Properties of the device data point.
Identifying information about the device which recorded the data point.
The date at which this device data point began being recorded (for data that is recorded over time). Natural Key property.
The date at which this device data point was completely recorded. Natural Key property.
struct DeviceDataPointSource : Codable
Identifying information about the device which recorded a data point.
let identifier: String
Identifying string for the data source.
let properties: [String : String]
Properties describing the device data source.
init(identifier: String, properties: [String : String])
Initializes a new DeviceDataPointSource.
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.
static let defaultLimit: Int
The default and maximum number of results per page.
let namespace: DeviceDataNamespace
Specifies the source framework for the device data.
let types: Set<String>?
Filter by one or more types/categories within the given namespace, e.g. “HeartRate”
let observedAfter: Date?
Search for device data points observed after this date.
let observedBefore: Date?
Search for device data points observed before this date.
let modifiedAfter: Date?
Search for device data points updated in the system after this date.
let modifiedBefore: Date?
Search for device data points updated in the system before this date.
let limit: Int
Maximum number of results per page. Default and maximum value is 100.
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: 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.
Specifies the source framework for the device data.
Filter by one or more types/categories within the given namespace, e.g. “HeartRate”.
Search for device data points observed after this date.
Search for device data points observed before this date.
Search for device data points updated in the system after this date.
Search for device data points updated in the system before this date.
Maximum number of results per page.
Identifies a specific page of data to fetch.
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.
the previous page of results, which should have been produced with this query.
struct DeviceDataResultPage : PagedResult, Decodable
A page of device data points.
let deviceDataPoints: [DeviceDataPoint]
A list of DeviceDataPoints filtered by the query criteria.
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.
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.
associatedtype RawValue
static let completed: MyDataHelpsKit.EmbeddableSurveyCompletionReason
Participant completed the survey, and the result was saved to MyDataHelps.
static let closed: MyDataHelpsKit.EmbeddableSurveyCompletionReason
Participant did not complete the survey.
let rawValue: String
The raw value for the completion reason.
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.
The raw value for the completion reason.
struct ExternalAccount : Decodable
An external account that the participant is currently connected to.
let id: Int
Assigned identifier for this connected external account.
let status: ExternalAccountStatus
The current status for this connected external account.
let provider: ExternalAccountProvider
The provider for this external account.
let lastRefreshDate: Date?
Date when the account last successfully refreshed.
struct ExternalAccountAuthorization
Information for presenting a provider connection authorization UI to the participant.
For detailed usage info, see documentation for ParticipantSession.connectExternalAccount
.
let provider: ExternalAccountProvider
The provider to connect.
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.
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
.
struct ExternalAccountProvider : Decodable
An external account provider supported by MyDataHelps.
Use ParticipantSession.connectExternalAccount
to initiate a connected account between the participant and this provider.
let id: Int
Assigned identifier for this external account provider.
let name: String
Name of the external account provider.
let category: ExternalAccountProviderCategory
Type of account provider.
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.
struct ExternalAccountProviderCategory : RawRepresentable, Equatable, Hashable, Decodable
The type of external account provider.
associatedtype RawValue
static let provider: MyDataHelpsKit.ExternalAccountProviderCategory
A generic provider type.
static let healthPlan: MyDataHelpsKit.ExternalAccountProviderCategory
A provider that represents a health plan.
static let deviceManufacturer: MyDataHelpsKit.ExternalAccountProviderCategory
A provider that represents a device manufacturer.
let rawValue: String
The raw value for the provider category as stored in MyDataHelps.
init(rawValue: String)
Initializes an ExternalAccountProviderCategory
with an arbitrary value. Consider using static members such as ExternalAccountProviderCategory.provider
instead for known values.
The raw value for the provider category as stored in MyDataHelps.
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.
let search: String?
Limit search results to account providers whose keyword, postal code, city, or state begins with the search string. Case-insensitive.
let category: ExternalAccountProviderCategory?
Limit search results to account providers with the specified category.
init(search: String? = nil, category: ExternalAccountProviderCategory? = nil)
Initializes a new query for external account providers with various filters.
Limit search results to account providers whose keyword, postal code, city, or state begins with the search string. Case-insensitive.
Limit search results to account providers with the specified category.
struct ExternalAccountStatus : RawRepresentable, Equatable, Hashable, Decodable
Describes the status of fetching data for a connected external account.
associatedtype RawValue
static let error: MyDataHelpsKit.ExternalAccountStatus
An error occurred while fetching data.
static let fetchComplete: MyDataHelpsKit.ExternalAccountStatus
The connected external account has successfully retrieved data.
static let fetchingData: MyDataHelpsKit.ExternalAccountStatus
The connected external account is in the process of fetching data.
static let unauthorized: MyDataHelpsKit.ExternalAccountStatus
The external account connection was attempted, but not yet authorized.
let rawValue: String
The raw value for the provider category as stored in MyDataHelps.
init(rawValue: String)
Initializes an ExternalAccountProviderCategory
with an arbitrary value. Consider using static members such as ExternalAccountProviderCategory.provider
instead for known values.
The raw value for the provider category as stored in MyDataHelps.
struct HTTPResponseError : Error
Details about a failed HTTP request or an HTTP response that indicated an error.
let statusCode: Int
HTTP status code, e.g. 500.
let message: String?
Error message encoded in the response body, if successfully parsed.
struct NotificationHistoryModel : Decodable
Information about a notification for a participant.
let id: String
Auto-generated, globally-unique identifier for this notification.
let identifier: String
Identifier for the notification configuration.
let sentDate: Date
If the notification was sent, the date at which the notification was sent.
let statusCode: NotificationSendStatusCode
Describes whether the notification was sent.
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 decoder: Decoder) throws
Initializes from a decoder.
The decoder.
struct NotificationHistoryPage : PagedResult, Decodable
A page of notifications.
let notifications: [NotificationHistoryModel]
A list of notifications filtered by the query criteria.
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.
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.
static let defaultLimit: Int
The default and maximum number of results per page.
let identifier: String?
Name of the configured notification.
let sentAfter: Date?
Notifications sent after this date.
let sentBefore: Date?
Notifications sent before this date.
let type: NotificationType?
Type of notification.
let statusCode: NotificationSendStatusCode?
Describes whether the notification was sent.
let limit: Int
Maximum number of results per page. Default and maximum value is 100.
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: 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.
Name of the configured notification.
Notifications sent after this date.
Notifications sent before this date.
Type of notification.
Describes whether the notification was sent.
Maximum number of results per page.
Identifies a specific page of survey answers to fetch.
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.
The previous page of results, which should have been produced with this query.
struct NotificationSendStatusCode : RawRepresentable, Equatable, Decodable
Describes whether a notification was sent to a participant.
associatedtype RawValue
static let succeeded: MyDataHelpsKit.NotificationSendStatusCode
The notification was sent. This does not guarantee it was received nor read.
static let unsubscribed: MyDataHelpsKit.NotificationSendStatusCode
The notification could not be sent because the recipient unsubscribed their contact info from notifications.
static let missingContactInfo: MyDataHelpsKit.NotificationSendStatusCode
The notification could not be sent because contact info was not available.
static let noRegisteredMobileDevice: MyDataHelpsKit.NotificationSendStatusCode
The notification could not be sent because a verified mobile device was not available.
static let noAssociatedUser: MyDataHelpsKit.NotificationSendStatusCode
The notification could not be sent because the participant has not registered an account on MyDataHelps.
static let serviceError: MyDataHelpsKit.NotificationSendStatusCode
The notification was not sent due to an error.
let rawValue: String
The raw value for the status code as stored in MyDataHelps.
init(rawValue: String)
Initializes a NotificationSendStatusCode
with an arbitrary value. Consider using static members such as NotificationSendStatusCode.succeeded
instead for known values.
The raw value for the status code as stored in MyDataHelps.
struct Organization : Decodable
Information about an organization.
let id: String
Unique organization identifier.
let name: String
Organization name.
let description: String?
Organization description.
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.
let color: String
The organization’s brand color, expressed as a hexadecimal string. For example, "#000000"
.
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: String)
Initializes an access token with a given token value.
The token string, returned from an authentication provider.
struct ParticipantDemographics : Decodable
Demographic fields populated for a participant.
let email: String?
Participant’s email address.
let mobilePhone: String?
Participant’s mobile phone number
let firstName: String?
Participant’s first name.
let middleName: String?
Participant’s middle name.
let lastName: String?
Participant’s last name.
let street1: String?
A component of a participant’s street address.
let street2: String?
A component of a participant’s street address.
let city: String?
A component of a participant’s street address.
let state: String?
A component of a participant’s street address.
let postalCode: String?
A component of a participant’s street address.
let dateOfBirth: String?
Participant’s date of birth, with format yyyy-MM-dd
.
let preferredLanguage: String?
Participant’s preferred language, as an ISO language code.
let gender: ParticipantGender?
Participant’s gender.
let utcOffset: String?
Participant’s local time zone represented as a UTC offset, e.g., “-04:00:00”.
let timeZone: String?
Participant’s local time zone identifier, e.g. "America/New_York"
.
var isUnsubscribedFromEmails: Bool { get }
Indicates that the participant has unsubscribed from MyDataHelps email notifications.
struct ParticipantGender : RawRepresentable, Equatable, Decodable
Participant’s gender.
associatedtype RawValue
let rawValue: String
The raw string encoding the gender value in MyDataHelps.
static let female: MyDataHelpsKit.ParticipantGender
Female gender as represented in MyDataHelps.
static let male: MyDataHelpsKit.ParticipantGender
Male gender as represented in MyDataHelps.
static let other: MyDataHelpsKit.ParticipantGender
Other gender as represented in MyDataHelps.
init(rawValue: String)
Initializes a ParticipantGender
with an arbitrary value. Consider using static members such as ParticipantGender.female
instead for known values.
The raw string value as represented in MyDataHelps.
struct ParticipantInfo : Decodable
Information about a participant.
let participantID: String
Auto-generated internal ID for the participant.
let projectID: String
Auto-generated internal ID for the project.
let participantIdentifier: String
Project-specific participant identifier.
let secondaryIdentifier: String?
Project-specific secondary identifier.
let linkIdentifier: String?
Auto-generated identifier used to complete surveys via link, if that feature is enabled for the project.
let demographics: ParticipantDemographics
All demographic fields populated for the participant. Unpopulated values are nil
.
let customFields: [String : String]
Key/value pairs representing project-specific custom fields.
let enrollmentDate: Date?
Date when the participant completed enrollment.
struct ProjectDataCollectionSettings : Decodable
Settings related to data collection for a participant and their project.
let fitbitEnabled: Bool
Indicates whether Fitbit data collection is enabled for this project.
let ehrEnabled: Bool
Indicates whether Electronic Health Record data collection is enabled for this project.
let airQualityEnabled: Bool
Indicates whether Air Quality data collection is enabled for this project.
let weatherEnabled: Bool
Indicates whether Weather data collection is enabled for this project.
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.
let sensorDataCollectionEndDate: Date?
Date when sensor data collection ended or will end for this participant.
More Info: Stopping Device Data Collection.
struct ProjectInfo : Decodable
Information about the project and its settings.
let id: String
Unique project identifier.
let name: String
Project’s display name, localized based on participant’s language settings.
var description: String?
Project’s display description, localized based on participant’s language settings.
let code: String
Code used by participants to enroll in this project, if code enrollment is allowed.
let type: ProjectType
Project type, displayed to participants and used to filter search results.
let organization: Organization
Information about the organization for this project.
var supportEmail: String?
Contact email for project support displayed to participants.
var supportPhone: String?
Contact number for project support displayed to participants.
var learnMoreURL: URL? { get }
A URL where participants can learn more about the project.
let learnMoreTitle: String?
Site name or title to use as a label for the learnMoreURL
, localized based on participant’s language settings.
struct ProjectType : RawRepresentable, Equatable, Decodable
Describes the type of a MyDataHelps project.
let rawValue: String
The raw value for the project type as stored in MyDataHelps.
static let researchStudy: MyDataHelpsKit.ProjectType
A research study.
static let wellnessProgram: MyDataHelpsKit.ProjectType
A wellness program.
static let clinicalProgram: MyDataHelpsKit.ProjectType
A clinical program.
init(rawValue: String)
Initializes a ProjectType
with an arbitrary value. Consider using static members such as ProjectType.researchStudy
instead for known values.
The raw value for the project type as stored in MyDataHelps.
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.
let namespace: DeviceDataNamespace
The namespace to use when querying for device data.
let type: String
The type to use when querying for device data.
struct SurveyAnswer : Decodable
A single survey answer completed by a participant.
let id: String
Auto-generated, globally-unique identifier.
let surveyResultID: String
Auto-generated, globally-unique identifier for the survey submission containing this answer.
let surveyID: String
Auto-generated, globally-unique identifier for the survey containing the step this answer was provided for.
let surveyVersion: Int
Version number of the survey that the participant completed.
let taskID: String?
Auto-generated, globally-unique identifier for the task which prompted the participant to complete the survey, if any.
let surveyName: String
Internal name for the survey in MyDataHelps.
let surveyDisplayName: String
Name of the survey displayed to the participant.
let date: Date?
Date and time at which the survey answer was recorded by the participant.
let insertedDate: Date
Date and time at which the was submitted to the system.
let stepIdentifier: String
Identifier for the survey step for which the answer was submitted.
let resultIdentifier: String
Identifier for the result provided to a survey step, and which contains this survey answer.
let answers: [String]
List of answers contained in the result for this step of the survey.
struct SurveyAnswersPage : PagedResult, Decodable
A page of survey answers.
let surveyAnswers: [SurveyAnswer]
A list of SurveyAnswers filtered by the query criteria.
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.
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.
static let defaultLimit: Int
The default and maximum number of results per page.
let surveyResultID: String?
Auto-generated, globally-unique identifier for the survey submission containing the answer.
let surveyID: String?
Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.
let surveyNames: Set<String>?
Filter by one or more internal names of the surveys which have the answers.
let after: Date?
Search for answers recorded by the participant after a specific date.
let before: Date?
Search for answers recorded by the participant before a specific date.
let insertedAfter: Date?
Search for answers submitted to the system after a specific date.
let insertedBefore: Date?
Search for answers submitted to the system before a specific date.
let stepIdentifiers: Set<String>?
Filter by one or more identifiers for the survey steps for which answers were submitted.
let resultIdentifiers: Set<String>?
Filter by one or more identifiers for the result provided to a survey step, and which contain survey answers.
let answers: Set<String>?
Filter by one or more specific text values the answer contains.
let limit: Int
Maximum number of results per page. Default and maximum value is 100.
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: 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.
Auto-generated, globally-unique identifier for the survey submission containing the answer.
Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.
Filter by one or more internal names of the surveys which have the answers.
Search for answers recorded by the participant after a specific date.
Search for answers recorded by the participant before a specific date.
Search for answers submitted to the system after a specific date.
Search for answers submitted to the system before a specific date.
Filter by one or more identifiers for the survey steps for which answers were submitted.
Filter by one or more identifiers for the result provided to a survey step, and which contain survey answers.
Filter by one or more specific text values the answer contains.
Maximum number of results per page.
Identifies a specific page of survey answers to fetch.
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.
The previous page of results, which should have been produced with this query.
struct SurveyTask : Decodable
A single survey task assigned to a participant.
let id: String
Auto-generated, globally-unique identifier.
let linkIdentifier: String?
Secure and unique identifier for the task, to be used publicly when providing links to a survey.
let surveyID: String
Auto-generated, globally-unique identifier for the survey which this task assigns.
let surveyName: String
Internal name for the survey in MyDataHelps which this task assigns.
let surveyDisplayName: String
Name of the survey displayed to the participant, which this task assigns.
let surveyDescription: String
Brief explanation of the survey provided to the participant.
let startDate: Date?
Initial time the task is available to the participant.
let endDate: Date?
Time at which the task becomes unavailable to the participant, because it was completed or closed.
let status: SurveyTaskStatus
Describes the status of the survey task.
let hasSavedProgress: Bool
Indicates that the participant has opened the assigned survey and submitted at least one answer, without completing the task.
let dueDate: Date?
Time that the survey becomes past due and closed.
let insertedDate: Date
Date when the survey task was first created.
let modifiedDate: Date
Date when the survey task was last modified.
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.
enum MyDataHelpsKit.SurveyTaskQuery.SortOrder : String, Codable
Specifies sorting order for survey task results.
static let defaultLimit: Int
The default and maximum number of results per page.
let statuses: Set<SurveyTaskStatus>?
Filter by one or more survey task status values.
let surveyID: String?
Auto-generated, globally-unique identifier for the survey which this task assigns.
let surveyNames: Set<String>?
Internal name for the survey in MyDataHelps which this task assigns. Filter by one or more values.
let linkIdentifier: String?
Secure and unique identifier for the task, to be used publicly when providing links to a survey.
let sortOrder: SortOrder?
Return results in the specified order. Defaults to dateDescending
.
let limit: Int
Maximum number of results per page. Default and maximum value is 100.
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: 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.
Filter by one or more survey task status values.
Auto-generated, globally-unique identifier for the survey which this task assigns.
Internal name for the survey in MyDataHelps which this task assigns.
Secure and unique identifier for the task, to be used publicly when providing links to a survey.
Return results in the specified order.
Maximum number of results per page.
Identifies a specific page of survey tasks to fetch.
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.
The previous page of results, which should have been produced with this query.
struct SurveyTaskResultPage : PagedResult, Decodable
A page of survey tasks.
let surveyTasks: [SurveyTask]
A list of SurveyTasks filtered by the query criteria.
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.
struct SurveyTaskStatus : RawRepresentable, Equatable, Hashable, Decodable
Describes the status of a survey task assigned to a participant.
associatedtype RawValue
static let incomplete: MyDataHelpsKit.SurveyTaskStatus
Task is open and incomplete.
static let complete: MyDataHelpsKit.SurveyTaskStatus
Task was completed.
static let closed: MyDataHelpsKit.SurveyTaskStatus
Task was closed without being completed.
let rawValue: String
The raw value for the task status as stored in MyDataHelps.
init(rawValue: String)
Initializes a SurveyTaskStatus
with an arbitrary value. Consider using static members such as SurveyTaskStatus.incomplete
instead for known values.
The raw value for the task status as stored in MyDataHelps.