Menu

 

 

Gamification API

The greatest task of today’s world is promoting health solutions. Motivating users to engage in a healthier lifestyle is not a simple task and can sometimes be quite a to maintain their engagement and motivation. Through integrating our API, the solution can fall right in your hands.

The WeFitter API features a framework to make a user’s experience more dynamic, interactive and engaging through gamification. This is achieved through the implementation of the challenge framework. We provide several different challenge types like team, individual and streak challenges. With the creation of challenges, individuals or teams can participate in a set goal or be the highest on the leaderboard before time runs out.

The parameters for these challenges can be set to distance, kcal, time, step counts and points. The points are generated based on the other metrics, respectively distance, kcal, time or step counts, according to your preferences. Within the API, individual leaderboards and teams to show progress on these parameters are also provided.

Our API offers all the tools to create a fully gamified experience for end users to win rewards, be motivated and remain engaged!

Although the challenges presented are categorized as individual, team and global, the client and API user have the possibility to explore and create own challenges or use predefined challenges that can be found in the API Swagger environment.

 

Challenge parameters

The WeFitter API allows its clients and users to explore and experiment with gamification through numerous challenge types. Below, a table presenting information on the challenge components, such as types, goal, visibility, description, calculation method, enrolment method and repetition.

 

Type

  • Individual: An individual challenge type is a challenge in which the user is participating separately from the rest of the participants (goal or leaderboard set-up possible)
  • Team: A team challenge type is a challenge in which the user is participating with team members against other teams. All individual progress of the team will be accumulated (goal or leaderboard set-up possible)\
  • Global: A global challenge type is a challenge in which the user is participating with all other participants. All indiviodual progress will be accumulated (goal or leaderboard set-up possible)

 

Goal

  • Daily: A goal which is repeated daily over the time of the challenge
  • Total: A goal which is the total goal over the time of the challenge
  • Weekly: A goal which is repeated weekly over the time of the challenge
  • Monthly: A goal which is repeated monthly over the time of the challenge
  • None/Leaderboard: No goal means that the challenge is going into a leaderboard set-up, where users have to achieve the highest position in the leaderboard before the time of the challenge runs out

 

Description

Description text of the challenge.

 

Visibility

  • Public: The challenge is visible for every participant/member in the same App.
  • Private: The challenge is only visible to the pre-enrolled users in the App.

 

Calculation method

  • Sum: The sum challenge calculation will be a summation of all individual, team or global data.
  • Average: The average challenge calculation will be the average of all individual, team or global data.

 

Enrolment method

  • Automatic: Users will be enroled automatically
  • Manual: Users will be enroled manually

 

Repetition

  • None: No repetition
  • Streak: Challenge goal (daily, weekly, monthly) achievements will be calculated in the leaderdboard every time the goal is hit
  • Stick to it: Challenge goal (daily, weekly, monthly) achievements will be calculated in the leaderdboard every time the goal is hit repeteadly
  • Goalbreaker:  Points will be added every time a multiple of the goal value is reached.

 


 

Overview of data sources and connections supported

To offer the full visibility of our API frameworks, the WeFitter API data model will be made available on our developer portal. Until the launch of our new developer portal, if you wish to have access to our data model, please make your request at tech@wefitter.com

 

API Gamification

The API allows the admin to create different kind of challenges for their user, hence giving a touch of competition for better health of the users. In this section, the three major challenge types are presented. For the full list of possibilities, please go to the Other challenges section.

Further, each challenge is divided in two different stages:

1) The steps you need to take to create these challenges

2) Visual appearance of these challenge in an App.

 

Creating a team

For participating in the team challenge, it should be mandatory for the users to join a team. Hence it is good to have this procedure in the onboarding of the App.

For reference we are showing the implementation of this feature in the WeFitter App. In the image, you can see the option to:

  • Create a new team
  • Add a member in a team
  • By unpicking the team, a user can leave a team

1) Create a new team

USE POST/team/Create Team and press on try it out. Please fill in the mandatory fields for successful execution

ii) The response provides you with the team ID(Public_ID) of the team.

2) Add a member in a team

USE POST/team/{public_id}/member/ and press on try it out. Fill in the mandatory fields like teamID(public_id) of the team which needs an addition and the Profile_ID of the profile which needs to be added.

The response confirms the addition of the profile

3) Leave the team

USE DELETE/team/{public_id}/member/ and press on try it out. Fill in the mandatory fields like teamID(public_id) of the team which needs a deletion and the Profile_ID of the profile which needs to be deleted.

The response confirms the deletion of the profile

 

Team goal challenge

In this challenge, the teams try to compete with each other to reach a common goal. 

