Skip to content

Easily aggregate, store, and analyze your users life-tracking data using the QuantiModo API!

License

Notifications You must be signed in to change notification settings

QuantiModo/quantimodo-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for swagger

Welcome to QuantiModo API! QuantiModo makes it easy to retrieve normalized user data from a wide array of devices and applications. Learn about QuantiModo or contact us at [email protected]. Before you get started, you will need to: * Sign in/Sign up, and add some data at https://app.quantimo.do/api/v2/account/connectors to try out the API for yourself * Create an app to get your client id and secret at https://app.quantimo.do/api/v2/apps * As long as you're signed in, it will use your browser's cookie for authentication. However, client applications must use OAuth2 tokens to access the API. ## Application Endpoints These endpoints give you access to all authorized users' data for that application. ### Getting Application Token Make a POST request to /api/v2/oauth/access_token * grant_type Must be client_credentials. * clientId Your application's clientId. * client_secret Your application's client_secret. * redirect_uri Your application's redirect url. ## Example Queries ### Query Options The standard query options for QuantiModo API are as described in the table below. These are the available query options in QuantiModo API:

Parameter Description
limit The LIMIT is used to limit the number of results returned. So if you have 1000 results, but only want to the first 10, you would set this to 10 and offset to 0. The maximum limit is 200 records.
offset Suppose you wanted to show results 11-20. You'd set the offset to 10 and the limit to 10.
sort Sort by given field. If the field is prefixed with '-', it will sort in descending order.
### Pagination Conventions Since the maximum limit is 200 records, to get more than that you'll have to make multiple API calls and page through the results. To retrieve all the data, you can iterate through data by using the limit and offset query parameters.For example, if you want to retrieve data from 61-80 then you can use a query with the following parameters, /v2/variables?limit=20&offset=60 Generally, you'll be retrieving new or updated user data. To avoid unnecessary API calls, you'll want to store your last refresh time locally. Initially, it should be set to 0. Then whenever you make a request to get new data, you should limit the returned results to those updated since your last refresh by appending append ?lastUpdated=(ge)&quot2013-01-D01T01:01:01&quot to your request. Also for better pagination, you can get link to the records of first, last, next and previous page from response headers: * Total-Count - Total number of results for given query * Link-First - Link to get first page records * Link-Last - Link to get last page records * Link-Prev - Link to get previous records set * Link-Next - Link to get next records set Remember, response header will be only sent when the record set is available. e.g. You will not get a Link-Last & Link-Next when you query for the last page. ### Filter operators support API supports the following operators with filter parameters:
Comparison operators Comparison operators allow you to limit results to those greater than, less than, or equal to a specified value for a specified attribute. These operators can be used with strings, numbers, and dates. The following comparison operators are available: * gt for greater than comparison * ge for greater than or equal comparison * lt for less than comparison * le for less than or equal comparison They are included in queries using the following format: (<operator>)<value> For example, in order to filter value which is greater than 21, the following query parameter should be used: ?value=(gt)21

Equals/In Operators It also allows filtering by the exact value of an attribute or by a set of values, depending on the type of value passed as a query parameter. If the value contains commas, the parameter is split on commas and used as array input for IN filtering, otherwise the exact match is applied. In order to only show records which have the value 42, the following query should be used: ?value=42 In order to filter records which have value 42 or 43, the following query should be used: ?value=42,43

Like operators Like operators allow filtering using LIKE query. This operator is triggered if exact match operator is used, but value contains % sign as the first or last character. In order to filter records which category that start with Food, the following query should be used: ?category=Food%

Negation operator It is possible to get negated results of a query by prefixed the operator with !. Some examples: //filter records except those with value are not 42 or 43
?value=!42,43 //filter records with value not greater than 21
?value=!(ge)21

Multiple constraints for single attribute It is possible to apply multiple constraints by providing an array of query filters: Filter all records which value is greater than 20.2 and less than 20.3
?value[]=(gt)20.2&value[]=(lt)20.3 Filter all records which value is greater than 20.2 and less than 20.3 but not 20.2778
?value[]=(gt)20.2&value[]=(lt)20.3&value[]=!20.2778

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.6
  • Package version: 1.0.0
  • Build date: 2016-07-27T03:54:29.559Z
  • Build package: class io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

    "./swagger"

Documentation for API Endpoints

All URIs are relative to https://localhost/api

