List folders and labels
const url = 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/labels';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/labels \ --header 'Authorization: Bearer <token>'Lists the folders and the mailbox’s labels of a grant, with the ones it subscribes, so you can build a folder and label picker with one call. system holds the folders (labels.system on message-v1): those available, the application’s default, the grant’s override (null when it follows the default) and the effective ones. custom holds the mailbox’s own labels and category tabs, read live from the provider (labels.custom on message-v1), as a tree through parentId, with subscribed per label. A subscribed id the mailbox no longer has is listed with missing: true. A grant-scoped token reads its own grant.
Requires the read:messages scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”The folders and labels
object
object
object
The last segment of path.
The full name, nested by /, e.g. Clients/Acme.
A subscribed id the mailbox no longer has. name and path are the id.
Example
{ "system": { "available": [ "inbox", "sent", "archive", "drafts", "junk", "trash" ], "applicationDefault": [ "inbox", "sent" ], "override": [ "inbox" ], "effective": [ "inbox" ] }, "custom": [ { "id": "Label_7", "name": "Clients", "path": "Clients", "parentId": null, "type": "user", "subscribed": false, "missing": false }, { "id": "Label_12", "name": "Acme", "path": "Clients/Acme", "parentId": "Label_7", "type": "user", "subscribed": true, "missing": false } ]}The credential lacks the read:messages scope
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}No such grant for the caller’s credential
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}grant_revoked: the grant is revoked. connection_unreadable: the mailbox cannot be asked for its labels
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}