Introduction
Welcome to the Everfit API! You can use our API to access Everfit Public API endpoints, which can help to manage and sync data of client and certain public features in our database.
Authentication
Everfit uses API tokens to allow access to the API. You can contact us to get your API token.
We expect for the API token to be included in all API requests to the server in a header that looks like the following:
api-token: TOKEN
Errors
The Everfit API uses the following error codes common:
Error Code | Error Detail | Meaning |
---|---|---|
403 | INVALID_API_KEY | Invalid api token. |
403 | END_POINT_NOT_FOUND | The end point is not found. |
403 | QUOTA_EXCEEDED | The request cannot be completed because you have exceeded your quota. |
403 | CANNOT_ACCESS | The request cannot access by |
400 | MISSING_PARAMETER | The request missing a required parameter. |
500 | E_SERVER_ERROR | Internal Server Error -- We had a problem with our server. Try again later. |
Clients
Add a new client
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/add-new-client" \
-X POST \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"firstName": "First Name",
"lastName": "Last Name",
"email": "emailtest@everfit.io",
"id": "62861a2900feae26a2f4e523",
"invitationLink": "https://client.everfit.io/signup/uzIihN807K",
"isArchived": false,
}
}
This endpoint adds new a client.
HTTP Request
POST https://public-api.everfit.io/public-api/add-new-client
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
firstName | required | String Client's firstname |
|
lastName | required | String Client's lastname |
|
required | String Client's email |
||
type | required | Enum[In-Person, Online, Hybrid] Client's type |
|
sendMail | required | Boolean We sent email for client |
|
trainerEmail | required | String Trainer's email |
Get id of a client by email
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/get-client-id?email=[email_client]" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": "62861a2900feae26a2f4e523"
}
This endpoint get id of a client by email.
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
required | String Client's email |
Get all ids of client by email
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/get-all-client-ids?email=[email_client]" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "634e6fe93ccc12001b8f3316",
"first_name": "First Name 1",
"last_name": "Last Name 1"
},
{
"id": "634f775e6f1b430016036f43",
"first_name": "First Name 2",
"last_name": "Last Name 2"
}
]
}
This endpoint get all ids of client by email.
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
required | String Client's email |
Archive a client
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/archive-client" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": { "success": true }
}
[FAILURE][bad request] The above command returns JSON structured like this:
{
"code": 400,
"error": "INVALID_CLIENT",
"reason": "Invalid client."
}
This endpoint archive a client.
HTTP Request
POST https://public-api.everfit.io/public-api/archive-client
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
client | required | String Client's id |
Unarchive a client
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/unarchive-client" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": { "success": true }
}
[FAILURE][bad request] The above command returns JSON structured like this:
{
"code": 400,
"error": "INVALID_CLIENT",
"reason": "Invalid client."
}
This endpoint unarchive a client.
HTTP Request
POST https://public-api.everfit.io/public-api/unarchive-client
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
client | required | String Client's id |
Get detail of a client by client id
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/get-client-detail?client=[client_id]" \
-X GET \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"id": "5c33a8a395c6452fd6eda5f1",
"firstName": "First Name",
"lastName": "Last Name",
"email": "test@everfit.io",
"isArchived": false,
"trainerFullName": "Full Name"
}
}
[FAILURE][bad request] The above command returns JSON structured like this:
{
"code": 400,
"error": "INVALID_CLIENT",
"reason": "Invalid client."
}
This endpoint get details of a client by client id.
HTTP Request
GET https://public-api.everfit.io/public-api/get-client-detail?client=[client_id]
Query Parameters
Parameter | Default | Required | Description |
---|---|---|---|
client | Yes | String Client's id |
Register a client by the invite link of the workspace.
comming soon
comming soon
curl --location --request POST 'https://public-api.everfit.io/public-api/client-register' \
--header 'api-token: [api-token]' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "First name",
"lastName": "Last name",
"email": "test@everfit.io",
"password": "randompassword",
"trainerEmail": "email_coach@everfit.io"
}'
Request Body Parameters
Parameter | Required | Description |
---|---|---|
firstName | yes | String The first name of the client. |
lastName | yes | String The last name of the client. |
yes | String The email address of the client. |
|
password | yes | String The password for the client's account. Password must be at least 8 characters long. |
trainerEmail | no | String Trainer's email. The email of the coach that the client will be assigned to. |
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"id": "5c33a8a395c6452fd6eda5f1",
"firstName": "First name",
"lastName": "Last name",
"email": "test@everfit.io",
"isArchived": false
}
}
[FAILURE][bad request] The above command returns JSON structured like this:
{
"error": "PARAMETER_INVALID",
"reason": "Missing a required parameter or value is invalid.",
"message": "password length must be at least 8 characters long"
}
Get last active for a client
comming soon
comming soon
curl --location --request GET 'https://public-api.everfit.io/public-api/clients/get-last-active?client={[clientId]or[email]}' \
--header 'api-token: [api-token]' \
--header 'Content-Type: application/json'
Request Body Parameters
Parameter | Required | Description |
---|---|---|
client | yes | String The email or client ID of the client. |
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"lastActivity": "2023-10-03T20:07:47.511+00:00",
}
}
[FAILURE][bad request] The above command returns JSON structured like this:
{
"error": "PARAMETER_INVALID",
"reason": "Missing a required parameter or value is invalid.",
"message": "Invalid client value."
}
Get client details by email
comming soon
comming soon
curl --location --request POST 'https://public-api.everfit.io/public-api/clients/get-by-emails' \
--header 'api-token: [api-token]' \
--header 'Content-Type: application/json' \
--data-raw '{
"emails": ["firstexample@everfit.io", "secondexample@everfit.io"]
}'
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "619a3907d3b10700145b56fe",
"firstName": "First",
"lastName": "Example",
"email": "firstexample@everfit.io",
"isArchived": false,
"trainerFullName": "Everfit Trainer"
},
{
"id": "619a3a8188e0f3001427becb",
"firstName": "Second",
"lastName": "Example",
"email": "secondexample@everfit.io",
"isArchived": false,
"trainerFullName": "Everfit Trainer"
}
]
}
This endpoint get clients details by email
HTTP Request
POST https://public-api.everfit.io/public-api/clients/get-by-emails
Body Parameters
Parameter | Default | Required | Description |
---|---|---|---|
emails | Yes | String or Array A list of client's emails |
Errors Client
The following error codes relative to management client:
Error Code | Error Detail | Meaning |
---|---|---|
400 | TRAINER_NOT_FOUND | The trainer cannot found. |
400 | TEAM_NOT_FOUND | The workspace cannot found. |
400 | INVALID_CLIENT | Invalid client. |
400 | PARAMETER_INVALID | A required parameter is missing or the value provided is invalid. |
Coach
Get id of a coach by email
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/coach/get-coach-id?email=[email_coach]" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": "5c8be5d1f608a67d9df23571"
}
This endpoint get id of a coach by email.
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
required | String Coach's email |
Errors Coach
The following error codes relative to management coach:
Error Code | Error Detail | Meaning |
---|---|---|
400 | EMAIL_NOT_FOUND | The system can not found the email. |
On demand workout
Get list collection
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/get-list-collection?page=1&limit=10" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"list": [
{
"name": "Collection 1",
"type": "Type 1",
"id": "62861a2900feae26a2f4e523"
},
{
"name": "Collection 2",
"type": "Type 2",
"id": "62861a2900feae26a2f4e523"
}
],
"total": 9,
"limit": 10,
"page": 1
}
}
This endpoint get list collection.
HTTP Request
GET https://public-api.everfit.io/public-api/on-demand-workout/get-list-collection
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
page | required | Number A cursor for pagination across multiple pages of results |
|
limit | required | Number A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
Add client to the workout collection
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/on-demand-workout/add-client-to-workout-collection" \
-X POST \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data" : {
"success": "true"
}
}
This endpoint adds a client to the workout collection
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clientId | required | String Client's id |
|
collectionId | required | String Collection's id |
Remove a client from workout collection
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/on-demand-workout/remove-client-from-workout-collection" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": { "success": true }
}
This endpoint removes a client from workout collection
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clientId | required | String Client's id |
|
collectionId | required | String Collection's id |
Get list collection of client by client id
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/on-demand-workout/get-list-collection-of-client?page=1&limit=2&client=63229aada2c1f400151e8efa" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"list": [
{
"name": "Collection 1",
"type": "Type 1",
"id": "62861a2900feae26a2f4e523"
},
{
"name": "Collection 2",
"type": "Type 2",
"id": "62861a2900feae26a2f4e523"
}
],
"total": 9,
"limit": 2,
"page": 1
}
}
This endpoint get list collection.
HTTP Request
GET https://public-api.everfit.io/public-api/on-demand-workout/get-list-collection-of-client
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
page | required | Number A cursor for pagination across multiple pages of results |
|
limit | required | Number A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
|
client | required | String Client's id. |
Errors On Demand Workout
The following error codes relative to on-demand workout:
Error Code | Error Detail | Meaning |
---|---|---|
400 | WORKOUT_COLLECTION_NOT_FOUND | The workout collection cannot found. |
400 | INVALID_CLIENT | Invalid client. |
Program
Get list library program
- This endpoint get all programs library of a workspace.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/programs" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "62f10b53f90fc10017bfc8c5",
"title": "Title example",
"description": "Loosely based off of Mark Rippetoe’s Starting Strength. A full body, free weight program that is designed for newcomers or those that have taken a break from weight training. Even if you're not a newbie. This program is beneficial to all.",
"is_demo": true,
"active_sync": false,
"weeks": 4,
"total_workouts": 9
}
]
}
Assign clients to a program library
- This endpoint assign clients to a program library.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/programs/:programId/assign-clients" \
-X POST \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "62f10b53f90fc10017bfc8c5",
"title": "Title Example",
"description": "Loosely based off of Mark Rippetoe’s Starting Strength. A full body, free weight program that is designed for newcomers or those that have taken a break from weight training. Even if you're not a newbie. This program is beneficial to all.",
"is_demo": true,
"active_sync": false,
"weeks": 4,
"total_workouts": 9,
"client": "62f10b53f90fc10017bfc8fc",
"program": "62f10b53f90fc10017bfc8gc"
}
]
}
[ERROR] The above command returns JSON structured like this:
{
"data": {
"error": "CLIENT_INVALID",
"reason": "Client ids invalid 62f10b53f90fc10017bfc8fc, 62f10b53f90fc10017bfc8fc."
}
}
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
programId | required | String Program library's id |
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clients | required | Array A list of client's id |
|
startingAt | required | Number The first day of the program calendar that the client is assigned to |
|
endingAt | required | Number The last day of the program calendar that the client is assigned to |
|
date | required | String The actual day of the client's training calendar that the program starts. The date format YYYY-MM-DD |
Get program instance's id
- This endpoint get all program instance's id that a client assigned
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/program-instances?clientId=[clientId]" \
-X GET \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "62f10b53f90fc10017bfc8c5",
"title": "Title Example",
"description": "Loosely based off of Mark Rippetoe’s Starting Strength. A full body, free weight program that is designed for newcomers or those that have taken a break from weight training. Even if you're not a newbie. This program is beneficial to all.",
"is_demo": true,
"active_sync": false,
"weeks": 4,
"total_workouts": 9,
"client": "62f10b53f90fc10017bfc8c5",
"program": "62f10b53f90fc10017bfc8c5"
}
]
}
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clientId | required | String Client's id |
Remove program instance
- This endpoint remove instance.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/program-instances/:instanceId" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": true
}
}
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
instanceId | required | String Assigned program instance’s id |
Bulk remove program instance
- This endpoint is bulk remove instance.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/program-instances/bulk-remove" \
-X POST \
-H "api-token: <api-token>"
--data-raw '{
"instanceIds": ["631727a9b03e690019c01746"]
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": true
}
}
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
instanceIds | required | Array A list assigned program instance's id |
Errors Program
The following error codes relative to management client:
Error Code | Error Detail | Meaning |
---|---|---|
400 | INVALID_CLIENT | Invalid client. |
400 | INVALID_PROGRAM | Invalid program. |
400 | NUMBER_DAY_ERROR | The endingAt should be less than equal number day of week of a program. |
400 | DATE_INVALID | Date must be larger than or equal to date now. |
Autoflow
Get list library autoflow
- This endpoint get all library autoflows of a workspace.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/autoflows" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "62f10b49f90fc10017bfc058",
"name": "2 Week Fitness Challenge",
"isSettingTurnedOff": false,
"type": "interval",
"lastUsed": "2022-08-17T10:27:53.121Z",
"numberOfWeeks": 4,
"clientCounts": {
"total": 1,
"active": 0,
"paused": 0,
"completed": 0,
"waitingToStart": 1
},
"share": 0
}
]
}
Assign clients to an autoflow library
- This endpoint assign clients to a autoflow library.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/autoflows/:autoflowId/assign-clients" \
-X POST \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": true,
"listSuccess": [],
"listError": [
{
"client": "6304337fe6ea940016e7616d",
"reason": "Client already added to this autoflow."
}
]
}
}
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clients | required | Array or String A list client's id or a client's id |
|
startedOn | optional | Number Required for the "By Day Sequence" autoflow. It defines the actual day of the client's calendar that the autoflow starts.Format: number (E.g: 1, 2, 3 ) |
|
startedDate | optional | String It defines the first day of the autoflow calendar that the client is assigned to. Format: YYYY-MM-DD (E.g: 2023-09-06) If the value of this field is empty or null, the client will be assigned to today. |
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
autoflowId | required | String Autoflow library's id |
Autoflow remove client
- This endpoint remove client.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/autoflows/:autoflowId/remove-clients" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": true,
"listError": [
{
"client": "62f10c40f90fc10017bfcad7",
"reason": "INVALID_CLIENT"
}
],
"listSuccess": [
{
"client": "63049153bca21c86008813eb",
"progression_day": 10
}
]
}
}
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clients | required | Array or String A list client's id or a client's id |
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
autoflowId | required | String Autoflow library's id |
Data Response
Parameter | Default | Description |
---|---|---|
client | String Client's id |
|
reason | String The error code detail |
|
progression_day | Number The day index indicates progress of client in Interval Autoflow , return -1 for Exact date Autoflow |
|
Errors Autoflow
The following error codes relative to management client:
Error Code | Error Detail | Meaning |
---|---|---|
400 | INVALID_CLIENT | Invalid client id. |
400 | INVALID_AUTOFLOW | Invalid autoflow id. |
400 | DATE_INVALID | The StartedDate should must be from today forward or Date is wrong format YYYY-MM-DD or invalid date. |
400 | NUMBER_DAY_ERROR | The start on must be less or equal number day of week of autoflow.. |
Studio program
Get list studio program
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/studio-program/get-list-collection?page=1&limit=10" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"list": [
{
"id": "6319974c528fc50014388fd9",
"isPublished": false,
"numberOfClients": 0,
"numberOfWorkouts": 9,
"numberOfWeeks": 4,
"programName": "Demo"
}
],
"page": 1,
"limit": 10,
"total": 1
}
}
This endpoint get list collection.
HTTP Request
GET https://public-api.everfit.io/public-api/studio-program/get-list-collection
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
page | required | Number A cursor for pagination across multiple pages of results |
|
limit | required | Number A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
|
isPublished | optional | Boolean The status of studio program |
Add client to the studio program
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/studio-program/add-client-to-studio-program" \
-X POST \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data" : {
"success": "true"
}
}
This endpoint add a client to the studio program
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clientId | required | String Client's id |
|
studioProgramId | required | String Studio program's id |
Remove a client from studio program
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/studio-program/remove-client-from-studio-program" \
-X POST \
-H "api-token: <api-token>"
comming soon
[SUCCESS] The above command returns JSON structured like this:
{
"data": { "success": true }
}
This endpoint removes a client from studio program
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
clientId | required | String Client's id |
|
studioProgramId | required | String Studio program's id |
Get list collection studio program of client by client id
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/studio-program/get-list-collection-of-client?page=1&limit=2&client=63229aada2c1f400151e8efa" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"list": [
{
"id": "6319974c528fc50014388fd0",
"isPublished": false,
"numberOfClients": 0,
"numberOfWorkouts": 9,
"numberOfWeeks": 4,
"programName": "Demo"
}
],
"total": 1,
"limit": 2,
"page": 1
}
}
This endpoint get list collection.
HTTP Request
GET https://public-api.everfit.io/public-api/studio-program/get-list-collection-of-client
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
page | required | Number A cursor for pagination across multiple pages of results |
|
limit | required | Number A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
|
client | required | String Client's id. |
Errors On Studio Program
The following error codes relative to on-demand workout:
Error Code | Error Detail | Meaning |
---|---|---|
400 | INVALID_STUDIO_PROGRAM | The studio program cannot found. |
400 | INVALID_CLIENT | Invalid client. |
Forum
Get all forum of a workspace
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/forums" \
-X GET \
-H "api-token: <api-token>"
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "62fb712c3edd8a001710d374",
"name": "Forum A",
"description": "Description example for A",
"banner": null,
"noOfMembers": 3
},
{
"id": "62861a2900feae26a2f4e523",
"name": "Forum B",
"description": "Description example for B",
"banner": "https://public-api.everfit.io/images/example.jpg",
"noOfMembers": 10
}
]
}
Add members to a forum
- This endpoint add members to a forum.
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/forums/:forumId/add-members" \
-X POST \
-H "api-token: <api-token>"
--data-raw '{
"members": ["631727a9b03e690019c01746"]
}'
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "63997282a9c2354266b14783",
"email": "email.example@everfit.io",
"firstName": "First Name",
"lastName": "Last Name",
"avatar": "",
"role": 0,
"color": "#8FE3EB"
}
]
}
Body Parameters
Parameter | Default | Type | Description |
---|---|---|---|
members | required | Array A list client's id |
Get list member of a forum
comming soon
comming soon
curl "https://public-api.everfit.io/public-api/forums/:forumId/get-members" \
-X GET \
-H "api-token: <api-token>"
}'
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"id": "635a47f6ff9ffd9c06f00b09",
"email": "test@everfit.io",
"firstName": "First Name",
"lastName": "Last Name",
"color": "#FFCC81",
"avatar": "",
"role": 0
}
]
}
Query Parameters
Parameter | Default | Type | Description |
---|---|---|---|
forumId | required | String Forum's id |
Errors Forums
The following error codes relative to forums:
Error Code | Error Detail | Meaning |
---|---|---|
400 | INVALID_CLIENT | Invalid client. |
400 | INVALID_FORUM | Invalid forum. |
Resource Collections
Get list resource collections
comming soon
comming soon
curl --location --request GET 'https://public-api.everfit.io/public-api/resource-collection/get-list-collection?page=<page>&limit=<limit>' \
--header 'api-token: <api-token>'
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"list": [
{
"id": "62fb4dac3207bb00179983dd",
"numberOfResources": 0,
"numberOfClients": 3,
"name": "First Resource"
},
{
"id": "62fc67a1b1ef6800173210bc",
"numberOfResources": 0,
"numberOfClients": 1,
"name": "Second Resource"
}
],
"page": 1,
"limit": 2,
"total": 5
}
}
Query Parameters
Parameter | Default | Required | Description |
---|---|---|---|
page | Yes | Number The page number to retrieve. |
|
limit | Yes | Number The number of collections to retrieve per page. |
Get list member in a resource collection
comming soon
comming soon
curl --location --request GET 'https://public-api.everfit.io/public-api/resource-collection/get-list-member' \
--header 'api-token: <api-token>'
[SUCCESS] The above command returns JSON structured like this:
{
"data": [
{
"firstName": "First Name",
"lastName": "Last Name",
"email": "emailtest@everfit.io",
"_id": "62861a2900feae26a2f4e523"
},
{
"firstName": "First Name A",
"lastName": "Last Name A",
"email": "emailtestb@everfit.io",
"_id": "62861a2900feae26a2f4e524"
}
]
}
Query Parameters
Parameter | Default | Required | Description |
---|---|---|---|
resourceCollectionId | Yes | String The ID of the resource collection for which to retrieve members. |
Add clients to a resource collection
comming soon
comming soon
curl --location --request POST 'https://public-api.everfit.io/public-api/resource-collection/assign-clients' \
--header 'api-token: <api-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"clients": [
"<client-id-1>",
"<client-id-2>"
],
"resourceCollectionId": "<resource-collection-id>"
}'
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": "true"
}
}
Body Parameters
Parameter | Default | Required | Description |
---|---|---|---|
clients | Yes | Array or String A list of client IDs |
|
resourceCollectionId | Yes | String The ID of the collection |
Unassign clients from a resource collection
comming soon
comming soon
curl --location --request POST 'https://public-api.everfit.io/public-api/resource-collection/unassign-clients' \
--header 'api-token: <api-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"clients": [
"<client-id-1>",
"<client-id-2>"
],
"resourceCollectionId": "<resource-collection-id>"
}'
[SUCCESS] The above command returns JSON structured like this:
{
"data": {
"success": "true"
}
}
Body Parameters
Parameter | Default | Required | Description |
---|---|---|---|
clients | Yes | Array or String A list of client IDs |
|
resourceCollectionId | Yes | String The ID of the collection |
Errors Resource Collection
The following error codes relative to forums:
Error Code | Error Detail | Meaning |
---|---|---|
400 | RESOURCE_COLLECTION_ID_INVALID | The provided resource collection ID is invalid or does not exist. |
400 | CLIENT_INVALID | The provided client ID is invalid or does not exist. |
Webhook
- The Webhooks API allows you to subscribe to events happening in an Everfit account with your integration installed. Rather than making an API call when an event happens in a connected account, Everfit can send an HTTP request to an endpoint you configure. You can configure subscribed events in your app’s settings or using the endpoints detailed below. Webhooks can be more scalable than regularly polling for changes, especially for apps with a large installation base.
- Using the Webhooks API requires the following:
- That you set up an Everfit app to use webhooks by subscribing to the events you want to be notified about, and by specifying a URL to send those notifications.
- That you deploy a publicly available and secure (HTTPS) endpoint for that URL that can handle the webhook payloads specified in this documentation.
How to add a webhook endpoint
- Prepare an endpoint with method POST and then send to admin everfit
- The endpoint format:
> https://
/
For example: POST https://myapidomain.com/everfit_webhook
Event Data
- Structure event:
Field | Description |
---|---|
event | List events in the everfit. |
data | The body will send to your endpoint |
timestamp | A timestamp when app have trigger event |
List events
Event | Description |
---|---|
client.connected | Get notified if any client is connected in a your's account. |
client.accessed-app | Get notified if any client login or re-open everfit app from previous login. |
client.connected
curl "https://example.com/webhook" \
-X POST
[EXAMPLE] body send
{
"event": "client.connected",
"data": {
"id": "630da7d5d3962c46cc13ba55",
"firstName": "example first name",
"lastName": "example last name",
"isArchived": false,
"status": 1,
"client_connection": 1
},
"timestamp": 1670404251665
}
client.accessed-app
curl "https://example.com/webhook" \
-X POST
[EXAMPLE] body send
{
"event": "client.accessed-app",
"data": {
"id": "630da7d5d3962c46cc13ba55",
"firstName": "example first name",
"lastName": "example last name",
"isArchived": false,
"status": 1,
"client_connection": 1
},
"timestamp": 1670404251665
}