NAV Navbar
Shell HTTP Node.JS Ruby Python Java

Polar Accesslink API v3.36.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Polar Accesslink API documentation

Base URL: https://www.polaraccesslink.com/

Email: Support
Web: Support
License: Polar Electro

Introduction

AccessLink is the access channel to the training and daily activity data recorded by Polar devices. Any registered Polar Flow user can create API client to AccessLink by filling application details at admin.polaraccesslink.com.

AccessLink uses OAuth2 as authentication protocol. Registered partners will require OAuth2 client credentials in order to request user authorizations and be able to access their data.

JSON and XML file formats are supported except for OAuth2 process where only JSON file format is supported.

How to get started?

  1. Go to https://admin.polaraccesslink.com/ and log in using your Polar Flow credentials or create new Flow account
  2. Fill your application/service information
  3. After client is created, remember to write down OAuth2 clientID and secret
  4. Start developing the API

Go to: https://admin.polaraccesslink.com/ and start the process.

Support

For support, please contact b2bhelpdesk@polar.com

API basics

Users
The resource allows partners to register, de-register and retrieve user's basic information.
Pull notification
The resource allows partners to check if their users have available data for downloading.
Training data
The resource allows partners to access their users' training data.
Daily activity
The resource allows partners to access their users' daily activity data.
Physical info
The resource allows partners to access their users' physical information. Whenever some user's physical information changes, new entry containing full physical info is stored to AccessLink. Pull notifications can be used to check if user have new physical information available.
Data models
Data models describes all the objects that carries data between server and the client.
Appendixes
Appendixes contains examples and more detailed info about the application interface.

Security

TLS (Transport Layer Security) connections are required in order to access Polar Accesslink API endpoints. TLS will provide privacy and data integrity between client application and Polar Accesslink API.

AccessLink uses OAuth2 as an authentication protocol. See authentication page to get started.

Rate limiting

Dynamic rate limit scales partners rate limit values based on number of registered users. Rate limit values are updated daily. There are two kind of rate limits: short term (15min) and long term(24h). The short term limit is reset after 15 minutes have passed since first request is made and the long term limit is reset after 24 hours have passed since first request.

The formula for calculating rate limit are:

Partner's limits, usage and reset time are returned with every API request as part of the HTTP Headers.

Name Value Description
RateLimit-Usage Integer, Integer Two comma separated values, short term followed by long term usage.
RateLimit-Limit Integer, Integer Two comma separated values, short term followed by long term limit.
RateLimit-Reset Integer, Integer Two comma separated values, short term followed by long term reset time in seconds.

Requests exceeding the limit will return 429 - Too Many Requests. Note that requests violating the short term limit will still count toward the long term limit.

Development resources

Transaction model

Fetching user data (training, activity and physical information) from Accesslink is based on transactions.

Using transactions consist of three request/response pairs:

  1. Initiating a new transaction
  2. Retrieving data within the transaction
  3. Committing transaction

Pull notifications can be used to check if user have available data.

Each transaction will consist of at most 50 entities. Once entities linked to transaction have been fetched, transaction must be committed. If transaction is not committed within 10 minutes after it was created, it will be disbanded, and all data linked to it will be returned in next transaction. Attempting to access disbanded transaction will result HTTP error 404 NOT FOUND.

Activity transactions

Each transaction will consist of at most 50 activity summaries. In case a transaction with 50 activity summaries is retrieved by partner, they can check for new data by initiating a new transaction. In case less that 50 activity summaries is returned, partner should not request a new transaction immediately after committing.

In Accesslink 2.1x activity data could only contain one data item per user per day, but in Accesslink 3.0 user can have several activity data items per day. For example, if user synchs data at noon 1st of May, as a result you will get a partial activity summary that will contain data for first half of May 1st. When user synchs data on May 2nd, or later, you will get the full days activity summary for May 1st as second piece of data.

Example, transaction contains three summaries for same user, two on same date:

Even though transaction returns three activity summaries, only summaries with created times 2020-01-01T00:00:00.000 and 2020-01-02T15:00:00.000 should be taken into account because summary with created time 2020-01-02T15:00:00.000 contains latest data for that day. Summary with created time 2020-01-02T10:00:00.000 is outdated information. Or in other words, only the latest activity summary should be taken into account for each day for each user.

Activity data supports combining activity data from multiple devices. If user, for example, synchs (two minutes apart) data for two devices, summary data will be like following: * Summary, created time 2020-01-03T13:00:00.000, will have data for users first device * Summary, created time 2020-01-03T13:02:00.000, will have data for first AND second device, combined

In this case, summary with created time 2020-01-03T13:02:00.000 should be used as users activity data for that day.

NOTE! Not all data will be synched on the day it was recorded on. Sometimes there can be very long delays between recording and synching the activity. User may synch the data weeks, or even months after recording the data. It is important to check what day the activity was recorded on, and then use the latest synch data for that user, for that day.

Accesslink webhooks

Overview

Polar Accesslink webhooks allows client application to subscribe to receive notification when certain event occurs.

Webhook delivery

Information about event is sent to registered webhook URL using HTTP POST method. Webhook delivery expects response 200 from remote endpoint.

Creating webhook

PING example

POST / HTTP/1.1
Host: myapp.example.com:443
Content-type: application/json
Polar-Webhook-Event: PING
Polar-Webhook-Signature: f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
{
    "timestamp": "2019-01-11T08:25:10.02Z",
    "event": "PING"
}

Webhook can be created using create webhook -endpoint. When creating webhook Accesslink API sends ping message to given url so make sure the webhook url is valid and there is a server responding to messages.

When new webhook is created Accesslink API returns an unique signature_secret_key. Client signing key is used to sign all payload messages. Signature is included in "Polar-Webhook-Signature" header, and receiving endpoint should verify the signature when receiving message to verify origin of message.

This signature key is not available after create so make sure to save the key when creating webhook.

Note! Client application can only have one webhook registered.

Payload example

POST /acl_webhook HTTP/1.1
Host: myapp.example.com:443
Content-Type: application/json
Polar-Webhook-Signature: f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
Polar-Webhook-Event: EXERCISE
{
   "event": "EXERCISE",
   "user_id": 475,
   "entity_id": "aQlC83",
   "timestamp": "2018-05-15T14:22:24Z",
   "url": "https://www.polaraccesslink.com/v3/exercises/aQlC83"
}

Webhook payload

Webhook payload contains event type and event specific metadata related to event, and possible url related to event.

Message headers contains webhook event type and security token for verifying that sender is actually Polar.

Verifying payload signature

Hash-based message authentication code (HMAC SHA-256) is used to sign every webhook payload Accesslink sends. The secret key for calculating signature is given to client when they create the webhook.

To verify sender client should calculate HMAC and compare it to the signature in payload header.

HMAC SHA-256 calculation example

public static String calculateHMAC(String data, String key)
    throws SignatureException, NoSuchAlgorithmException, InvalidKeyException
{
    SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA256");
    Mac mac = Mac.getInstance("HmacSHA256");
    mac.init(signingKey);
    return toHexString(mac.doFinal(data.getBytes()));
}

Authentication

The basic Polar OAuth2 flow for Accesslink use goes as follows:

  1. User is re-directed from partner system to OAuth2 authorization endpoint in Polar Flow
  2. User grants partner the right to access his/her data in Accesslink
  3. User is redirected back to partner system and partner system receives authorization code as part of the request
  4. Partner system uses the authorization code to get an access token from Polarremote.com
  5. Access token is used to register/de-register users and to access their data

Authorization endpoint

To get user authorization code, redirect user to the following address (HTTP GET):

Parameters and their definitions

Name Required Description
response_type YES "code" is the only response type supported
scope NO Scope of user authorization. If not provided, user will be asked to grant authorization for all scopes linked to client. Accesslink uses accesslink.read_all -scope, which allows access to user's data.
client_id YES Unique client id provided by Polar
state NO An opaque string. This will be given as parameter when making a request to default redirect_uri
redirect_uri NO Redirect URI used by the client. Must be identical to the one given during registration

