/quantimodo-sdk-javascript

Library to make it easier for JavaScript apps to store and retrieve data using the QuantiModo API.

Primary LanguageJavaScriptMIT LicenseMIT

quantimodo

Quantimodo - JavaScript client for quantimodo QuantiModo makes it easy to retrieve normalized user data from a wide array of devices and applications. Learn about QuantiModo, check out our docs or contact us at help.quantimo.do.

Installation

npm

Then install it via:

npm install quantimodo --save

You should now be able to require('quantimodo') in javascript files from the directory you ran the last command above from.

For browser

bower install quantimodo --save

Then include lib/quantimodo/quantimodo-web.js in the HTML pages.

Getting Started

Please follow the installation instruction and execute the following JS code:

var Quantimodo = require('quantimodo');

var defaultClient = Quantimodo.ApiClient.instance;

// Configure API key authorization: access_token
var access_token = defaultClient.authentications['access_token'];
access_token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//access_token.apiKeyPrefix['access_token'] = "Token"

// Configure OAuth2 access token for authorization: quantimodo_oauth2
var quantimodo_oauth2 = defaultClient.authentications['quantimodo_oauth2'];
quantimodo_oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new Quantimodo.AnalyticsApi()

var body = new Quantimodo.VoteDelete(); // {VoteDelete} The cause and effect variable names for the predictor vote to be deleted.