How to:

The image below is from the dashboard of WeFitter. You can login to the dashboard using https://api.wefitter.com/dashboard/login/. The dashboard provides an easy way to organize different challenges.

However, the API provides another method to create challenge. The image shows the field that needs to be filled to create a team challenge with 10 km goal

You need to use ‘Admin bearer token’ to create a challenge.

Use POST/challenge/Create challenge to create the challenges. Press the button Try it out. Fill in the information for the challenge

Note: In order to keep the challenge on ‘daily summary’ you should skip the activity field altogether.

 

App visual appearance

 Use the endpoint  GET/challenge/{public_id}/Get Challenge to get the challenge that you want to implement.

Note: The value of the goal_progress field will depend on which bearer token is used.

 The information that appears in the screen above is illustrated below.

"title": "Dashboard change  test 2",

"slogan": "use the slogan",

 "start": "2021-01-01T00:00:00Z",

 "end": "2021-10-31T00:00:00Z",

"type": "TEAM",

"description": "description",

"enrollment_method": "MANUAL"

     

Challenge enrollment

This section explains how to enable the user enrollment to the challenge.

The challenge screen shows ‘JOIN’ button. Hence this is a manual enrollment challenge. Manual enrollment means that the user will have to enroll themselves. Automatic enrollment of challenge happens when the users are automatically made to participate in a challenge. Hence, they are not given an option to join a challenge, although they can leave a challenge.

For JOIN button, you should use post/challenge/{public_id}/member/. Hence when a user clicks on ‘JOIN’, they get enrolled in the challenge.

For LEAVE, you should use delete/challenge/{public_id}/member/  (Please refer Create team section for more information)

Note: a team is not mandatory. The programme picks the first team (more information in the FAQ). Teams are independent objects that live on its own. So, they are independent of challenges.Note: The value of the goal_progress field will depend on which bearer token is used.

Practically, an individual can be a member of Team A. Then, if there is a team challenge that the individual wants to compete in, they have the ability to enroll into the challenge with one of teams they are a member of. Therefore, to join a team challenge, the individual needs to be part of a team. If a profile is a member of multiple teams, and no team is specific in the call that enrolls the user in the challenge, then the first team gets automatically picked.

 

Challenge progression 

For getting the progress of the challenge and more related information, you need to get the information about the ongoing challenge.

Use GET/challenge/{public_id}/Get Challenge to get the challenge that you want to view. Press the button Try it out and insert the public ID.

The response of the call consists the progress of the challenge along with other information.

Tip: The goal progress circle is a based on = (Total goal- Progress) / Number of days left in the challenge

   "url": "https://beta.wefitter.com/api/v1.1/challenge/b96c7271-c61c-4718-aa69-e46b94e360c4/",

   "public_id": "b96c7271-c61c-4718-aa69-e46b94e360c4",

 "title": "Test challenge",

 "slogan": "",

  "start": "2021-03-01T00:00:00Z",

  "end": "2021-03-31T00:00:00Z",

  "type": "Team",

  "goal": "TOTAL",

  "goal_value": null,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "num_members": 0,

  "description": "",

  "calculation_method": "SUM",

  "goal_progress": 0,

  "enrollment_method": "MANUAL",

  "members": [],

  "repetition": "NONE",

  "avatar": null,

  "data_source": "dailysummary",

  "activity_types": [],

  "total_calories": 0,

  "total_distance": 0,

  "total_steps": 0,

   "total_points": 0,

  "total_activity_duration": "P0D"                     

}

 

Challenge leaderboard 

The last component in the challenge visualization is the leaderboard (scoreboard) of the challenge. Below, a practical visualization of the ranking of all teams is shown. 

For this, Use get/challenge/{public_id}/leaderboard/ and press on try it out. Make sure you have proper authorization.

Using this call, you will be able to use to get the response that shows the team leaderboard (scoreboard).

Contribution screen

The contribution screen in the team goal challenge shows the contribution each member has made in reaching the goal.

Use GET/challenge/{challenge_public_id}/team/{team_public_id}/ to get the contribution of team members. Press on try it out.

You will need to fill in the Challenge_public_id and team_public_id for which you want to see the contribution

The team_public id can be obtained from the response screen of scoreboard (image). 

Now use the response of the call and implement it in the contribution screen of team challenge.

Global goal challenge

In this challenge, the individual tries to reach a common goal on a global scale. 

How to:

The image below is from the dashboard of WeFitter. You can login to the dashboard using https://api.wefitter.com/dashboard/login/. The dashboard provides an easy way to organize different challenges.

However, API provides another method to create challenge. The image shows the field that needs to be filled to create a team challenge with 10 km goal.

