Skip to main content

API

API endpoints

Credentials

1. Authorization

Authorization header is a bearer type token provided by RookMotion to each client, and it is unique per client to allow access to the API service and to redirect the client request to his specific database instance. This token must be sent in every API requests.

Endpoint:

Method: ANY
Type:
URL: ANY

Headers:

KeyValueDescription
AuthorizationBearer {{token_rm}}

2. Place Token

Place token header is a string provided by RookMotion to target the request to specific entities of the client hierarchy (client/chain/branch/room).

Access level: This token is intended to limit/filter the access to specific resources,

  • Client Level e.g. The client can have a token like client_fzagxudzny3qacvh3gtt434343 to develop a super admin with access to all his hierarchy resources (chains/branches/rooms/users/sensors/trainings) where he can add/view/modify all his resources.
  • Chain Level e.g. The client can share a token like chain_fzagxudzny3qacvh3dasdsadsas3 with a third-party app developer which will create an app for only one Chain of his hierarchy. This way when the developer requests the Chain resources (branches/rooms/users/sensors/trainings) he will get only the child resources to this Chain.
  • Branch Level e.g. The client can use a token like branch_fzagxdsffsdeqmmt8d to get only the resources of a branch (rooms/users/sensors/trainings)
  • Room Level e.g. The client can use a token like room_fzagxudzny3qacvh3gtt7jieqmmt9j to get only the resources of a room (users/sensors/trainings)

Notes:

  • Every Entity level can have multiple tokens so that the client can assign each of them to different products and remove the access to a specific product if this gets discontinued.
  • Every resource belongs to the client, so that even when a User is created using a child Entity e.g. a User added to a Room, the User is created as a client User and then linked to the room.
  • Every resource created on a child Entity is automatically linked to his parent’s entities, e.g. a User added to a Room is automatically linked to his branch/chain parent. (It is not linked to the client since all the users belongs to the client Entity).

Access type This function is available only with the security extension Two types of place_token can be generated by RookMotion

  • Default: Provides access to every resource of the token Entity, e.g., access to get the list of every User in a branch and modify them.
  • User Auth Required: This type of token, is intended to be used only in apps, where the User requires logging in into his account to access/add/modify his User data/trainings. When using this type of token the app requires to first execute the login endpoint to get a user_token. This type of token will not work for products like super administrators since It'd required to input the password of each User to access his information. This type of token must be requested only if required.

Notes:

  • Every Entity level can have multiple tokens so that the client can have tokens with the same level of access but one which requires the User to login first (to be used with apps) and another to develop a super admin panel to admin the same users and resources without requiring their passwords.

Endpoint:

Method: ANY 
Type:
URL: ANY User related

Headers:

KeyValueDescription
AuthorizationBearer {{token_rm}}
token{{token_level}}
user_token{{user_token}}

Indices


Centers

1. Branch

Endpoint:

Method: 
Type:
URL:

2. Centers

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/centers/search

Headers:

KeyValueDescription
token-level{{token_level}}
Accept-Languageen

More example Requests/Responses:

I. Example Request: Centers (empty)

Headers:

KeyValueDescription
token-level{{token_level}}
Accept-Languageen
I. Example Response: Centers (empty)
{
"data": [],
"links": {
"first": "http://apiv2.test/api/v2/centers/search?page=1",
"last": "http://apiv2.test/api/v2/centers/search?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/centers/search?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/centers/search",
"per_page": 30,
"to": null,
"total": 0
}
}

Status Code: 200

3. Chain

Endpoint:

Method: 
Type:
URL:

4. Room

Endpoint:

Method: 
Type:
URL:

Sensors

In this section you will find a list of the resources available in the RookMotion API to manage user sensors.

1. Add Sensor to user

Endpoint:

Method: POST
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/sensors/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"ownership_type": "owned"
}

More example Requests/Responses:

I. Example Request: Add Sensor to user (borrowed)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"ownership_type": "borrowed"
}
I. Example Response: Add Sensor to user (borrowed)
{
"result": "added",
"sensor_uuid": "fd7dc73d-ed43-4201-9747-720a61a5bca4"
}

Status Code: 201

