Event types

Every request made to Terra, and every event sent from Terra will contain a terra-reference header containing a unique identifier for the request or event.

The terra-reference identifier uniquely ties together a request -> event pair, whenever a request for data leads to data being asynchronously sent to your server. This can be useful for keeping track of whether or not a data transfer request has been fulfilled, or is still pending transfer

Coach

Coach registration

Slug:

coach.registered

Trigger:

A Coach has authenticated under your developer ID

Recommended action:

Save the Coach to your database

Format:

{
  "data": Coach,
  "message": "Coach has successfully registered",
  "type": "coach.registered"
}

Athlete

Athlete creation

Slug:

athlete.registered

Trigger:

One or more athletes have been registered under an associated coach

Recommended action:

Save the athletes to your database, and make a PATCH for each athlete to attach the appropriate reference ID to them

Format:

{
  "data": Coach,
  "message": "One or more Athletes have been successfully registered",
  "type": "athlete.registered"
}
Athlete deletion

Slug:

athlete.deleted

Trigger:

One or more athletes have been deleted

Recommended action:

Remove the athletes' information from your database as per your requirements, or acknowledge that these have been deleted on the providers' system

Format:

{
  "data": [athlete],
  "message": "One or more Athletes have been deleted",
  "type": "athlete.deleted"
}

Data requests

Tests retrieved

Slug:

test.retrieved

Trigger:

One or more tests have been retrieved

Recommended action:

Save the tests' data as per your requirements, and update any existing tests based on the tests' unique IDs

Format:

{
  "data": [Test],
  "coach": Coach,
  "type": "test.retrieved"
}
Activities retrieved

Slug:

activity.retrieved

Trigger:

One or more activities have been retrieved

Recommended action:

Save the activities' data as per your requirements, and update any existing tests based on the activities' unique IDs

Format:

{
  "data": [Activity],
  "coach": Coach,
  "type": "activity.retrieved"
}

Was this helpful?