Class Method HTTP request Description
ApplicationEndpointsApi V2ApplicationConnectionsGet Get /v2/application/connections Get all Connections
ApplicationEndpointsApi V2ApplicationCredentialsGet Get /v2/application/credentials Get all Credentials
ApplicationEndpointsApi V2ApplicationMeasurementsGet Get /v2/application/measurements Get measurements for all users using your application
ApplicationEndpointsApi V2ApplicationTrackingRemindersGet Get /v2/application/trackingReminders Get tracking reminders
ApplicationEndpointsApi V2ApplicationUpdatesGet Get /v2/application/updates Get all Updates
ApplicationEndpointsApi V2ApplicationUserVariableRelationshipsGet Get /v2/application/userVariableRelationships Get all UserVariableRelationships
ApplicationEndpointsApi V2ApplicationUserVariablesGet Get /v2/application/userVariables Get all UserVariables
ApplicationEndpointsApi V2ApplicationVariableUserSourcesGet Get /v2/application/variableUserSources Get all VariableUserSources
ApplicationEndpointsApi V2ApplicationVotesGet Get /v2/application/votes Get all Votes
AuthenticationApi V2AuthSocialAuthorizeCodeGet Get /v2/auth/social/authorizeCode Second Step in Social Authentication flow with JWT Token
AuthenticationApi V2AuthSocialAuthorizeTokenGet Get /v2/auth/social/authorizeToken Native Social Authentication
AuthenticationApi V2AuthSocialLoginGet Get /v2/auth/social/login First Setp in Social Authentication flow with JWT Token
AuthenticationApi V2Oauth2AccessTokenGet Get /v2/oauth2/access_token Get a user access token
AuthenticationApi V2OauthAuthorizeGet Get /v2/oauth/authorize Request Authorization Code
ConnectorsApi V1ConnectJsGet Get /v1/connect.js Get embeddable connect javascript
ConnectorsApi V1ConnectMobileGet Get /v1/connect/mobile Mobile connect page
ConnectorsApi V1ConnectorsConnectorConnectGet Get /v1/connectors/{connector}/connect Obtain a token from 3rd party data source
ConnectorsApi V1ConnectorsConnectorConnectInstructionsGet Get /v1/connectors/{connector}/connectInstructions Connection Instructions
ConnectorsApi V1ConnectorsConnectorConnectParameterGet Get /v1/connectors/{connector}/connectParameter Connect Parameter
ConnectorsApi V1ConnectorsConnectorDisconnectGet Get /v1/connectors/{connector}/disconnect Delete stored connection info
ConnectorsApi V1ConnectorsConnectorInfoGet Get /v1/connectors/{connector}/info Get connector info for user
ConnectorsApi V1ConnectorsConnectorUpdateGet Get /v1/connectors/{connector}/update Sync with data source
ConnectorsApi V1ConnectorsListGet Get /v1/connectors/list List of Connectors
CorrelationsApi V1AggregatedCorrelationsGet Get /v1/aggregatedCorrelations Get aggregated correlations
CorrelationsApi V1AggregatedCorrelationsPost Post /v1/aggregatedCorrelations Store or Update a Correlation
CorrelationsApi V1CorrelationsGet Get /v1/correlations Get correlations
CorrelationsApi V1OrganizationsOrganizationIdUsersUserIdVariablesVariableNameCausesGet Get /v1/organizations/{organizationId}/users/{userId}/variables/{variableName}/causes Search user correlations for a given cause
CorrelationsApi V1OrganizationsOrganizationIdUsersUserIdVariablesVariableNameEffectsGet Get /v1/organizations/{organizationId}/users/{userId}/variables/{variableName}/effects Search user correlations for a given cause
CorrelationsApi V1PublicCorrelationsSearchSearchGet Get /v1/public/correlations/search/{search} Get average correlations for variables containing search term
CorrelationsApi V1VariablesVariableNameCausesGet Get /v1/variables/{variableName}/causes Search user correlations for a given effect
CorrelationsApi V1VariablesVariableNameEffectsGet Get /v1/variables/{variableName}/effects Search user correlations for a given cause
CorrelationsApi V1VariablesVariableNamePublicCausesGet Get /v1/variables/{variableName}/public/causes Search public correlations for a given effect
CorrelationsApi V1VariablesVariableNamePublicEffectsGet Get /v1/variables/{variableName}/public/effects Search public correlations for a given cause
CorrelationsApi V1VotesDeletePost Post /v1/votes/delete Delete vote
CorrelationsApi V1VotesPost Post /v1/votes Post or update vote
MeasurementsApi V1MeasurementSourcesGet Get /v1/measurementSources Get measurement sources
MeasurementsApi V1MeasurementSourcesPost Post /v1/measurementSources Add a data source
MeasurementsApi V1MeasurementsDailyGet Get /v1/measurements/daily Get daily measurements for this user
MeasurementsApi V1MeasurementsDeletePost Post /v1/measurements/delete Delete a measurement
MeasurementsApi V1MeasurementsGet Get /v1/measurements Get measurements for this user
MeasurementsApi V1MeasurementsPost Post /v1/measurements Post a new set or update existing measurements to the database
MeasurementsApi V1MeasurementsRangeGet Get /v1/measurementsRange Get measurements range for this user
MeasurementsApi V2MeasurementsCsvGet Get /v2/measurements/csv Get Measurements CSV
MeasurementsApi V2MeasurementsIdDelete Delete /v2/measurements/{id} Delete Measurement
MeasurementsApi V2MeasurementsIdGet Get /v2/measurements/{id} Get Measurement
MeasurementsApi V2MeasurementsIdPut Put /v2/measurements/{id} Update Measurement
MeasurementsApi V2MeasurementsRequestCsvPost Post /v2/measurements/request_csv Post Request for Measurements CSV
MeasurementsApi V2MeasurementsRequestPdfPost Post /v2/measurements/request_pdf Post Request for Measurements PDF
MeasurementsApi V2MeasurementsRequestXlsPost Post /v2/measurements/request_xls Post Request for Measurements XLS
OrganizationsApi V1OrganizationsOrganizationIdUsersPost Post /v1/organizations/{organizationId}/users Get user tokens for existing users, create new users
PairsApi V1PairsCsvGet Get /v1/pairsCsv Get pairs
PairsApi V1PairsGet Get /v1/pairs Get pairs
RemindersApi V1TrackingReminderNotificationsGet Get /v1/trackingReminderNotifications Get specific pending tracking reminders
RemindersApi V1TrackingReminderNotificationsSkipPost Post /v1/trackingReminderNotifications/skip Skip a pending tracking reminder
RemindersApi V1TrackingReminderNotificationsSnoozePost Post /v1/trackingReminderNotifications/snooze Snooze a pending tracking reminder
RemindersApi V1TrackingReminderNotificationsTrackPost Post /v1/trackingReminderNotifications/track Track a pending tracking reminder
RemindersApi V1TrackingRemindersDeletePost Post /v1/trackingReminders/delete Delete tracking reminder
RemindersApi V1TrackingRemindersGet Get /v1/trackingReminders Get repeating tracking reminder settings
RemindersApi V1TrackingRemindersPost Post /v1/trackingReminders Store a Tracking Reminder
TagsApi V1UserTagsDeletePost Post /v1/userTags/delete Delete user tag or ingredient
TagsApi V1UserTagsPost Post /v1/userTags Post or update user tags or ingredients
UnitsApi V1UnitCategoriesGet Get /v1/unitCategories Get unit categories
UnitsApi V1UnitsGet Get /v1/units Get all available units
UnitsApi V1UnitsVariableGet Get /v1/unitsVariable Units for Variable
UserApi V1OrganizationsOrganizationIdUsersPost Post /v1/organizations/{organizationId}/users Get user tokens for existing users, create new users
UserApi V1UserMeGet Get /v1/user/me Get all available units for variableGet authenticated user
VariablesApi V1PublicVariablesGet Get /v1/public/variables Get public variables
VariablesApi V1PublicVariablesSearchSearchGet Get /v1/public/variables/search/{search} Get top 5 PUBLIC variables with the most correlations
VariablesApi V1UserVariablesPost Post /v1/userVariables Update User Settings for a Variable
VariablesApi V1VariableCategoriesGet Get /v1/variableCategories Variable categories
VariablesApi V1VariablesGet Get /v1/variables Get variables with user's settings
VariablesApi V1VariablesPost Post /v1/variables Create Variables
VariablesApi V1VariablesSearchSearchGet Get /v1/variables/search/{search} Get variables by search query
VariablesApi V1VariablesVariableNameGet Get /v1/variables/{variableName} Get info about a variable
VotesApi V1VotesDeletePost Post /v1/votes/delete Delete vote
VotesApi V1VotesPost Post /v1/votes Post or update vote

Documentation For Models

Documentation For Authorization

oauth2

  • Type: OAuth
  • Flow: implicit
  • Authorizatoin URL: https://app.quantimo.do/api/v1/oauth2/authorize
  • Scopes:
  • basic: Basic authentication
  • readmeasurements: Grants read access to measurements and variables. Allows the client app to obtain the user's data.
  • writemeasurements: Grants write access to measurements and variables. Allows the client app to store user data.

quantimodo_oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorizatoin URL: /api/v2/oauth/authorize
  • Scopes:
  • basic: allows you to read user info (displayname, email, etc).
  • readmeasurements: allows one to read a user's data
  • writemeasurements: allows you to write user data

basicAuth

  • Type: HTTP basic authentication

internalApiKey

  • Type: API key
  • API key parameter name: api_key
  • Location: HTTP header

Author

About

Easily aggregate, store, and analyze your users life-tracking data using the QuantiModo API!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published