II. Example Request: Add Sensor to user (owned)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"ownership_type": "owned"
}
II. Example Response: Add Sensor to user (owned)
{
"result": "added",
"sensor_uuid": "4ed4eb61-114f-4471-bc62-7ea577d3589f"
}

Status Code: 201

2. Remove Sensor from user

Endpoint:

Method: DELETE
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/sensors/{{sensor_uuid}}/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Remove Sensor from user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Status Code: 204

3. Retrieve sensors from user

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/sensors/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve sensors from user (whit data)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve sensors from user (whit data)
{
"data": [
{
"sensor_uuid": "4ed4eb61-114f-4471-bc62-7ea577d3589f",
"sensor_name": "PRUEBA-2907",
"sensor_mac": "00:1B:44:11:3A:B7",
"ownership_type": "owned",
"updated_at": "2021-08-12 20:19:13"
},
{
"sensor_uuid": "fd7dc73d-ed43-4201-9747-720a61a5bca4",
"sensor_name": "PRUEBADOS-2907",
"sensor_mac": "00:1B:91:11:7A:B9",
"ownership_type": "borrowed",
"updated_at": "2021-08-12 20:22:00"
}
],
"links": {
"first": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"last": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317",
"per_page": 30,
"to": 2,
"total": 2
}
}

Status Code: 200

II. Example Request: Retrieve sensors from user (empty data)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
II. Example Response: Retrieve sensors from user (empty data)
{
"data": [],
"links": {
"first": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"last": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/sensors/user/96559606-1846-4513-9247-cf18b1f58317",
"per_page": 30,
"to": null,
"total": 0
}
}

Status Code: 200

4. Update Sensor

Endpoint:

Method: PUT
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/sensors/{{sensor_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"mac_type": "random"
}

More example Requests/Responses:

I. Example Request: Update Sensor (ramdom)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"mac_type": "random"
}
I. Example Response: Update Sensor (ramdom)
{
"result": "updated"
}

Status Code: 200

II. Example Request: Update Sensor (public)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"name": "{{sensor_name}}",
"mac": "{{sensor_mac}}",
"mac_type": "public"
}
II. Example Response: Update Sensor (public)
{
"result": "updated"
}

Status Code: 200

Server

Get Server datetime to ping the Server

1. Retrieve server datetime

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/server/datetime

Headers:

KeyValueDescription
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve server datetime

Headers:

KeyValueDescription
Accept-Languageen
I. Example Response: Retrieve Server datetime
{
"datetime": "2021-08-12 19:40:14"
}

Status Code: 200

Summaries

En esta sección, encontrará una lista de los recursos disponibles en la API de RookMotion para obtener los Summaries.