var opts = { 
  'userId': 3.4, // {Number} User's id
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deleteVote(body, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://app.quantimo.do/api

Class Method HTTP request Description
Quantimodo.ActivitiesApi getActivities GET /v3/activities Get Activities
Quantimodo.ActivitiesApi postActivities POST /v3/activities Post Activities
Quantimodo.AnalyticsApi getCorrelationExplanations GET /v3/correlations/explanations Get correlation explanations
Quantimodo.AnalyticsApi getCorrelations GET /v3/correlations Get correlations
Quantimodo.AppSettingsApi getAppSettings GET /v3/appSettings Get client app settings
Quantimodo.AuthenticationApi getAccessToken GET /v3/oauth2/token Get a user access token
Quantimodo.AuthenticationApi getOauthAuthorizationCode GET /v3/oauth2/authorize Request Authorization Code
Quantimodo.AuthenticationApi postGoogleIdToken POST /v3/googleIdToken Post GoogleIdToken
Quantimodo.ConnectorsApi connectConnector GET /v3/connectors/{connectorName}/connect Obtain a token from 3rd party data source
Quantimodo.ConnectorsApi disconnectConnector GET /v3/connectors/{connectorName}/disconnect Delete stored connection info
Quantimodo.ConnectorsApi getConnectors GET /v3/connectors/list List of Connectors
Quantimodo.ConnectorsApi getIntegrationJs GET /v3/integration.js Get embeddable connect javascript
Quantimodo.ConnectorsApi getMobileConnectPage GET /v3/connect/mobile Mobile connect page
Quantimodo.ConnectorsApi updateConnector GET /v3/connectors/{connectorName}/update Sync with data source
Quantimodo.FeedApi getFeed GET /v3/feed Tracking reminder notifications, messages, and study results
Quantimodo.FeedApi postFeed POST /v3/feed Post user interactions with feed
Quantimodo.FriendsApi getFriends GET /v3/friends Get Friends
Quantimodo.FriendsApi postFriends POST /v3/friends Post Friends
Quantimodo.GroupsApi getGroups GET /v3/groups Get Groups
Quantimodo.GroupsApi getGroupsMembers GET /v3/groupsMembers Get GroupsMembers
Quantimodo.GroupsApi postGroups POST /v3/groups Post Groups
Quantimodo.GroupsApi postGroupsMembers POST /v3/groupsMembers Post GroupsMembers
Quantimodo.MeasurementsApi deleteMeasurement DELETE /v3/measurements/delete Delete a measurement
Quantimodo.MeasurementsApi getMeasurements GET /v3/measurements Get measurements for this user
Quantimodo.MeasurementsApi getPairs GET /v3/pairs Get pairs of measurements for correlational analysis
Quantimodo.MeasurementsApi measurementExportRequest POST /v2/measurements/exportRequest Post Request for Measurements CSV
Quantimodo.MeasurementsApi postMeasurements POST /v3/measurements/post Post a new set or update existing measurements to the database
Quantimodo.MeasurementsApi updateMeasurement POST /v3/measurements/update Update a measurement
Quantimodo.MessagesApi getMessagesMessages GET /v3/messagesMessages Get MessagesMessages
Quantimodo.MessagesApi getMessagesNotices GET /v3/messagesNotices Get MessagesNotices
Quantimodo.MessagesApi getMessagesRecipients GET /v3/messagesRecipients Get MessagesRecipients
Quantimodo.MessagesApi postMessagesMessages POST /v3/messagesMessages Post MessagesMessages
Quantimodo.MessagesApi postMessagesNotices POST /v3/messagesNotices Post MessagesNotices
Quantimodo.MessagesApi postMessagesRecipients POST /v3/messagesRecipients Post MessagesRecipients
Quantimodo.NotificationsApi getNotificationPreferences GET /v3/notificationPreferences Get NotificationPreferences
Quantimodo.NotificationsApi getNotifications GET /v3/notifications Get Notifications
Quantimodo.NotificationsApi postDeviceToken POST /v3/deviceTokens Post DeviceTokens
Quantimodo.NotificationsApi postNotifications POST /v3/notifications Post Notifications
Quantimodo.RemindersApi deleteTrackingReminder DELETE /v3/trackingReminders/delete Delete Tracking Reminder
Quantimodo.RemindersApi getTrackingReminderNotifications GET /v3/trackingReminderNotifications Get specific tracking reminder notifications
Quantimodo.RemindersApi getTrackingReminders GET /v3/trackingReminders Get repeating tracking reminder settings
Quantimodo.RemindersApi postTrackingReminderNotifications POST /v3/trackingReminderNotifications Snooze, skip, or track a tracking reminder notification
Quantimodo.RemindersApi postTrackingReminders POST /v3/trackingReminders Store a Tracking Reminder
Quantimodo.SharesApi deleteShare POST /v3/shares/delete Delete share
Quantimodo.SharesApi getShares GET /v3/shares Get Authorized Apps, Studies, and Individuals
Quantimodo.SharesApi inviteShare POST /v3/shares/invite Delete share
Quantimodo.StudiesApi createStudy POST /v3/study/create Create a Study
Quantimodo.StudiesApi deleteVote DELETE /v3/votes/delete Delete vote
Quantimodo.StudiesApi getOpenStudies GET /v3/studies/open These are open studies that anyone can join
Quantimodo.StudiesApi getStudies GET /v3/studies Get Personal or Population Studies
Quantimodo.StudiesApi getStudiesCreated GET /v3/studies/created Get studies you have created
Quantimodo.StudiesApi getStudiesJoined GET /v3/studies/joined Studies You Have Joined
Quantimodo.StudiesApi getStudy GET /v4/study Get Study
Quantimodo.StudiesApi joinStudy POST /v3/study/join Join a Study
Quantimodo.StudiesApi postVote POST /v3/votes Post or update vote
Quantimodo.StudiesApi publishStudy POST /v3/study/publish Publish Your Study
Quantimodo.UnitsApi getUnitCategories GET /v3/unitCategories Get unit categories
Quantimodo.UnitsApi getUnits GET /v3/units Get units
Quantimodo.UserApi deleteUser DELETE /v3/user/delete Delete user
Quantimodo.UserApi getUser GET /v3/user Get user info
Quantimodo.UserApi getUserBlogs GET /v3/userBlogs Get UserBlogs
Quantimodo.UserApi getUsers GET /v3/users Get users who shared data
Quantimodo.UserApi postUserBlogs POST /v3/userBlogs Post UserBlogs
Quantimodo.UserApi postUserSettings POST /v3/userSettings Post UserSettings
Quantimodo.VariablesApi deleteUserTag DELETE /v3/userTags/delete Delete user tag or ingredient
Quantimodo.VariablesApi deleteUserVariable DELETE /v3/userVariables/delete Delete All Measurements For Variable
Quantimodo.VariablesApi getVariableCategories GET /v3/variableCategories Variable categories
Quantimodo.VariablesApi getVariables GET /v3/variables Get variables along with related user-specific analysis settings and statistics
Quantimodo.VariablesApi postUserTags POST /v3/userTags Post or update user tags or ingredients
Quantimodo.VariablesApi postUserVariables POST /v3/variables Update User Settings for a Variable
Quantimodo.VariablesApi resetUserVariableSettings POST /v3/userVariables/reset Reset user settings for a variable to defaults
Quantimodo.XprofileApi getXprofileData GET /v3/xprofileData Get XprofileData
Quantimodo.XprofileApi getXprofileFields GET /v3/xprofileFields Get XprofileFields
Quantimodo.XprofileApi getXprofileGroups GET /v3/xprofileGroups Get XprofileGroups
Quantimodo.XprofileApi postXprofileData POST /v3/xprofileData Post XprofileData
Quantimodo.XprofileApi postXprofileFields POST /v3/xprofileFields Post XprofileFields
Quantimodo.XprofileApi postXprofileGroups POST /v3/xprofileGroups Post XprofileGroups

Documentation for Models

Documentation for Authorization

access_token

  • Type: API key
  • API key parameter name: access_token
  • Location: URL query string

client_id

  • Type: API key
  • API key parameter name: clientId
  • Location: URL query string

quantimodo_oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://app.quantimo.do/api/v1/oauth/authorize
  • Scopes:
    • basic: Allows you to read user info (display name, email, etc)
    • readmeasurements: Allows one to read a user's measurements
    • writemeasurements: Allows you to write user measurements