getMyProfile
Fetch the key owner's own profile.
Fetch the key owner's own profile (id, name, email, phone number (personal, via updateMyProfile; lines: listCommunicationChannels), profile picture URL) plus WHO THEY ARE IN THE ORGANIZATION and WHICH CLOCK THEY READ ON. organizationRole is their role (ADMIN | MEMBER): every ADMIN-scoped operation requires the key owner to be an ADMIN, so CHECK THIS BEFORE attempting one and, when it is not ADMIN, say that a team admin has to do it instead of relaying a refusal. organizationMembershipStatus is ACTIVE or SUSPENDED. organization carries the org's id, name and its own timezone (null = never set, NOT UTC). timezone is the zone the key owner CHOSE (null = never chosen, again not UTC); resolvedTimezone is the zone their times are ACTUALLY rendered on after the fallbacks (their availability schedule, then the organization's): use resolvedTimezone whenever you state or interpret a time for them, and never assume UTC from a null. Permissions are a separate read: getMyCapabilities. Read it before updateMyProfile.
curl https://server.goliathdata.com/api/v1/call \
-H "Authorization: Bearer $GOLIATH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operationId": "getMyProfile",
"variables": {}
}'import { GoliathClient } from '@goliath-data/sdk'
const goliath = new GoliathClient({
apiKey: process.env.GOLIATH_API_KEY!,
baseUrl: 'https://server.goliathdata.com',
})
const result = await goliath.account.getMyProfile()const res = await fetch('https://server.goliathdata.com/api/v1/call', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
operationId: 'getMyProfile',
variables: {}
}),
})
const { data, errors } = await res.json()Variables
None. Send "variables": {}.
Response
What comes back under data: a list shows as one entry, and a value as its type.
{
"data": {
"currentUser": {
"id": "<ID>",
"firstName": "…",
"lastName": "…",
"email": "…",
"phoneNumber": "…",
"profilePictureUrl": "…",
"organizationRole": "ADMIN",
"organizationMembershipStatus": "ACTIVE",
"timezone": "…",
"resolvedTimezone": "…",
"organization": {
"id": "<ID>",
"name": "…",
"timezone": "…"
}
}
}
}Errors
unknown_variableA variable the operation does not declare. A typo is refused rather than silently dropped.
unauthorizedNo bearer header, or the key is invalid or revoked.
insufficient_scopeThe key lacks the scope the operation requires.
forbiddenA referenced record does not exist, was deleted, or is outside your organization. The gateway cannot tell those apart.
Behaviour
A read. It rejects an Idempotency-Key header with 400 bad_request.