1. Retrieve summaries types

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/summaries

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve summaries types

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve summaries types
{
"data": [
{
"id": 1,
"summary_type_uuid": "537683b5-4edd-4981-b301-47c472beb532",
"summary_name": "duration_time_tot",
"group": "time",
"units": "s"
},
{
"id": 2,
"summary_type_uuid": "5ea15fce-6756-42ef-931d-18173a67b9c1",
"summary_name": "z0_time_tot",
"group": "time",
"units": "s"
},
{
"id": 3,
"summary_type_uuid": "718e51fd-7507-4c27-b1c7-233776a29c9b",
"summary_name": "z1_time_tot",
"group": "time",
"units": "s"
},
{
"id": 4,
"summary_type_uuid": "d225c105-5ce7-47dc-ac0f-a1b2746dfbb9",
"summary_name": "z2_time_tot",
"group": "time",
"units": "s"
},
{
"id": 5,
"summary_type_uuid": "b40bc80e-f50f-47c6-b244-149b4e1022e9",
"summary_name": "z3_time_tot",
"group": "time",
"units": "s"
},
{
"id": 6,
"summary_type_uuid": "3dc3aad7-501e-4cb1-ac13-096db3071780",
"summary_name": "z4_time_tot",
"group": "time",
"units": "s"
},
{
"id": 7,
"summary_type_uuid": "47e5ac87-f335-4391-96cc-388fe7da3d17",
"summary_name": "z5_time_tot",
"group": "time",
"units": "s"
},
{
"id": 8,
"summary_type_uuid": "5855d7bd-ee5d-4f7b-b8fe-b130f94e6a7f",
"summary_name": "z6_time_tot",
"group": "time",
"units": "s"
},
{
"id": 9,
"summary_type_uuid": "d079f9e6-e204-4a55-b30c-94b1cec3d23b",
"summary_name": "z7_time_tot",
"group": "time",
"units": "s"
},
{
"id": 100,
"summary_type_uuid": "bb9d2ae9-79b8-4ad6-8256-dd45310687a3",
"summary_name": "heart_rate_min",
"group": "heart_rate",
"units": "bpm"
},
{
"id": 101,
"summary_type_uuid": "5b1960b9-c490-496e-a20a-cd58d050eb95",
"summary_name": "heart_rate_avg",
"group": "heart_rate",
"units": "bpm"
},
{
"id": 102,
"summary_type_uuid": "99ce771b-9fc0-4d5a-bbc4-76a625578bd9",
"summary_name": "heart_rate_max",
"group": "heart_rate",
"units": "bpm"
},
{
"id": 200,
"summary_type_uuid": "d8966576-9b04-4504-a96e-daf6b30813c2",
"summary_name": "heart_rate_variability_min",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 201,
"summary_type_uuid": "ffedada6-9e38-41d1-80bd-58f5fe00f316",
"summary_name": "heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 202,
"summary_type_uuid": "c9b828d5-b34b-4285-9237-4e07bdce507f",
"summary_name": "heart_rate_variability_max",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 203,
"summary_type_uuid": "5344d0dc-d640-400c-91f4-63f4781f4672",
"summary_name": "z0_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 204,
"summary_type_uuid": "0e5159df-5c18-487d-b912-5d5da93aafe8",
"summary_name": "z1_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 205,
"summary_type_uuid": "c7c5eec2-f0a4-48f5-93c2-a77645aa863a",
"summary_name": "z2_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 206,
"summary_type_uuid": "129cab69-3a34-4b15-8597-0958a708f6ac",
"summary_name": "z3_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 207,
"summary_type_uuid": "9a5d3273-3188-47a6-96ef-9b080463c22b",
"summary_name": "z4_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 208,
"summary_type_uuid": "19a3dc12-ace3-4520-9f45-fd0258bf7ba6",
"summary_name": "z5_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 209,
"summary_type_uuid": "6006596c-5ad6-4355-83e2-894bc536fbc6",
"summary_name": "z6_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 210,
"summary_type_uuid": "15561cdc-3421-4f7c-8251-009e7ab44c86",
"summary_name": "z7_heart_rate_variability_avg",
"group": "heart_rate_variability",
"units": "ms"
},
{
"id": 300,
"summary_type_uuid": "ee1e726d-84ca-4440-872f-3ae89896a800",
"summary_name": "effort_min",
"group": "effort",
"units": "percentage"
},
{
"id": 301,
"summary_type_uuid": "f462f15e-dc65-477b-b223-1b2ebcace0e0",
"summary_name": "effort_avg",
"group": "effort",
"units": "percentage"
},
{
"id": 302,
"summary_type_uuid": "8e06c211-f276-4ab4-a9aa-508c387cbd7c",
"summary_name": "effort_max",
"group": "effort",
"units": "percentage"
},
{
"id": 400,
"summary_type_uuid": "6ce6a4a1-fef7-423a-b9bf-e23de03fd006",
"summary_name": "calories_tot",
"group": "calories",
"units": "kcal"
},
{
"id": 401,
"summary_type_uuid": "5282bc3b-c7ad-447a-bc43-48cea101bc41",
"summary_name": "z0_calories_tot",
"group": "calories",
"units": "kcal"
},
{
"id": 402,
"summary_type_uuid": "cde95f55-2546-41a3-8329-b97d6bd20c96",
"summary_name": "z1_calories_tot",
"group": "calories",
"units": "kcal"
},
{
"id": 403,
"summary_type_uuid": "e2fc989e-e856-4b85-a27b-9dced7421824",
"summary_name": "z2_calories_tot",
"group": "calories",
"units": "kcal"
}
],
"links": {
"first": "http://apiv2.test/api/v2/summaries?page=1",
"last": "http://apiv2.test/api/v2/summaries?page=3",
"prev": null,
"next": "http://apiv2.test/api/v2/summaries?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 3,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/summaries?page=1",
"label": "1",
"active": true
},
{
"url": "http://apiv2.test/api/v2/summaries?page=2",
"label": "2",
"active": false
},
{
"url": "http://apiv2.test/api/v2/summaries?page=3",
"label": "3",
"active": false
},
{
"url": "http://apiv2.test/api/v2/summaries?page=2",
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/summaries",
"per_page": 30,
"to": 30,
"total": 75
}
}

