Skip to content

Activities

Jorge Alvarez edited this page Jan 19, 2021 · 3 revisions

Activities

An activity is an action that a receiver has performed. The things you want to gamify in your application, like: "Downloading a file". When the user performs that action you should generate an activity that needs to be submitted to this application.

Then a check will be done to see if the activity awarded the receiver any rewards.

Example of creating an activity:

mutation {
        createActivity (
          receiverId: "externalId"
          eventId: "eventId"
          value: 17
        ) {
          activity {
            id
          }
          errors
        }
      }

If the id of the user does not exist (externalId) it will be created automcatically.

Value is optional. If you provide a value it will override the one from the event.

      query {
        activities(startsAt: "", endsAt: "") {
          event {
            name
          }
          receiver {
            points
          }
        }
      }
Clone this wiki locally