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.
Read the signed-in member
Section titled “Read the signed-in member”GET /meThis endpoint needs a member token. A member token comes from Sign in with Crewcade. An API key does not work here.
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.
| Scope | Fields in the reply |
|---|---|
profile | id, name, nameText, photoUrl |
email | email, emailVerified |
{ "id": "mem_123", "name": { "en": "Alex Kim", "ja": "アレックス・キム" }, "nameText": "Alex Kim", "photoUrl": null, "emailVerified": true}idis the member ID. It is the same assubin the ID token.emailisnullwhen the member has no real email address.- Without the
profilescope, the name and photo fields are missing. - Without the
emailscope, the email fields are missing.
Read your club
Section titled “Read your club”GET /workspaceThis endpoint works with an API key or with a member token. The reply is the same for both.
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"}| Field | Meaning |
|---|---|
id | The ID of your club. |
name | The name of your club. |
defaultLocale | The default language of your club. |
enabledLocales | The languages that your club uses. |
timeZone | The time zone of your club, as an IANA name. |
Language
Section titled “Language”Every /v1 route takes a language. Pick it in one of two ways:
- Add
?locale=jato the request. - Send an
Accept-Languageheader, for exampleja-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:
- The language you asked for.
- The default language of the club.
- Any language that has text.
curl "https://api.crewcade.com/api/v1/events?locale=ja" \ -H "Authorization: Bearer cck_your_key_here"