Status Code: 200

Training type

In this section, you will find a list of the resources available in the RookMotion API to obtain the Type Training

0. Add training type

Endpoint:

Method: POST
Type: RAW
URL: {{base_url}}/api/v2/trainings/type

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"training_name": [
{
"name": "test",
"lang": "es"
},
{
"name": "test",
"lang": "en"
}
],
"requirements": {
"use_heart_rate": 1,
"use_steps": 1,
"step_options": "steps",
"use_cycling": 0,
"use_gps": 0
}
}

More example Requests/Responses:

I. Example Request: Add training type

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"training_name": [
{
"name": "test",
"lang": "es"
},
{
"name": "test",
"lang": "en"
}
],
"requirements": {
"use_heart_rate": 1,
"use_steps": 1,
"step_options": "steps",
"use_cycling": 0,
"use_gps": 0
}
}

I. Example Response: Add training type

{
"result": "added",
"training_type_uuid": "54a9f78c-5fb5-4f28-88dc-28ac20efb581"
}

Status Code: 201

1. Create training types extra attributes

Endpoint:

Method: POST
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/type/{{training_type_uuid}}/extra-attributes

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"attributes": "{{attribute}}",
"content": "{{content}}"
}

More example Requests/Responses:

I. Example Request: Retrieve training types

Headers:

