All URIs are relative to https://app.quantimo.do/api
| Method | HTTP request | Description |
|---|---|---|
| connectConnector | GET /v3/connectors/{connectorName}/connect | Obtain a token from 3rd party data source |
| disconnectConnector | GET /v3/connectors/{connectorName}/disconnect | Delete stored connection info |
| getConnectors | GET /v3/connectors/list | List of Connectors |
| getIntegrationJs | GET /v3/integration.js | Get embeddable connect javascript |
| getMobileConnectPage | GET /v3/connect/mobile | Mobile connect page |
| updateConnector | GET /v3/connectors/{connectorName}/update | Sync with data source |
connectConnector(connectorName, opts)
Obtain a token from 3rd party data source
Attempt to obtain a token from the data provider, store it in the database. With this, the connector to continue to obtain new user data until the token is revoked.
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 = 'Token';
// Configure OAuth2 access token for authorization: quantimodo_oauth2
var quantimodo_oauth2 = defaultClient.authentications['quantimodo_oauth2'];
quantimodo_oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new Quantimodo.ConnectorsApi();
var connectorName = "connectorName_example"; // String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint.
var opts = {
'userId': 8.14, // Number | User's id
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.connectConnector(connectorName, opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| connectorName | String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint. | |
| userId | Number | User's id | [optional] |
null (empty response body)
access_token, quantimodo_oauth2
- Content-Type: application/json
- Accept: application/json
disconnectConnector(connectorName)
Delete stored connection info
The disconnect method deletes any stored tokens or connection information from the connectors database.
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 = 'Token';
// Configure OAuth2 access token for authorization: quantimodo_oauth2
var quantimodo_oauth2 = defaultClient.authentications['quantimodo_oauth2'];
quantimodo_oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new Quantimodo.ConnectorsApi();
var connectorName = "connectorName_example"; // String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.disconnectConnector(connectorName, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| connectorName | String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint. |
null (empty response body)
access_token, quantimodo_oauth2
- Content-Type: application/json
- Accept: application/json
GetConnectorsResponse getConnectors(opts)
List of Connectors
A connector pulls data from other data providers using their API or a screenscraper. Returns a list of all available connectors and information about them such as their id, name, whether the user has provided access, logo url, connection instructions, and the update history.
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 = 'Token';
// Configure OAuth2 access token for authorization: quantimodo_oauth2
var quantimodo_oauth2 = defaultClient.authentications['quantimodo_oauth2'];
quantimodo_oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new Quantimodo.ConnectorsApi();
var opts = {
'clientId': "clientId_example", // String | Your QuantiModo client id can be obtained by creating an app at https://builder.quantimo.do
'platform': "platform_example" // String | Ex: chrome, android, ios, web
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getConnectors(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| clientId | String | Your QuantiModo client id can be obtained by creating an app at https://builder.quantimo.do | [optional] |
| platform | String | Ex: chrome, android, ios, web | [optional] |
access_token, quantimodo_oauth2
- Content-Type: application/json
- Accept: application/json
getIntegrationJs(opts)
Get embeddable connect javascript
Get embeddable connect javascript. Usage: - Embedding in applications with popups for 3rd-party authentication windows. Use `qmSetupInPopup` function after connecting `connect.js`. - Embedding in applications with popups for 3rd-party authentication windows. Requires a selector to block. It will be embedded in this block. Use `qmSetupOnPage` function after connecting `connect.js`. - Embedding in mobile applications without popups for 3rd-party authentication. Use `qmSetupOnMobile` function after connecting `connect.js`. If using in a Cordova application call `qmSetupOnIonic` function after connecting `connect.js`.
var Quantimodo = require('quantimodo');
var apiInstance = new Quantimodo.ConnectorsApi();
var opts = {
'clientId': "clientId_example", // String | Your QuantiModo client id can be obtained by creating an app at https://builder.quantimo.do
'platform': "platform_example" // String | Ex: chrome, android, ios, web
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.getIntegrationJs(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| clientId | String | Your QuantiModo client id can be obtained by creating an app at https://builder.quantimo.do | [optional] |
| platform | String | Ex: chrome, android, ios, web | [optional] |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/x-javascript
getMobileConnectPage(opts)
Mobile connect page
This page is designed to be opened in a webview. Instead of using popup authentication boxes, it uses redirection. You can include the user's access_token as a URL parameter like https://app.quantimo.do/api/v3/connect/mobile?access_token=123
var Quantimodo = require('quantimodo');
var apiInstance = new Quantimodo.ConnectorsApi();
var opts = {
'userId': 8.14, // Number | User's id
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.getMobileConnectPage(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| userId | Number | User's id | [optional] |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: text/html
updateConnector(connectorName, opts)
Sync with data source
The update method tells the QM Connector Framework to check with the data provider (such as Fitbit or MyFitnessPal) and retrieve any new measurements available.
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 = 'Token';
// Configure OAuth2 access token for authorization: quantimodo_oauth2
var quantimodo_oauth2 = defaultClient.authentications['quantimodo_oauth2'];
quantimodo_oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new Quantimodo.ConnectorsApi();
var connectorName = "connectorName_example"; // String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint.
var opts = {
'userId': 8.14, // Number | User's id
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.updateConnector(connectorName, opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| connectorName | String | Lowercase system name of the source application or device. Get a list of available connectors from the /v3/connectors/list endpoint. | |
| userId | Number | User's id | [optional] |
null (empty response body)
access_token, quantimodo_oauth2
- Content-Type: application/json
- Accept: application/json