On success, user will be shown the authorization form. After granting authorization, user will be redirected to redirect_uri given during client registration process. Authorization code will be provided as a parameter. Examples:

If an error occurs, user will be redirected to location defined in default redirect_uri with error code included. Example:

Parameters and their definitions

Name Description
state Same value as "state"-parameter in the authorization server request. If the parameter was not given on authorization request, this parameter will not be present.
code Authorization code that expires in 10 minutes. This code must only be used once. If it's used more than once, the request will be denied and ALL issued tokens will be deleted. If an error occurs, this parameters is not present.
error Code for error that happened. This parameter is only present if an error occured.

Error codes

Token endpoint

POST https://polarremote.com/v2/oauth2/token

With authorization code, an access token can be requested by posting authorization code to token endpoint.

Request headers

Request POST data

Name Required Description
grant_type YES Must be always value "authorization_code"
code YES Authorization code received from authorization endpoint
redirect_uri NO* Must be specified if redirect_uri was passed to authorization endpoint

Response JSON object

If error occurs during request, result JSON object will be

Status Codes

Example request

POST https://polarremote.com/v2/oauth2/token HTTP/1.1
Authorization: Basic dGhpc2RvZXNudDpkb2FueXRoaW6s
Content-Type: application/x-www-form-urlencoded
Accept: application/json;charset=UTF-8

grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA

Example response

{
    "access_token" : "2YotnFZFEjr1zCsicMWpAA",
    "token_type" : "bearer",
    "expires_in" : 31535999,
    "x_user_id" : 10579
}

Making requests

Accesslink 3.0 uses two kinds of authentication. Authentication with user token, and authentication with client (partner) credentials. All requests to /v3/users and its subresources are done with user token authentication, and all other /v3/ requests (/v3/pull-notifications for example) are done with client credentials.

User token authentication

In order to make requests to Users API, add the OAuth2 token to the Authorization request header:

Name Value
Authorization Bearer <TOKEN>

Access tokens will not expire unless explicitly revoked by partners or users.

Client credentials authentication

In order to make requests to client level resources, include the following header:

Name Value
Authorization Basic dGhpc2RvZXNudDpkb2FueXRoaW6s

Where dGhpc2RvZXNudDpkb2FueXRoaW6s is replaced with base64 encoded string client_id:client_secret. For example, if your client id is 12345 and client secret is verySecret, then you need to base64 encode string 12345:verySecret.

Users

This resource provides all the necessary functions to manage users.

Register user

Code samples

# You can also use wget
curl -X POST https://www.polaraccesslink.com/v3/users \
  -H 'Content-Type: application/xml' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://www.polaraccesslink.com/v3/users HTTP/1.1
Host: www.polaraccesslink.com
Content-Type: application/xml
Accept: application/json