KeyValueDescription
token-levelchain_fzagxudzny3qacvh3gtt7jieqmmt9j
Accept-Languageen
I. Example Response: Retrieve training types
{
"data": [
{
"training_type_uuid": "1dc7e4e1-8c85-4f06-8bcd-cccbf53ad069",
"trainig_name": "soccer",
"use_heart_rate": 1
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/type?page=1",
"last": "http://apiv2.test/api/v2/trainings/type?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/type?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/type",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

2. Retrieve training types

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/type

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve training types

Headers:

KeyValueDescription
token-level{{token_level}}
Accept-Languageen
I. Example Response: Retrieve training types
{
"data": [
{
"training_type_uuid": "1dc7e4e1-8c85-4f06-8bcd-cccbf53ad069",
"trainig_name": "default 1",
"use_heart_rate": 1
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/type?page=1",
"last": "http://apiv2.test/api/v2/trainings/type?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/type?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/type",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

3. Retrieve training types extra attributes

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/type/{{training_type_uuid}}/extra-attributes

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve training types

Headers:

KeyValueDescription
token-levelchain_fzagxudzny3qacvh3gtt7jieqmmt9j
Accept-Languageen
I. Example Response: Retrieve training types
{
"data": [
{
"training_type_uuid": "1dc7e4e1-8c85-4f06-8bcd-cccbf53ad069",
"trainig_name": "soccer",
"use_heart_rate": 1
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/type?page=1",
"last": "http://apiv2.test/api/v2/trainings/type?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/type?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/type",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

4. delete training types extra attributes

Endpoint:

Method: DELETE
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/type/extra-attributes/{{training_type_attributes}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve training types

Headers:

KeyValueDescription
token-levelchain_fzagxudzny3qacvh3gtt7jieqmmt9j
Accept-Languageen
I. Example Response: Retrieve training types
{
"data": [
{
"training_type_uuid": "1dc7e4e1-8c85-4f06-8bcd-cccbf53ad069",
"trainig_name": "soccer",
"use_heart_rate": 1
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/type?page=1",
"last": "http://apiv2.test/api/v2/trainings/type?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/type?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/type",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

5. update training types extra attributes

Endpoint:

Method: PUT
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/type/extra-attributes/{{training_type_attributes}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"attributes": "{{attribute}}",
"content": "{{content}}",
"status": 1
}

More example Requests/Responses:

I. Example Request: Retrieve training types

Headers:

KeyValueDescription
token-levelchain_fzagxudzny3qacvh3gtt7jieqmmt9j
Accept-Languageen
I. Example Response: Retrieve training types
{
"data": [
{
"training_type_uuid": "1dc7e4e1-8c85-4f06-8bcd-cccbf53ad069",
"trainig_name": "soccer",
"use_heart_rate": 1
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/type?page=1",
"last": "http://apiv2.test/api/v2/trainings/type?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/type?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/type",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

Trainings

In this section you will find a list of the resources available in the RookMotion API to manage user trainings.

1. Add training to user

Endpoint:

Method: POST
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"start":"2022-04-26 00:00:24",
"end":"2022-04-26 00:00:26",
"training_type_uuid": "{{training_type_uuid}}",
"sensor_uuid": "{{sensor_uuid}}",
"device_type":"app",
"groupal_mode": 0,
"records": {
"hr_derived_records":[
{
"timestamp": "1900-07-29 00:00:01",
"heart_rate": 80,
"effort": 100,
"calories": 2000,
"heart_rate_variability": 2000
},
{
"timestamp": "1900-07-29 00:00:02",
"heart_rate": 81,
"effort": 99,
"calories": 2001,
"heart_rate_variability": 2000
}
],
"steps_derived_records":[
{
"timestamp": "1900-07-29 00:00:01",
"steps": 5000,
"cadence": 20
},
{
"timestamp": "1900-07-29 00:00:02",
"steps": 5001,
"cadence": 21
}
],
"bicycle_derived_records":[
{
"timestamp": "1900-07-29 00:00:01",
"cadence": 20,
"power": 1.0,
"resistance": 1.8
},
{
"timestamp": "1900-07-29 00:00:02",
"cadence": 20,
"power": 1.1,
"resistance": 1.9
}
]
},
"summaries": [
{
"summary_type_id": 2,
"value": 3600
}
]
}

More example Requests/Responses:

I. Example Request: Add training to user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"start":"1991-07-29 00:00:00",
"end":"1991-07-29 00:00:02",
"training_type_uuid": "{{training_type_uuid}}",
"sensor_uuid": "{{sensor_uuid}}",
"device_type":"app",
"groupal_mode": 0,
"records": {
"hr_derived_records":[
{
"timestamp": "1900-07-29 00:00:01",
"heart_rate": 80,
"effort": 100,
"calories": 2000,
"heart_rate_variability": 2000
},
{
"timestamp": "1900-07-29 00:00:02",
"heart_rate": 81,
"effort": 99,
"calories": 2001,
"heart_rate_variability": 2000
}
],
"steps_derived_records":[
{
"timestamp": "1900-07-29 00:00:01",
"steps": 5000,
"cadence": 20
},
{
"timestamp": "1900-07-29 00:00:02",
"steps": 5001,
"cadence": 21
}
]
},
"summaries": [
{
"summary_type_id": 2,
"value": 3600
}
]
}
I. Example Response: Add training to user
{
"result": "added",
"training_uuid": "fa27bcbf-6927-470e-aba7-bd3e0637a8ef"
}

Status Code: 201

2. Remove training user

Endpoint:

Method: DELETE
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/{{training_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Remove training user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Status Code: 204

3. Retrieve training information of user

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/{{training_uuid}}/show

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve training information of user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve training information of user
{
"start": "1991-07-29 00:00:00",
"end": "1991-07-29 00:00:02",
"device_type": "app",
"groupal_mode": 0,
"training_type": "default 1",
"Sensor": "PRUEBA-2907",
"records": {
"hr_derived_records": [],
"steps_derived_records": []
},
"summaries": {
"z0_time_tot": "3600.0000"
},
"rewards": {
"calories_points": "0.0000"
}
}

Status Code: 200

4. Retrieve sum summaries

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/summaries/2/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve sum summaries

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve sum summaries
{
"result": "3600.0000"
}

Status Code: 200

5. Retrieve training state of user

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/{{training_uuid}}/status

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve training state of user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve training state of user
{
"result": "syncing"
}

Status Code: 200

6. Retrieve trainings of user

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/trainings/user/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve trainings of user

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve trainings of user
{
"data": [
{
"training_uuid": "fa27bcbf-6927-470e-aba7-bd3e0637a8ef",
"start": "1991-07-29 00:00:00",
"end": "1991-07-29 00:00:02",
"training_type": "default 1",
"device_type": "app",
"groupal_mode": 0,
"processed": 1,
"summaries": {
"z0_time_tot": "3600.0000"
},
"rewards": {
"calories_points": "0.0000"
}
}
],
"links": {
"first": "http://apiv2.test/api/v2/trainings/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"last": "http://apiv2.test/api/v2/trainings/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/trainings/user/96559606-1846-4513-9247-cf18b1f58317?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/trainings/user/96559606-1846-4513-9247-cf18b1f58317",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

Users

In this section you will find a list of the resources available in the RookMotion API to manage users.

1. Add user to RookMotion

Endpoint:

Method: POST
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/users

Headers:

KeyValueDescription
token-level{{token_level}}
Accept-Languageen
Acceptapplication/json

Body:

{
"email": "{{user_email}}"
}

More example Requests/Responses:

I. Example Request: Add user to RookMotion

Headers:

KeyValueDescription
token-level{{token_level}}
Accept-Languageen
Acceptapplication/json

Body:

{
"email": "{{user_email}}"
}
I. Example Response: Add user to RookMotion
{
"user_uuid": "ec34ca47-caac-445e-a456-dd0684c1f536"
}

Status Code: 201

2. External user

Endpoint:

Method: 
Type:
URL:

3. Information

Endpoint:

Method: 
Type:
URL:

4. Physiological variables

Endpoint:

Method: 
Type:
URL:

5. Remove user for RookMotion

Endpoint:

Method: DELETE
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/users/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Remove user for RookMotion

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Status Code: 204

6. Retrieve user status

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/users/{{user_email}}/status

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve user status

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve user status
{
"user_uuid": "ec34ca47-caac-445e-a456-dd0684c1f536",
"user_status": 1,
"profile_filled_at": null
}

Status Code: 200

7. Retrieve client users

Endpoint:

Method: GET
Type:
URL: https://api2.rookmotion.rookeries.dev/api/v2/users

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

More example Requests/Responses:

I. Example Request: Retrieve client users (empty data)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
I. Example Response: Retrieve client users (empty data)
{
"data": [],
"links": {
"first": "http://apiv2.test/api/v2/users?page=1",
"last": "http://apiv2.test/api/v2/users?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/users",
"per_page": 30,
"to": null,
"total": 0
}
}

Status Code: 200

II. Example Request: Retrieve client users (user information empty)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen
II. Example Response: Retrieve client users (user information empty)
{
"data": [
{
"user_uuid": "ec34ca47-caac-445e-a456-dd0684c1f536",
"name": null,
"email": "prueba@rookmotion.com",
"birthday": null,
"sex": null
}
],
"links": {
"first": "http://apiv2.test/api/v2/users?page=1",
"last": "http://apiv2.test/api/v2/users?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiv2.test/api/v2/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://apiv2.test/api/v2/users",
"per_page": 30,
"to": 1,
"total": 1
}
}

Status Code: 200

8. update user email

Endpoint:

Method: PUT
Type: RAW
URL: https://api2.rookmotion.rookeries.dev/api/v2/users/{{user_uuid}}

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"email": "{{user_email}}"
}

More example Requests/Responses:

I. Example Request: update user email

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"email": "{{user_email}}"
}
I. Example Response: update user email
{
"result": "updated"
}

Status Code: 200

II. Example Request: update user email (user without change)

Headers:

KeyValueDescription
token-level{{token_level}}
Acceptapplication/json
Accept-Languageen

Body:

{
"email": "{{user_email}}"
}
II. Example Response: update user email (user without change)
{
"result": "without changes"
}

Status Code: 200

Available Variables:

KeyValueType
token_rm
base_urlhttps://api2.rookmotion.rookeries.dev

Back to top

Made with by thedevsaddam | Generated at: 2022-05-31 13:36:55 by docgen