You need to use ‘Admin bearer token’ to create a challenge.

Use POST/challenge/Create challenge to create the challenges. Press the button Try it out. Fill in the information for the challenge.

 Note: In order to keep the challenge on ‘daily summary’ you should skip the activity field altogether.

App visual appearance

 Use the endpoint  GET/challenge/{public_id}/Get Challenge to get the challenge that you want demonstrate and use the highlighted fields in the App implementation.

  "public_id": "3e62369d-4f99-4169-9ae1-757abb953adf",

  "title": "Dashboard change  test 2",

  "slogan": "use the slogan",

  "start": "2021-01-01T00:00:00Z",

  "end": "2021-10-31T00:00:00Z",

  "type": "GROUP",

  "description": "description",

  "enrollment_method": "MANUAL",

 

Challenge enrollment

This section explains how to enable the user enrollment to the challenge.

The challenge screen shows ‘JOIN’ button. Hence this is a manual enrollment challenge. Manual enrollment means that the user will have to enroll themselves. Automatic enrollment of challenge happens when the users are automatically made to participate in a challenge. Hence, they are not given an option to join a challenge, although they can leave a challenge.

For JOIN button, you should use post/challenge/{public_id}/member/. Hence when a user clicks on ‘JOIN’, they get enrolled in the challenge.  

For LEAVE, you should use delete/challenge/{public_id}/member/  

 

Challenge progression 

For getting the progress of the challenge and more related information, you need to get the information about the ongoing challenge.

Use GET/challenge/{public_id}/Get Challenge to get the challenge that you want to view. Press the button Try it out and insert the public ID.

The response of the call consists the progress of the challenge along with other information. The underlined fields are used in the ‘progression screen’

Note: ‘GROUP’ here is a term used for ‘GLOBAL’

