Skip to content

Me and workspace

These endpoints tell your app who the member is and which club it talks to. They also show how language works on every /v1 route.

GET /me

This endpoint needs a member token. A member token comes from Sign in with Crewcade. An API key does not work here.

Terminal window
curl https://api.crewcade.com/api/v1/me \
-H "Authorization: Bearer ccm_your_member_token"

The reply has only the fields that the member allowed.

ScopeFields in the reply
profileid, name, nameText, photoUrl
emailemail, emailVerified
{
"id": "mem_123",
"name": { "en": "Alex Kim", "ja": "アレックス・キム" },
"nameText": "Alex Kim",
"photoUrl": null,
"email": "[email protected]",
"emailVerified": true
}
  • id is the member ID. It is the same as sub in the ID token.
  • email is null when the member has no real email address.
  • Without the profile scope, the name and photo fields are missing.
  • Without the email scope, the email fields are missing.
GET /workspace

This endpoint works with an API key or with a member token. The reply is the same for both.

Terminal window
curl https://api.crewcade.com/api/v1/workspace \
-H "Authorization: Bearer cck_your_key_here"
{
"id": "k3m9x2pq4r7t",
"name": "Sunrise Running Club",
"defaultLocale": "en",
"enabledLocales": ["en", "ja"],
"timeZone": "Asia/Tokyo"
}
FieldMeaning
idThe ID of your club.
nameThe name of your club.
defaultLocaleThe default language of your club.
enabledLocalesThe languages that your club uses.
timeZoneThe time zone of your club, as an IANA name.

Every /v1 route takes a language. Pick it in one of two ways:

  • Add ?locale=ja to the request.
  • Send an Accept-Language header, for example ja-JP,ja;q=0.9.

The locale query wins when you send both. An unknown locale gives a 400 error.

Each text field that has translations keeps its map. For example, name is still { "en": "Alex Kim", "ja": "..." }. Each of these fields also gets a field that ends in Text. An example is nameText. The Text field is one plain string in the language you asked for.

Sometimes the club has no text in that language. Then Crewcade picks text in this order:

  1. The language you asked for.
  2. The default language of the club.
  3. Any language that has text.
Terminal window
curl "https://api.crewcade.com/api/v1/events?locale=ja" \
-H "Authorization: Bearer cck_your_key_here"