Menu

 

Events

The WeFitter API offers the possibility to implement the events endpoints for achieving goals that go beyond physical activity. 

Example: "Eat your vegetables challenge" 

The client wants to put a challenge where they ask the user if he/she had 2 vegetables/Fruits a day.

Frontend design

The developer needs to create a screen where the question pops ups. "Did you eat your veggies?" with the answer option "Yes? No?"

When the user clicks on Yes, an event is created, and points are added on the leaderboard.

Hence, on clicking on ‘yes’ or a + sign should trigger an event.

For more information, please refer to https://api.wefitter.com/api/v1/redoc/#operation/profile_event_create

 

Creating the challenge on the dashboard

The challenge can be created as follows: 

  • \t
  • Points gained from events are normally added to a challenge, hence you need create a challenge where no other points are added except points from Events.
  • \t
  • That is the same reason I have kept the challenge on ‘Yoga’. Please use a ‘activity type’ which is not a part of an ongoing challenge or else the challenge will show more points (activity points + events points)
  • \t
  • Keep the point definition of this activity on 0. (0+ Event points= Event points)
  • \t
  • Now only points from ‘Events’ will get added to users who are participating in this challenge.

Note: Points definitions are now set on app-level. In the future, we are aiming for configurations per challenge.

 

In short:

1) Make point definition for yoga (or any other activity that is not being used in a challenge) as 0(see screenshot).

2) Use the 'create Event' and implement it on the frontend (ex- Did you eat your veggies?). When a person clicks on yes then an event should be created.

3) Create a challenge like shown in the attachment.

4) Now the challenge will only count the points gained from the 'events endpoint'. You can implement the scoreboard of this challenge.

Note: Points definitions are now set on app-level. In the future, we also want it to be able to configure per challenge.

Second implementation

The developer needs to create a screen where the question pop ups. 

"Did you eat your veggies?"  Yes? No?

By clicking on ‘yes’, an event is created, and points are added to the profile.

Now using using GET Profile, total_points (https://api.wefitter.com/api/v1/redoc/#operation/profile_read) you can get the total points of the profiles.

You can create a filter on events and sum it on profile level. This will provide you the total of the event points per profile.

Important to know: workouts and daily summaries have heart rate information attached to them, (from version 1.1 onwards.)

 

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.