Tip: The goal progress circle is a based on = (Total goal- Progress) / Number of days left in the challenge

   "url": "https://beta.wefitter.com/api/v1.1/challenge/3e62369d-4f99-4169-9ae1-757abb953adf/",

  "public_id": "3e62369d-4f99-4169-9ae1-757abb953adf",

  "title": "Global Challenge",

  "slogan": "Text for Slogan",

  "start": "2021-01-01T00:00:00Z",

  "end": "2021-10-31T00:00:00Z",

  "type": "GROUP",

  "goal": "MONTHLY",

  "goal_value": 200000,

  "goal_type": "DISTANCE",

  "visibility": "PUBLIC",

  "num_members": 51,

  "description": "",

  "calculation_method": "SUM",

  "goal_progress": 542794.3597489496,

  "enrollment_method": "AUTOMATIC",

  "members": [

    { 

      "url": "https://beta.wefitter.com/api/v1.1/profile/66f90460-d4c1-4960-86f7-c5469a200b64/",

      "public_id": "66f90460-d4c1-4960-86f7-c5469a200b64",

      "name": "generated_profile_0",

      "gender": null,

      "team": null,

      "reference": ""

In this example, the goal_progress parameter is shown from the perspective of the requesting user.   

Challenge leaderboard 

The last component in the global challenge visualization is the leaderboard (scoreboard) of the challenge.

For this, Use get/challenge/{public_id}/leaderboard/ and press on try it out. Make sure you have proper authorization. 

Use the response to show in the Global scoreboard.

 

Individual challenge

In this challenge, the individual tries to reach a common goal.

How to: 

 

The image below is from the dashboard of WeFitter. You can login to the dashboard using https://api.wefitter.com/dashboard/login/. The dashboard provides an easy way to organize different challenges.

However, API provides another method to create challenge. The image shows the field that needs to be filled to create an Individual challenge of 3,5 km goal with daily repetition. This means that, the goal gets refreshed every day.

 

You need to use ‘Admin bearer token’ to create a challenge.

Use POST/challenge/Create challenge to create the challenges. Press the button Try it out. 

Fill in the information for the challenge.

Note:  In order to keep the challenge on ‘daily summary’ you should skip the activity field altogether.

Example code (based on the image of dashboard):

 

{

  "title": "Individual Challenge",

  "slogan": "Individual goal Challenge",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "INDIVIDUAL",

  "goal": "DAILY",

  "goal_value": 3500,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "STREAK",     or    "STICK TO IT"

  "avatar": "string",

  “activity type” : “walking”

}

App visual appearance

 This screen shows several different kinds of information. The endpoints to get this information is:

Use the endpoint  GET/challenge/{public_id}/Get Challenge to get the challenge that you want to implement.

The information that appears in the screen on the right side is illustrated below.

 

  "title": "Testing individual points challenge",

 "slogan": "Dashboard change  test 1",

 "start": "2021-02-28T23:00:00Z",

 "end": "2021-03-31T10:00:00Z",

 "type": "INDIVIDUAL",

 "goal": "DAILY",

 "goal_value": 3500,

 "goal_type": "STEPS",

 "visibility": "PUBLIC",

  "description": "",

  "calculation_method": "SUM",

  "goal_progress": 0,

  "enrollment_method": "AUTOMATIC",

  "members": [

    {

      "url": "https://beta.wefitter.com/api/v1.1/profile/66f90460-d4c1-4960-86f7-c5469a200b64/",

      "public_id": "66f90460-d4c1-4960-86f7-c5469a200b64",

      "name": "generated_profile_0",

      "gender": null,

      "team": null,

      "reference": ""

    } 

 

The graph in the screens show the history of the user. The goal has a ‘daily repetition’. Hence, the goal has to be reached daily.

To show the history of the person, Use GET/challenge/{public_id}/leaderboard_history/

The response shows the leaderboard based on repetition. In case of daily, if will show daily progress in the past. If the repetition is on weekly, then it will show weekly progress that was made in the past by the profile.

Stick to it and Streak Challenge

Stick to it

When you put the challenge on Stick to it, then the score of the challenge shows the total number of days a user has reached the goal. In the image of the screen, this is demonstrated as 53/68 days.

Streak

When you put the challenge on Streak then the score of the challenge shows the longest streak when a person reached the goal. For example, in the image of the App, the longest streak is 15 days. Hence the user completed the goal on 15 consecutive days.

To implement these features, use GET/challenge/{public_id}/leaderboard/ and enter Try it out.

The response will give the score of the user. This is the streak/stick to it score (Based on the type of challenge you have put in ‘Create Challenge’)

 

Other challenges set-ups

 There are more kinds of challenges possible via the API. Hence, here is the overview of the challenge.

Challenge Create Challenge Example body
Team leaderboard Challenge

  "title": "Team leaderboard Challenge",

  "slogan": "Team leaderboard Challenge",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "TEAM",

  "goal": "TOTAL",

  "goal_value": (delete this field)

  "goal_type": "DISTANCE",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "NONE",

  "avatar": "string",

Individual leaderboard Challenge

  "title": "Individual leaderboard Challenge",

  "slogan": "Individual leaderboard Challenge",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "INDIVIDUAL",

  "goal": "TOTAL",

  "goal_value": (delete this field)

  "goal_type": "DISTANCE",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "NONE",

  "avatar": "string",
Global leaderboard Challenge

  "title": "Global leaderboard Challenge",

  "slogan": "Global leaderboard Challenge",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "GROUP",

  "goal": "TOTAL",

  "goal_value": (delete this field)

  "goal_type": "DISTANCE",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "NONE",

  "avatar": "string",

Team Stick to it

"title": "Team Stick to it",

  "slogan": "Team Stick to it",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "TEAM",

  "goal": "DAILY",

  "goal_value": 13500,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "STICK TO IT"

  "avatar": "string",

  “activity type” : “walking”
Global Stick to it

"title": "Global Stick to it",

  "slogan": "Global Stick to it",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "GLOBAL",

  "goal": "DAILY",

  "goal_value": 13500,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "STICK TO IT"

  "avatar": "string",

  “activity type” : “walking”

Team Streak

"title": "Team Streak",

  "slogan": "Team Streak ",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "TEAM",

  "goal": "DAILY",

  "goal_value": 13500,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "STREAK"

  "avatar": "string",

“activity type” : “walking”

Global Team Streak

"title": "Global Team Streak",

  "slogan": "Global Team Streak",

  "start": "2021-03-01T13:05:11.467Z",

  "end": "2021-03-31T13:05:11.467Z",

  "type": "GLOBAL",

  "goal": "DAILY",

  "goal_value": 13500,

  "goal_type": "STEPS",

  "visibility": "PUBLIC",

  "description": "Describe the cause of the challenge",

  "calculation_method": "SUM",

  "enrollment_method": "MANUAL",

  "repetition": "STREAK",   

  "avatar": "string",

  “activity type” : “walking”

Points

 Some challenges may allow for point definitions. This requires a defined point model that you want for a specific app. This allows you to attribute points for a single minute, km, step or kcal. For now the point definition model is only working for ‘’other’’, which will support all activity types. In a next version you will be able to make point models for specific activity types. Below, the dashboard view of point definitions is illustrated. 

Thank you for reaching out!

We will be in touch with you soon. WeFitter team.

Je bent ingeschreven!

Binnenkort ontvang je onze nieuwsbrief!
WeFitter team.