const fetch = require('node-fetch');
const inputBody = '{
  "member-id": "User_id_999"
}';
const headers = {
  'Content-Type':'application/xml',  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/xml',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://www.polaraccesslink.com/v3/users',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/xml',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://www.polaraccesslink.com/v3/users', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /v3/users

Once partner has been authorized by user, partner must register user before being able to access her data.

Body parameter

{
  "member-id": "User_id_999"
}
<?xml version="1.0" encoding="UTF-8" ?>
<register>
  <member-id>User_id_999</member-id>
</register>

Parameters

Parameter In Type Required Description
body body register true none
» member-id body string true Partner's custom identifier for user.

Example responses

200 Response

{
  "polar-user-id": 2278512,
  "member-id": "i09u9ujj",
  "registration-date": "2011-10-14T12:50:37.000Z",
  "first-name": "Eka",
  "last-name": "Toka",
  "birthdate": "1985-09-06T00:00:00.000Z",
  "gender": "MALE",
  "weight": 66,
  "height": 170,
  "field": [
    {
      "value": "2",
      "index": 0,
      "name": "number-of-children"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<user>
  <polar-user-id>2278512</polar-user-id>
  <member-id>i09u9ujj</member-id>
  <registration-date>2011-10-14T12:50:37.000Z</registration-date>
  <first-name>Eka</first-name>
  <last-name>Toka</last-name>
  <birthdate>1985-09-06T00:00:00.000Z</birthdate>
  <gender>MALE</gender>
  <weight>66</weight>
  <height>170</height>
  <field>
    <value>2</value>
    <index>0</index>
    <name>number-of-children</name>
  </field>
</user>

Responses

Status Meaning Description Schema
200 OK User's base information user
204 No Content No content when user with given userId is not found None

Get user information

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}

List user basic information. Note: Although it is possible to get users weight and height from this resource, the get physical info should be used instead.

Parameters

Parameter In Type Required Description
user-id path integer(int64) true User identifier

Example responses

200 Response

{
  "polar-user-id": 2278512,
  "member-id": "i09u9ujj",
  "registration-date": "2011-10-14T12:50:37.000Z",
  "first-name": "Eka",
  "last-name": "Toka",
  "birthdate": "1985-09-06T00:00:00.000Z",
  "gender": "MALE",
  "weight": 66,
  "height": 170,
  "field": [
    {
      "value": "2",
      "index": 0,
      "name": "number-of-children"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<user>
  <polar-user-id>2278512</polar-user-id>
  <member-id>i09u9ujj</member-id>
  <registration-date>2011-10-14T12:50:37.000Z</registration-date>
  <first-name>Eka</first-name>
  <last-name>Toka</last-name>
  <birthdate>1985-09-06T00:00:00.000Z</birthdate>
  <gender>MALE</gender>
  <weight>66</weight>
  <height>170</height>
  <field>
    <value>2</value>
    <index>0</index>
    <name>number-of-children</name>
  </field>
</user>

Responses

Status Meaning Description Schema
200 OK User's base information user
204 No Content No content when user with given userId is not found None

Delete user

Code samples

# You can also use wget
curl -X DELETE https://www.polaraccesslink.com/v3/users/{user-id} \
  -H 'Authorization: Bearer {access-token}'

DELETE https://www.polaraccesslink.com/v3/users/{user-id} HTTP/1.1
Host: www.polaraccesslink.com

const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://www.polaraccesslink.com/v3/users/{user-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://www.polaraccesslink.com/v3/users/{user-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /v3/users/{user-id}

When partner wishes no longer to receive user data, user can be de-registered.This will revoke the access token authorized by user.

Parameters

Parameter In Type Required Description
user-id path integer(int64) true User identifier

Responses

Status Meaning Description Schema
204 No Content will be returned when user is successfully de-registered None

Pull notifications

This resource allows partners to check if their users have available data for downloading. Use client credentials authentication. Returns object holding list of available data objects.

List

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/notifications \
  -H 'Accept: application/json'

GET https://www.polaraccesslink.com/v3/notifications HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://www.polaraccesslink.com/v3/notifications',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/notifications',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://www.polaraccesslink.com/v3/notifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/notifications");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/notifications

Get list of available exercises and activities for users

Example responses

200 Response

{
  "available-user-data": [
    {
      "user-id": 475,
      "data-type": "ACTIVITY_SUMMARY",
      "url": "https://www.polaraccesslink.com/v3/users/475/activity-transactions"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<available-user-datas>
  <available-user-data>
    <user-id>475</user-id>
    <data-type>ACTIVITY_SUMMARY</data-type>
    <url>https://www.polaraccesslink.com/v3/users/475/activity-transactions</url>
  </available-user-data>
</available-user-datas>

Responses

Status Meaning Description Schema
200 OK List of available data available-user-datas
204 No Content No content when no available data found None

Daily activity

This resource allows partners to access their users' daily activity data. During the transfer, the activity data is copied also into the AccessLink database so the end-users cannot change the data that is accessible via AccessLink afterwards. Begin and end of day are determined by the time set on the device used. No timezone information is available. Available data presented in section Data Models.

Create transaction

Code samples

# You can also use wget
curl -X POST https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /v3/users/{user-id}/activity-transactions

Initiate activity transaction. Check for new activity summaries and create a new transaction if found.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier

Example responses

201 Response

{
  "transaction-id": 122,
  "resource-uri": "https://polaraccesslink.com/v3/users/21/physical-information-transactions/32"
}
<?xml version="1.0" encoding="UTF-8" ?>
<transaction-location>
  <transaction-id>122</transaction-id>
  <resource-uri>https://polaraccesslink.com/v3/users/21/physical-information-transactions/32</resource-uri>
</transaction-location>

Responses

Status Meaning Description Schema
201 Created Return link to created transaction containing new activity data transaction-location
204 No Content No content when there is no new activity data available None

List activities

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/activity-transactions/{transaction-id}

List new activity data. After successfully initiating a transaction, activity summaries included within it can be retrieved with the provided transactionId.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Example responses

200 Response

{
  "activity-log": [
    "https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/56",
    "https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/120"
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<activity-logs>
  <activity-log>https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/56</activity-log>
  <activity-log>https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/120</activity-log>
</activity-logs>

Responses

Status Meaning Description Schema
200 OK Return list of hyperlinks to training sessions contained within the transaction activity-log
204 No Content No content when there is no data available None
404 Not Found No transaction was found with given transaction id None

Commit transaction

Code samples

# You can also use wget
curl -X PUT https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id} \
  -H 'Authorization: Bearer {access-token}'

PUT https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com

const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /v3/users/{user-id}/activity-transactions/{transaction-id}

After successfully retrieving activity summary data within a transaction, partners are expected to commit the transaction.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Responses

Status Meaning Description Schema
200 OK Transaction has been committed and data deleted None
204 No Content No content when there is no data available None

Get activity summary

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
activity-id path integer true Activity summary identifier

Example responses

200 Response

{
  "id": 1234,
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "transaction-id": 179879,
  "date": "2010-12-31",
  "created": "2016-04-27T20:11:33.000Z",
  "calories": 2329,
  "active-calories": 428,
  "duration": "PT2H44M",
  "active-steps": 250
}
<?xml version="1.0" encoding="UTF-8" ?>
<activity>
  <id>1234</id>
  <polar-user>https://www.polaraccesslink/v3/users/1</polar-user>
  <transaction-id>179879</transaction-id>
  <date>2010-12-31</date>
  <created>2016-04-27T20:11:33.000Z</created>
  <calories>2329</calories>
  <active-calories>428</active-calories>
  <duration>PT2H44M</duration>
  <active-steps>250</active-steps>
</activity>

Responses

Status Meaning Description Schema
200 OK Return activity summary contained within the transaction activity
204 No Content No content when there is no data available None

Get step samples

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/step-samples

Get activity step samples. Example data can be seen from appendix.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
activity-id path integer true Activity summary identifier

Example responses

200 Response

{
  "interval": 0,
  "samples": [
    {
      "steps": 0,
      "time": "12:37:33.000"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<activity-step-samples>
  <interval>0</interval>
  <samples>
    <steps>0</steps>
    <time>12:37:33.000</time>
  </samples>
</activity-step-samples>

Responses

Status Meaning Description Schema
200 OK Return activity step samples activity-step-samples
204 No Content No content when there is no data available None

Get zone samples

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/activity-transactions/{transaction-id}/activities/{activity-id}/zone-samples

Get activity zone samples. Example data can be seen from appendix.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
activity-id path integer true Activity summary identifier

Example responses

200 Response

{
  "interval": 0,
  "samples": [
    {
      "activity-zones": [
        {
          "index": 1,
          "inzone": "PT51M5S"
        }
      ],
      "time": "string"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<activity-zone-samples>
  <interval>0</interval>
  <samples>
    <activity-zones>
      <index>1</index>
      <inzone>PT51M5S</inzone>
    </activity-zones>
    <time>string</time>
  </samples>
</activity-zone-samples>

Responses

Status Meaning Description Schema
200 OK Return activity zone samples activity-zone-samples
204 No Content No content when there is no data available None

Training data

This resource allows partners to access their users' training data. All time values are UTC except start-time. Start-time is the time set on the training computer, no timezone information is available. Each transaction will consist of at most 50 training sessions. Available data presented in section Data Models.

Create transaction

Code samples

# You can also use wget
curl -X POST https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /v3/users/{user-id}/exercise-transactions

Check for new training data and create a new transaction if found.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier

Example responses

201 Response

{
  "transaction-id": 122,
  "resource-uri": "https://polaraccesslink.com/v3/users/21/physical-information-transactions/32"
}
<?xml version="1.0" encoding="UTF-8" ?>
<transaction-location>
  <transaction-id>122</transaction-id>
  <resource-uri>https://polaraccesslink.com/v3/users/21/physical-information-transactions/32</resource-uri>
</transaction-location>

Responses

Status Meaning Description Schema
201 Created Return link to created transaction containing new training session data transaction-location
204 No Content No content when there is no new training session data available None

List exercises

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}

After successfully initiating a transaction, training sessions included within it can be retrieved with the provided transactionId.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Example responses

200 Response

{
  "exercises": [
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56",
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/120"
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<exercises>
  <exercise>https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56</exercise>
  <exercise>https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/120</exercise>
</exercises>

Responses

Status Meaning Description Schema
200 OK Return list of hyperlinks to training sessions contained within the transaction exercises
204 No Content No content when there is no data available None

Commit transaction

Code samples

# You can also use wget
curl -X PUT https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id} \
  -H 'Authorization: Bearer {access-token}'

PUT https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com

const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /v3/users/{user-id}/exercise-transactions/{transaction-id}

After successfully retrieving training session data within a transaction, partners are expected to commit the transaction.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Responses

Status Meaning Description Schema
200 OK Transaction has been committed and data deleted None
204 No Content No content when there is no data available None
404 Not Found No transaction was found with given transaction id None

Get exercise summary

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}

Retrieve training session summary data

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

{
  "id": 1937529874,
  "upload-time": "2008-10-13T10:40:02.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "transaction-id": 179879,
  "device": "Polar M400",
  "start-time": "2008-10-13T10:40:02.000Z",
  "duration": "PT2H44M",
  "calories": 530,
  "distance": 1600,
  "heart-rate": {
    "average": 129,
    "maximum": 147
  },
  "training-load": 143.22,
  "sport": "OTHER",
  "has-route": true,
  "club-id": 999,
  "club-name": "Polar Club",
  "detailed-sport-info": "WATERSPORTS_WATERSKI"
}
<?xml version="1.0" encoding="UTF-8" ?>
<exercise>
  <id>1937529874</id>
  <upload-time>2008-10-13T10:40:02.000Z</upload-time>
  <polar-user>https://www.polaraccesslink/v3/users/1</polar-user>
  <transaction-id>179879</transaction-id>
  <device>Polar M400</device>
  <start-time>2008-10-13T10:40:02.000Z</start-time>
  <duration>PT2H44M</duration>
  <calories>530</calories>
  <distance>1600</distance>
  <heart-rate>
    <average>129</average>
    <maximum>147</maximum>
  </heart-rate>
  <training-load>143.22</training-load>
  <sport>OTHER</sport>
  <has-route>true</has-route>
  <club-id>999</club-id>
  <club-name>Polar Club</club-name>
  <detailed-sport-info>WATERSPORTS_WATERSKI</detailed-sport-info>
</exercise>

Responses

Status Meaning Description Schema
200 OK Exercise summary exercise
204 No Content No content when there is no data available None

Get FIT (beta)

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit HTTP/1.1
Host: www.polaraccesslink.com
Accept: */*

const fetch = require('node-fetch');

const headers = {
  'Accept':'*/*',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => '*/*',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': '*/*',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/fit

Retrieve exercise in FIT format. Note! This interface is in beta phase. If there is anything we can help you with or you want to give us feedback, please contact Support.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK Return FIT file string
204 No Content No FIT available for exercise None

Get GPX

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx \
  -H 'Accept: application/gpx+xml' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/gpx+xml

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/gpx+xml',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/gpx+xml',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/gpx+xml',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/gpx

Retrieve training session summary data in GPX format

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK Return training session in GPX (GPS Exchange format) string
204 No Content No content when there is no data available None

Get heart rate zones

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/heart-rate-zones

Retrieve heart rate zones in training session

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

{
  "zone": [
    {
      "index": 1,
      "lower-limit": 110,
      "upper-limit": 130,
      "in-zone": "PT4S"
    }
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<zones>
  <zone>
    <index>1</index>
    <lower-limit>110</lower-limit>
    <upper-limit>130</upper-limit>
    <in-zone>PT4S</in-zone>
  </zone>
</zones>

Responses

Status Meaning Description Schema
200 OK Return heart rate zones in training session zones
204 No Content No content when there is no data available None

Get available samples

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples

Retrieve list of links to available samples in training session

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

{
  "sample": [
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/0",
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/3"
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<samples>
  <sample>https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/0</sample>
  <sample>https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/3</sample>
</samples>

Responses

Status Meaning Description Schema
200 OK Return list of hyperlinks to available samples in training session samples
204 No Content No content when there is no data available None

Get samples

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/samples/{type-id}

Retrieve sample data of given type

Parameters

Parameter In Type Required Description
type-id path string(byte) true Sample type id
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

{
  "recording-rate": 5,
  "sample-type": "1",
  "data": "0,100,102,97,97,101,103,106,96,89,88,87,98,108,113,112,114,115,118,121,121,121,121,123,117,119,122"
}
<?xml version="1.0" encoding="UTF-8" ?>
<sample>
  <recording-rate>5</recording-rate>
  <sample-type>1</sample-type>
  <data>0,100,102,97,97,101,103,106,96,89,88,87,98,108,113,112,114,115,118,121,121,121,121,123,117,119,122</data>
</sample>

Responses

Status Meaning Description Schema
200 OK Return sample data sample
204 No Content No content when there is no data available None

Get TCX

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx \
  -H 'Accept: application/vnd.garmin.tcx+xml' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/vnd.garmin.tcx+xml

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/vnd.garmin.tcx+xml',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.garmin.tcx+xml',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.garmin.tcx+xml',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/exercise-transactions/{transaction-id}/exercises/{exercise-id}/tcx

Retrieve exercise in TCX format

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
exercise-id path integer true Exercise identifier

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK Return gzipped TCX string
204 No Content No TCX available for exercise None

Physical info

This resource allows partners to access their users' physical information. Whenever some user's physical information changes, new entry containing full physical info is stored to AccessLink. Pull notifications can be used to check if user have new physical information available. Available data presented in section Data Models.

Create transaction

Code samples

# You can also use wget
curl -X POST https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /v3/users/{user-id}/physical-information-transactions

Initiate physical info transaction. Check for new physical info and create a new transaction if found.

Parameters

Parameter In Type Required Description
user-id path integer true User identifier

Example responses

201 Response

{
  "transaction-id": 122,
  "resource-uri": "https://polaraccesslink.com/v3/users/21/physical-information-transactions/32"
}
<?xml version="1.0" encoding="UTF-8" ?>
<transaction-location>
  <transaction-id>122</transaction-id>
  <resource-uri>https://polaraccesslink.com/v3/users/21/physical-information-transactions/32</resource-uri>
</transaction-location>

Responses

Status Meaning Description Schema
201 Created Return link to created transaction containing new physical info data transaction-location
204 No Content No content when there is no new physical info data available None

List physical infos

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/physical-information-transactions/{transaction-id}

List new physical info data. After successfully initiating a transaction, physical infos included within it can be retrieved with the provided transactionId.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Example responses

200 Response

{
  "physical-informations": [
    "https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/56",
    "https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/120"
  ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<physical-informations>
  <physical-information>https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/56</physical-information>
  <physical-information>https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/120</physical-information>
</physical-informations>

Responses

Status Meaning Description Schema
200 OK Return list of hyperlinks to physical information contained within the transaction physical-informations
204 No Content No content when there is no data available None
404 Not Found No transaction was found with given transaction id None

Commit transaction

Code samples

# You can also use wget
curl -X PUT https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id} \
  -H 'Authorization: Bearer {access-token}'

PUT https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id} HTTP/1.1
Host: www.polaraccesslink.com

const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /v3/users/{user-id}/physical-information-transactions/{transaction-id}

After successfully retrieving physical information within a transaction, partners are expected to commit the transaction.

Parameters

Parameter In Type Required Description
transaction-id path integer(int64) true Transaction identifier
user-id path integer true User identifier

Responses

Status Meaning Description Schema
200 OK Transaction has been committed and data deleted None
204 No Content No content when there is no data available None

Get physical info

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/users/{user-id}/physical-information-transactions/{transaction-id}/physical-informations/{physical-info-id}

Get physical info entity data

Parameters

Parameter In Type Required Description
user-id path integer true User identifier
transaction-id path integer true Transaction identifier
physical-info-id path integer true Physical information identifier

Example responses

200 Response

{
  "id": 123,
  "transaction-id": 179879,
  "created": "2016-04-27T20:11:33.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "weight": 80,
  "height": 180,
  "maximum-heart-rate": 160,
  "resting-heart-rate": 60,
  "aerobic-threshold": 123,
  "anaerobic-threshold": 123,
  "vo2-max": 12,
  "weight-source": "SOURCE_MEASURED"
}
<?xml version="1.0" encoding="UTF-8" ?>
<physical-information>
  <id>123</id>
  <transaction-id>179879</transaction-id>
  <created>2016-04-27T20:11:33.000Z</created>
  <polar-user>https://www.polaraccesslink/v3/users/1</polar-user>
  <weight>80</weight>
  <height>180</height>
  <maximum-heart-rate>160</maximum-heart-rate>
  <resting-heart-rate>60</resting-heart-rate>
  <aerobic-threshold>123</aerobic-threshold>
  <anaerobic-threshold>123</anaerobic-threshold>
  <vo2-max>12</vo2-max>
  <weight-source>SOURCE_MEASURED</weight-source>
</physical-information>

Responses

Status Meaning Description Schema
200 OK Physical information physical-information
204 No Content No content when there is no data available None

Webhooks

Webhook resources provides endpoints for creating, modifying and deleting webhooks.

Create webhook

Code samples

# You can also use wget
curl -X POST https://www.polaraccesslink.com/v3/webhooks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST https://www.polaraccesslink.com/v3/webhooks HTTP/1.1
Host: www.polaraccesslink.com
Content-Type: application/json
Accept: application/json

const fetch = require('node-fetch');
const inputBody = '{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}';
const headers = {
  'Content-Type':'application/json',  'Accept':'application/json'
};

fetch('https://www.polaraccesslink.com/v3/webhooks',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://www.polaraccesslink.com/v3/webhooks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://www.polaraccesslink.com/v3/webhooks', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/webhooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /v3/webhooks

Create new webhook.

When creating webhook the Accesslink sends a ping message to the url in request body. The ping message must be answered with 200 OK or otherwise the webhook is not created.

Note! Save the signature_secret_key from response since this is the only chance to get it.

Body parameter

{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}

Parameters

Parameter In Type Required Description
body body webhookRequest true Webhook to create.
» events body [webhookType] true Type of events to subscribe.
» url body string(uri) true Url where the webhook notification is sent.

Enumerated Values

Parameter Value
» events EXERCISE
» events ACTIVITY_SUMMARY
» events PHYSICAL_INFORMATION

Example responses

201 Response

{
  "data": {
    "id": "abdf33",
    "events": "EXERCISE",
    "url": "https://myapp.example.com/acl_webhook",
    "signature_secret_key": "abe1f3ae-fd33-11e8-8eb2-f2801f1b9fd1"
  }
}

Responses

Status Meaning Description Schema
201 Created Created webhook. createdWebhook
400 Bad Request Webhook cannot be created. error
409 Conflict Webhook already exists. error

Get webhook

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/webhooks \
  -H 'Accept: application/json'

GET https://www.polaraccesslink.com/v3/webhooks HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://www.polaraccesslink.com/v3/webhooks',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/webhooks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://www.polaraccesslink.com/v3/webhooks', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/webhooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/webhooks

Returns created webhook if exists.

Example responses

200 Response

{
  "data": {
    "id": "abdf33",
    "events": "EXERCISE",
    "url": "https://myapp.example.com/acl_webhook"
  }
}

Responses

Status Meaning Description Schema
200 OK Existing webhook webhookInfo

Update webhook

Code samples

# You can also use wget
curl -X PATCH https://www.polaraccesslink.com/v3/webhooks/{webhook-id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH https://www.polaraccesslink.com/v3/webhooks/{webhook-id} HTTP/1.1
Host: www.polaraccesslink.com
Content-Type: application/json
Accept: application/json

const fetch = require('node-fetch');
const inputBody = '{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}';
const headers = {
  'Content-Type':'application/json',  'Accept':'application/json'
};

fetch('https://www.polaraccesslink.com/v3/webhooks/{webhook-id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://www.polaraccesslink.com/v3/webhooks/{webhook-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('https://www.polaraccesslink.com/v3/webhooks/{webhook-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/webhooks/{webhook-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PATCH /v3/webhooks/{webhook-id}

Edit webhook event types and/or url.

When updating webhook url the Accesslink sends a ping message to the new address. The ping message must be answered with 200 OK or otherwise the webhook is not updated.

Body parameter

{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}

Parameters

Parameter In Type Required Description
webhook-id path integer true Webhook id to update
body body webhookPatch true New value(s) for events and/or url.
» events body [webhookType] false Type of events to subscribe.
» url body string(uri) false Url where the webhook notification is sent.

Enumerated Values

Parameter Value
» events EXERCISE
» events ACTIVITY_SUMMARY
» events PHYSICAL_INFORMATION

Example responses

200 Response

{
  "data": {
    "id": "abdf33",
    "events": "EXERCISE",
    "url": "https://myapp.example.com/acl_webhook"
  }
}

Responses

Status Meaning Description Schema
200 OK Webhook updated successfully webhookInfo
400 Bad Request Webhook cannot be updated. error
404 Not Found Webhook not found error

Delete webhook

Code samples

# You can also use wget
curl -X DELETE https://www.polaraccesslink.com/v3/webhooks/{webhook-id} \
  -H 'Accept: application/json'

DELETE https://www.polaraccesslink.com/v3/webhooks/{webhook-id} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://www.polaraccesslink.com/v3/webhooks/{webhook-id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete 'https://www.polaraccesslink.com/v3/webhooks/{webhook-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('https://www.polaraccesslink.com/v3/webhooks/{webhook-id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/webhooks/{webhook-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /v3/webhooks/{webhook-id}

Delete webhook by id.

Parameters

Parameter In Type Required Description
webhook-id path integer true Webhook id to delete

Example responses

404 Response

{
  "timestamp": null,
  "status": 0,
  "errorType": "string",
  "message": "string",
  "corrId": "string"
}

Responses

Status Meaning Description Schema
204 No Content Webhook deleted successfully None
404 Not Found Webhook not found. error

Exercises

Resources for getting information about exercise. These endpoints does not require active transaction, but they uses hashed id.

List exercises

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/exercises \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/exercises HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/exercises',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/exercises',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/exercises', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/exercises");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/exercises

List users exercises available in Accesslink.

Example responses

200 Response

[
  {
    "id": "2AC312F",
    "upload-time": "2008-10-13T10:40:02.000Z",
    "polar-user": "https://www.polaraccesslink/v3/users/1",
    "device": "Polar M400",
    "start-time": "2008-10-13T10:40:02.000Z",
    "duration": "PT2H44M",
    "calories": 530,
    "distance": 1600,
    "heart-rate": {
      "average": 129,
      "maximum": 147
    },
    "training-load": 143.22,
    "sport": "OTHER",
    "has-route": true,
    "club-id": 999,
    "club-name": "Polar Club",
    "detailed-sport-info": "WATERSPORTS_WATERSKI"
  }
]

Responses

Status Meaning Description Schema
200 OK List of users exercises. exercisesHashId

Get exercise

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/exercises/{exerciseId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/exercises/{exerciseId} HTTP/1.1
Host: www.polaraccesslink.com
Accept: application/json

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/exercises/{exerciseId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/exercises/{exerciseId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/exercises/{exerciseId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/exercises/{exerciseId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/exercises/{exerciseId}

Get users exercise using hashed id.

Parameters

Parameter In Type Required Description
exerciseId path string true Hashed exercise id.

Example responses

200 Response

{
  "id": "2AC312F",
  "upload-time": "2008-10-13T10:40:02.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "device": "Polar M400",
  "start-time": "2008-10-13T10:40:02.000Z",
  "duration": "PT2H44M",
  "calories": 530,
  "distance": 1600,
  "heart-rate": {
    "average": 129,
    "maximum": 147
  },
  "training-load": 143.22,
  "sport": "OTHER",
  "has-route": true,
  "club-id": 999,
  "club-name": "Polar Club",
  "detailed-sport-info": "WATERSPORTS_WATERSKI"
}

Responses

Status Meaning Description Schema
200 OK Exercise information. exerciseHashId
404 Not Found Exercise not found None

Get exercise FIT

Code samples

# You can also use wget
curl -X GET https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer {access-token}'

GET https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit HTTP/1.1
Host: www.polaraccesslink.com
Accept: */*

const fetch = require('node-fetch');

const headers = {
  'Accept':'*/*',  'Authorization':'Bearer {access-token}'
};

fetch('https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => '*/*',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': '*/*',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://www.polaraccesslink.com/v3/exercises/{exerciseId}/fit");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /v3/exercises/{exerciseId}/fit

FIT file for users exercise.

Parameters

Parameter In Type Required Description
exerciseId path string true Hashed exercise id.

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK Return FIT file string
404 Not Found Exercise not found None

Schemas

AvailableUserData

{
  "user-id": 475,
  "data-type": "ACTIVITY_SUMMARY",
  "url": "https://www.polaraccesslink.com/v3/users/475/activity-transactions"
}

Model contains information of the data available.

Properties

Name Type Required Restrictions Description
user-id integer(int64) false none User identifier who has available data.
data-type string false none Type of available data.
url string false none URI pointing to transaction initiation endpoint for user

Enumerated Values

Property Value
data-type EXERCISE
data-type ACTIVITY_LOG
data-type ACTIVITY_SUMMARY
data-type PHYSICAL_INFORMATION

DurationZone

{
  "index": 1,
  "inzone": "PT51M5S"
}

Model contains the time spent in certain activity zone.

Properties

Name Type Required Restrictions Description
index integer(int32) false none Activity zone index
inzone string false none Time duration spent in the zone ISO 8601

HeartRate

{
  "average": 129,
  "maximum": 147
}

Heart-rate statistics information

Properties

Name Type Required Restrictions Description
average integer(int32) false none Average heart-rate
maximum integer(int32) false none Maximum heart-rate

UserExtraInfo

{
  "value": "2",
  "index": 0,
  "name": "number-of-children"
}

User's answers to the custom extra-info fields requested by partners

Properties

Name Type Required Restrictions Description
value string false none Value provided by the customer
index integer(int32) false none Item index
name string false none Name of the extra info asked from customer

activity

{
  "id": 1234,
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "transaction-id": 179879,
  "date": "2010-12-31",
  "created": "2016-04-27T20:11:33.000Z",
  "calories": 2329,
  "active-calories": 428,
  "duration": "PT2H44M",
  "active-steps": 250
}

Summary of user's daily activity

Properties

Name Type Required Restrictions Description
id integer(int64) false none Activity summary id
polar-user string false none Absolute link to user owning the activity
transaction-id integer(int64) false none Id of the activity-transaction this training was transferred in
date string false none Date when activity summary was recorded, in format YYYY-MM-DD
created string false none The time activity summary was created in Accesslink, in format YYYY-MM-DDTHH:mm:ss.SSS
calories integer(int32) false none Total daily calories in kilo calories including BMR
active-calories integer(int32) false none Total daily calories not including BMR. Precise calculation requires that user's physical data is entered into Polar Flow
duration string false none The time interval as specified in ISO 8601
active-steps integer(int32) false none You could consider this as a kind of activity unit. If you take one step the active-steps should increase by one and any activity comparable to one physical step would also increase the number by one

activity-log

{
  "activity-log": [
    "https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/56",
    "https://www.polaraccesslink.com/v3/users/12/activity-transactions/34/activities/120"
  ]
}

Activity transaction container

Properties

Name Type Required Restrictions Description
activity-log [string] false none Absolute links to individual activity summaries within the transaction

activity-step-sample

{
  "steps": 0,
  "time": "12:37:33.000"
}

Model contains number of steps in certain time period.

Properties

Name Type Required Restrictions Description
steps integer(int32) false none Number of steps in sample segment. If element is null, step samples are not available for current segment.
time string false none Start time of sample segment.

activity-step-samples

{
  "interval": 0,
  "samples": [
    {
      "steps": 0,
      "time": "12:37:33.000"
    }
  ]
}

Wrapper model for partner step samples.

Properties

Name Type Required Restrictions Description
interval integer(int32) false none Sample interval in minutes.
samples [activity-step-sample] false none List of individual step sample objects.

activity-zone-sample

{
  "activity-zones": [
    {
      "index": 1,
      "inzone": "PT51M5S"
    }
  ],
  "time": "string"
}

Model contains number of steps in certain time period.

Properties

Name Type Required Restrictions Description
activity-zones [DurationZone] false none List of heart rate zones with duration.
time string false none Start time of sample segment.

activity-zone-samples

{
  "interval": 0,
  "samples": [
    {
      "activity-zones": [
        {
          "index": 1,
          "inzone": "PT51M5S"
        }
      ],
      "time": "string"
    }
  ]
}

List containing the times (in zone) in different heart rate zones (i.e. Heart rate between lower and upper values). Zone is null if no zone information available.

Properties

Name Type Required Restrictions Description
interval integer(int32) false none Sample interval in minutes.
samples [activity-zone-sample] false none List of individual zone sample objects.

available-user-datas

{
  "available-user-data": [
    {
      "user-id": 475,
      "data-type": "ACTIVITY_SUMMARY",
      "url": "https://www.polaraccesslink.com/v3/users/475/activity-transactions"
    }
  ]
}

*AvailableUserDatas is a container model for AvailableUserData. *

Properties

Name Type Required Restrictions Description
available-user-data [AvailableUserData] false none List of available user datas.

error

{
  "timestamp": null,
  "status": 0,
  "errorType": "string",
  "message": "string",
  "corrId": "string"
}

Error model which contains useful info about the error occured.

Properties

Name Type Required Restrictions Description
timestamp timestamp(date-time) false none Timestamp of the error.
status integer false none Http status code
errorType string false none Error type.
message string false none Human readable error message.
corrId string false none Correlation id of the response for problem solving and debugging use.

exercise

{
  "id": 1937529874,
  "upload-time": "2008-10-13T10:40:02.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "transaction-id": 179879,
  "device": "Polar M400",
  "start-time": "2008-10-13T10:40:02.000Z",
  "duration": "PT2H44M",
  "calories": 530,
  "distance": 1600,
  "heart-rate": {
    "average": 129,
    "maximum": 147
  },
  "training-load": 143.22,
  "sport": "OTHER",
  "has-route": true,
  "club-id": 999,
  "club-name": "Polar Club",
  "detailed-sport-info": "WATERSPORTS_WATERSKI"
}

Training session summary data

Properties

Name Type Required Restrictions Description
id integer(int64) false none Id of the trainining session
upload-time string false none Time of the transfer from wrist unit to Polar database
polar-user string false none Absolute link to Polar user owning the training
transaction-id integer(int64) false none Id of the exercise-transaction this training was transferred in
device string false none Polar product used in training
start-time string false none Start time of the training session in local time
duration string false none The duration of the training session as specified in ISO8601
calories integer(int32) false none Expended calories during training in kilocalories
distance number(float) false none Distance in meters travelled during training
heart-rate HeartRate false none Statistical heart rate date from exercise.
training-load number(float) false none Training load effect to user
sport string false none Sport name
has-route boolean false none Boolean indicating if the exercise has route data
club-id integer(int64) false none Has value if the exercise is from "Flow For Club", otherwise not printed. Value -1 indicates that there were errors finding the club
club-name string false none Has value if the exercise is from "Flow For Club", otherwise not printed. Value "Ambiguous club location. Please contact support." is printed in case of error (and the club-id is -1).
detailed-sport-info string false none String containing the name of a Polar Flow-compatible sport, if one is set for the exercise.

exerciseHashId

{
  "id": "2AC312F",
  "upload-time": "2008-10-13T10:40:02.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "device": "Polar M400",
  "start-time": "2008-10-13T10:40:02.000Z",
  "duration": "PT2H44M",
  "calories": 530,
  "distance": 1600,
  "heart-rate": {
    "average": 129,
    "maximum": 147
  },
  "training-load": 143.22,
  "sport": "OTHER",
  "has-route": true,
  "club-id": 999,
  "club-name": "Polar Club",
  "detailed-sport-info": "WATERSPORTS_WATERSKI"
}

Training session summary data

Properties

Name Type Required Restrictions Description
id string false none Hashed id of the trainining session
upload-time string false none Time of the transfer from wrist unit to Polar database
polar-user string false none Absolute link to Polar user owning the training
device string false none Polar product used in training
start-time string false none Start time of the training session in local time
duration string false none The duration of the training session as specified in ISO8601
calories integer(int32) false none Expended calories during training in kilocalories
distance number(float) false none Distance in meters travelled during training
heart-rate HeartRate false none Statistical heart rate date from exercise.
training-load number(float) false none Training load effect to user
sport string false none Sport name
has-route boolean false none Boolean indicating if the exercise has route data
club-id integer(int64) false none Has value if the exercise is from "Flow For Club", otherwise not printed. Value -1 indicates that there were errors finding the club
club-name string false none Has value if the exercise is from "Flow For Club", otherwise not printed. Value "Ambiguous club location. Please contact support." is printed in case of error (and the club-id is -1).
detailed-sport-info string false none String containing the name of a Polar Flow-compatible sport, if one is set for the exercise.

exercisesHashId

[
  {
    "id": "2AC312F",
    "upload-time": "2008-10-13T10:40:02.000Z",
    "polar-user": "https://www.polaraccesslink/v3/users/1",
    "device": "Polar M400",
    "start-time": "2008-10-13T10:40:02.000Z",
    "duration": "PT2H44M",
    "calories": 530,
    "distance": 1600,
    "heart-rate": {
      "average": 129,
      "maximum": 147
    },
    "training-load": 143.22,
    "sport": "OTHER",
    "has-route": true,
    "club-id": 999,
    "club-name": "Polar Club",
    "detailed-sport-info": "WATERSPORTS_WATERSKI"
  }
]

List of exercises.

Properties

Name Type Required Restrictions Description
anonymous [exerciseHashId] false none List of exercises.

exercises

{
  "exercises": [
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56",
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/120"
  ]
}

Exercise transaction container

Properties

Name Type Required Restrictions Description
exercises [string] false none Absolute links to individual exercises within the transaction

physical-information

{
  "id": 123,
  "transaction-id": 179879,
  "created": "2016-04-27T20:11:33.000Z",
  "polar-user": "https://www.polaraccesslink/v3/users/1",
  "weight": 80,
  "height": 180,
  "maximum-heart-rate": 160,
  "resting-heart-rate": 60,
  "aerobic-threshold": 123,
  "anaerobic-threshold": 123,
  "vo2-max": 12,
  "weight-source": "SOURCE_MEASURED"
}

User's physical information

Properties

Name Type Required Restrictions Description
id integer(int64) false none Physical information id
transaction-id integer(int64) false none Id of the physical-information-transaction this training was transferred in
created string false none The time physical information was created in Accesslink, in format YYYY-MM-DDTHH:mm:ss.SSS
polar-user string false none Absolute link to user owning the activity
weight number(float) false none Height
height number(float) false none Height
maximum-heart-rate integer(int32) false none Maximum heart rate
resting-heart-rate integer(int32) false none Resting hear rate
aerobic-threshold integer(int32) false none Aerobic threshold
anaerobic-threshold integer(int32) false none Anaerobic threshold
vo2-max integer(int32) false none VO2 max
weight-source string false none Weight source

Enumerated Values

Property Value
weight-source SOURCE_MEASURED
weight-source SOURCE_USER

physical-informations

{
  "physical-informations": [
    "https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/56",
    "https://www.polaraccesslink.com/v3/users/12/physical-information-transactions/12/physical-informations/120"
  ]
}

Physical information transaction container

Properties

Name Type Required Restrictions Description
physical-informations [string] false none Absolute links to individual physical informations within the transaction

register

{
  "member-id": "User_id_999"
}

Model for registering user to partner.

Properties

Name Type Required Restrictions Description
member-id string true none Partner's custom identifier for user.

sample

{
  "recording-rate": 5,
  "sample-type": "1",
  "data": "0,100,102,97,97,101,103,106,96,89,88,87,98,108,113,112,114,115,118,121,121,121,121,123,117,119,122"
}

Training session sample data

Properties

Name Type Required Restrictions Description
recording-rate integer(int32) false none Sample recording rate in seconds. Null when recording rate is not applicable - currently only with RR-data.
sample-type string(byte) false none Sample type
data string false none Sample values as a comma-separated list of strings. Can contain null -values which indicate a situtation where sensor was offline.

samples

{
  "sample": [
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/0",
    "https://www.polaraccesslink.com/v3/users/12/exercise-transactions/34/exercises/56/samples/3"
  ]
}

List of URIs pointing to single sample type data.

Properties

Name Type Required Restrictions Description
sample [string] false none List of URIs pointing to single sample type data.

transaction-location

{
  "transaction-id": 122,
  "resource-uri": "https://polaraccesslink.com/v3/users/21/physical-information-transactions/32"
}

Contains absolute link to the created transaction.

Properties

Name Type Required Restrictions Description
transaction-id integer(int64) false none Id of the created transaction
resource-uri string(uri) false none Absolute links to the created transaction

user

{
  "polar-user-id": 2278512,
  "member-id": "i09u9ujj",
  "registration-date": "2011-10-14T12:50:37.000Z",
  "first-name": "Eka",
  "last-name": "Toka",
  "birthdate": "1985-09-06T00:00:00.000Z",
  "gender": "MALE",
  "weight": 66,
  "height": 170,
  "field": [
    {
      "value": "2",
      "index": 0,
      "name": "number-of-children"
    }
  ]
}

User's basic information

Properties

Name Type Required Restrictions Description
polar-user-id integer(int64) false none User's id in Polar database
member-id string false none User's identifier in partner's database
registration-date string(date-time) false none Timestamp marked when ACCEPTED
first-name string false none User's first name
last-name string false none User's surname
birthdate string false none User's birthdate as YYYY-MM-DD
gender string false none User's sex
weight number(float) false none User's weight in kg
height number(float) false none Users height in centimeters
field [UserExtraInfo] false none List containing answers given by the user to a number of partner-specific questions. Extra-info is null if there are no required fields defined by the partner.

Enumerated Values

Property Value
gender MALE
gender FEMALE

createdWebhook

{
  "data": {
    "id": "abdf33",
    "events": "EXERCISE",
    "url": "https://myapp.example.com/acl_webhook",
    "signature_secret_key": "abe1f3ae-fd33-11e8-8eb2-f2801f1b9fd1"
  }
}

Properties

Name Type Required Restrictions Description
data object false none none
» id string false none Id of the new webhook.
» events webhookType false none Subscribed event types.
» url string(uri) false none Url where the webhook notification is sent.
» signature_secret_key string false none Security key for verifying that sender is actually Polar.

webhookInfo

{
  "data": {
    "id": "abdf33",
    "events": "EXERCISE",
    "url": "https://myapp.example.com/acl_webhook"
  }
}

Properties

Name Type Required Restrictions Description
data object false none none
» id string false none Id of the webhook.
» events webhookType false none Subscribed event types.
» url string(uri) false none Url where the webhook notification is sent.

webhookPatch

{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}

Properties

Name Type Required Restrictions Description
events [webhookType] false none Type of events to subscribe.
url string(uri) false none Url where the webhook notification is sent.

webhookPayload

{
  "event": "EXERCISE",
  "user_id": 475,
  "entity_id": "aQlC83",
  "timestamp": "2018-05-15T14:22:24Z",
  "url": "https://www.polaraccesslink.com/v3/exercises/aQlC83"
}

Properties

Name Type Required Restrictions Description
event webhookType false none Type of available data.
user_id integer(int32) false none Id of the user who has new data.
entity_id string false none Id of the available data.
timestamp string(date-time) false none Time when webhook notification is sent.
url string(uri) false none Url to the new available data.

webhookPing

{
  "timestamp": "2018-05-15T14:22:24Z",
  "event": "PING"
}

Accesslink sends ping message as HTTP POST to callback URL being registered when creating new or modifying webhook. Ping message is sent to verify webhook URL. Receiving service must response to ping message with 200 OK or the webhook is not created/modified.

Properties

Name Type Required Restrictions Description
timestamp string(date-time) false none Time when webhook ping is sent.
event string false none Only possible value is PING for ping message.

Enumerated Values

Property Value
event PING

webhookRequest

{
  "events": [
    "EXERCISE",
    "ACTIVITY_SUMMARY"
  ],
  "url": "https://myapp.example.com/acl_webhook"
}

Properties

Name Type Required Restrictions Description
events [webhookType] true none Type of events to subscribe.
url string(uri) true none Url where the webhook notification is sent.

webhookType

"EXERCISE"

Event type to subscribe. Currently only EXERCISE supported.

Properties

Name Type Required Restrictions Description
anonymous string false none Event type to subscribe. Currently only EXERCISE supported.

Enumerated Values

Property Value
anonymous EXERCISE
anonymous ACTIVITY_SUMMARY
anonymous PHYSICAL_INFORMATION

zone

{
  "index": 1,
  "lower-limit": 110,
  "upper-limit": 130,
  "in-zone": "PT4S"
}

Heart-rate zone information

Properties

Name Type Required Restrictions Description
index integer(int32) false none Zone list index
lower-limit integer(int32) false none Lower heart-rate boundary of the zone
upper-limit integer(int32) false none Upper heart-rate boundary of the zone
in-zone string false none Time duration spent in the zone ISO 8601

zones

{
  "zone": [
    {
      "index": 1,
      "lower-limit": 110,
      "upper-limit": 130,
      "in-zone": "PT4S"
    }
  ]
}

List containing the times (in zone) in different heart rate zones (i.e. Heart rate between lower and upper values). Zone is null if no zone information available.

Properties

Name Type Required Restrictions Description
zone [zone] false none List of heart rate zones.

Appendix

Detailed sport info values in exercise entity

detailed-sport-info Sport in Polar Flow
AEROBICS Aerobics
AMERICAN_FOOTBALL Football
AQUATICS Aqua fitness
BACKCOUNTRY_SKIING Backcountry skiing
BADMINTON Badminton
BALLET_DANCING Ballet
BALLROOM_DANCING Ballroom
BASEBALL Baseball
BASKETBALL Basketball
BEACH_VOLLEYBALL Beach volley
BIATHLON Biathlon
BODY_AND_MIND Body&Mind
BOOTCAMP Bootcamp
BOXING Boxing
CIRCUIT_TRAINING Circuit training
CORE Core
CRICKET Cricket
CROSS_TRAINER Cross-trainer
CROSS-COUNTRY_SKIING Skiing
CYCLING Cycling
DANCING Dancing
DOWNHILL_SKIING Downhill skiing
DUATHLON Duathlon
DUATHLON_CYCLING Cycling
DUATHLON_RUNNING Running
FIELD_HOCKEY Field hockey
FINNISH_BASEBALL Finnish baseball
FITNESS_DANCING Fitness dancing
FITNESS_MARTIAL_ARTS Fitness martial arts
FITNESS_STEP Step workout
FLOORBALL Floorball
FREE_MULTISPORT Multisport
FRISBEEGOLF Disc golf
FUNCTIONAL_TRAINING Functional training
FUTSAL Futsal
GOLF Golf
GROUP_EXERCISE Group exercise
GYMNASTICK Gymnastics
HANDBALL Handball
HIIT High-intensity interval training
HIKING Hiking
ICE_HOCKEY Ice hockey
ICE_SKATING Ice skating
INDOOR_CYCLING Indoor cycling
INDOOR_ROWING Indoor rowing
INLINE_SKATING Inline skating
JAZZ_DANCING Jazz
JOGGING Jogging
JUDO_MARTIAL_ARTS Judo
KICKBOXING_MARTIAL_ARTS Kickboxing
LATIN_DANCING Latin
LES_MILLS_BARRE LES MILLS BARRE
LES_MILLS_BODYATTACK LES MILLS BODYATTACK
LES_MILLS_BODYBALANCE LES MILLS BODYBALANCE
LES_MILLS_BODYCOMBAT LES MILLS BODYCOMBAT
LES_MILLS_BODYJAM LES MILLS BODYJAM
LES_MILLS_BODYPUMP LES MILLS BODYPUMP
LES_MILLS_BODYSTEP LES MILLS BODYSTEP
LES_MILLS_CXWORKS LES MILLS CXWORX
LES_MILLS_GRIT_ATHLETIC LES MILLS GRIT Athletic
LES_MILLS_GRIT_CARDIO LES MILLS GRIT Cardio
LES_MILLS_GRIT_STRENGTH LES MILLS GRIT Strength
LES_MILLS_RPM LES MILLS RPM
LES_MILLS_SHBAM LES MILLS SH'BAM
LES_MILLS_SPRINT LES MILLS SPRINT
LES_MILLS_TONE LES MILLS TONE
LES_MILLS_TRIP LES MILLS TRIP
MOBILITY_DYNAMIC Mobility (dynamic)
MOBILITY_STATIC Mobility (static)
MODERN_DANCING Modern
MOUNTAIN_BIKING Mountain biking
NORDIC_WALKING Nordic walking
OFFROADDUATHLON Off-road duathlon
OFFROADDUATHLON_CYCLING Mountain biking
OFFROADDUATHLON_RUNNING Trail running
OFFROADTRIATHLON Off-road triathlon
OFFROADTRIATHLON_CYCLING Mountain biking
OFFROADTRIATHLON_RUNNING Trail running
OFFROADTRIATHLON_SWIMMING Open water swimming
OPEN_WATER_SWIMMING Open water swimming
ORIENTEERING Orienteering
ORIENTEERING_MTB Mountain bike orienteering
ORIENTEERING_SKI Ski orienteering
OTHER_INDOOR Other indoor
OTHER_OUTDOOR Other outdoor
PARASPORTS_WHEELCHAIR Wheelchair racing
PILATES Pilates
POOL_SWIMMING Pool swimming
RIDING Riding
ROAD_BIKING Road cycling
ROAD_RUNNING Road running
ROLLER_BLADING Roller skating
ROLLER_SKIING_CLASSIC Classic roller skiing
ROLLER_SKIING_FREESTYLE Freestyle roller skiing
ROWING Rowing
RUGBY Rugby
RUNNING Running
SHOW_DANCING Show
SKATING Skating
SNOWBOARDING Snowboarding
SNOWSHOE_TREKKING Snowshoe trekking
SOCCER Soccer
SPINNING Spinning
SQUASH Squash
STREET_DANCING Street
STRENGTH_TRAINING Strength training
STRETCHING Stretching
SWIMMING Swimming
TABLE_TENNIS Table tennis
TELEMARK_SKIING Telemark skiing
TENNIS Tennis
TRACK_AND_FIELD_RUNNING Track&field running
TRAIL_RUNNING Trail running
TREADMILL_RUNNING Treadmill running
TRIATHLON Triathlon
TRIATHLON_CYCLING Cycling
TRIATHLON_RUNNING Running
TRIATHLON_SWIMMING Open water swimming
TROTTING Trotting
ULTRARUNNING_RUNNING Ultra running
VERTICALSPORTS_WALLCLIMBING Climbing (indoor)
VOLLEYBALL Volleyball
WALKING Walking
WATERSPORTS_CANOEING Canoeing
WATERSPORTS_KAYAKING Kayaking
WATERSPORTS_KITESURFING Kitesurfing
WATERSPORTS_SAILING Sailing
WATERSPORTS_SURFING Surfing
WATERSPORTS_WAKEBOARDING Wakeboarding
WATERSPORTS_WATERSKI Water skiing
WATERSPORTS_WINDSURFING Windsurfing
XC_SKIING_CLASSIC Classic XC skiing
XC_SKIING_FREESTYLE Freestyle XC skiing
YOGA Yoga

Exercise sample types

Key Sample type Unit
0 Heart rate bpm
1 Speed km/h
2 Cadence rpm
3 Altitude m
4 Power W
5 Power pedaling index %
6 Power left-right balance %
7 Air pressure hpa
8 Running cadence spm
9 Temperature ºC
10 Distance m
11 RR Interval ms

RR interval samples can contain NULL samples, while other sample types always have a value. NULL sample indicates missing data.

Activity zone types

Index Activity zone Description
0 Sleep Sleep and rest, lying down
1 Sedentary Sitting and other passive behaviour
2 Light Standing work, light household chores
3 Moderate Walking, dancing, child play outdoor
4 Vigorous Jogging, football, floorball
5 Non Wear Device not worn

Activity zone time series

Example data if the device is synchronized between 04:00 and 05:00. Hour 01 is time between 00:00 - 00:59.59, hour 02 01:00-01:59.59 and so on.

Hour 01 02 03 04 05 06 07 08 09 10 11 ... 24
Zone 0 PT59M PT1H PT45M1S
Zone 1
Zone 2 PT14M59S
Zone 3
Zone 4
Zone 5 PT1M

The data is for specific hour and not cumulative. If there is no data after certain hour, the data is left empty.

Activity step time series

Example data if the device is synchronized between 09:00 and 10:00.

Hour 01 02 03 04 05 06 07 08 09 10 11 ... 24
Steps 5 15 15 8 0 755 1234 956

The data is for specific hour and not cumulative. If there is no data after certain hour, the data is left empty.