Fetch Accounts
This API endpoint is triggered by the extension interface to display all the provisions provided by the user of this extension.
Endpoint
GET /google/accounts HTTP/1.1
Host: api.atomcal.com/api/v2
Content-Type: application/x-www-form-urlencoded
Triggered by: Extension interface
Authentication: security.verifyAuthToken
Query: req.query.calendar_id
It returns { memberAccounts, calendarAccounts }
where member accounts are those provisioned by members but also calendar accounts which are pre provisioned by some other members for this calendar.
Example Responses
200 (successful operation)
res.status(200).send({ memberAccounts, calendarAccounts });
400 (bad response)
Boom.badRequest(errorMessage)
Implementation details
Read saved member accounts
Using the member id from the token authenticator service read all the saved Google calendar accounts for this member.
Read the calendar accounts
Using the Google calendar id from the query (expected to be passed by the extension interface) read all the accounts that are being used for this calendar.
Finally return both member accounts and calendar account.
Edge cases
N/A