{
"endpoints": {
"/channels/in_app/inbox/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getInAppInboxTokens(\n {\n limit: 1,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, InboxToken } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst inboxToken: InboxToken = {\t\n connectionId: "connection_id",\n token: "enim reprehende"\n};\n\n const { data } = await client.channels.saveInAppInboxToken(\n inboxToken\n);\n\n console.log(data);\n})();\n"
},
"/channels/in_app/inbox/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getInAppInboxToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardInAppInboxToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/apns/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushApnsTokens(\n {\n limit: 1,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { ApnsTokenPayload, Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const apnsTokenPayloadInstallationId = ApnsTokenPayloadInstallationId.DEVELOPMENT;\n\nconst apnsTokenPayload: ApnsTokenPayload = {\t\n appId: "app_id",\n deviceToken: "Duis dolore com",\n installationId: apnsTokenPayloadInstallationId\n};\n\n const { data } = await client.channels.saveMobilePushApnsToken(\n apnsTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/apns/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushApnsToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardMobilePushApnsToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/expo/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushExpoTokens(\n {\n limit: 5,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, ExpoTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst expoTokenPayload: ExpoTokenPayload = {\t\n deviceToken: "device_token"\n};\n\n const { data } = await client.channels.saveMobilePushExpoToken(\n expoTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/expo/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushExpoToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardMobilePushExpoToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/fcm/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushFcmTokens(\n {\n limit: 4,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, FcmTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const fcmTokenPayloadInstallationId = FcmTokenPayloadInstallationId.DEVELOPMENT;\n\nconst fcmTokenPayload: FcmTokenPayload = {\t\n deviceToken: "laborum esse co",\n installationId: fcmTokenPayloadInstallationId\n};\n\n const { data } = await client.channels.saveMobilePushFcmToken(\n fcmTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/mobile_push/fcm/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getMobilePushFcmToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardMobilePushFcmToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/slack/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getSlackTokens(\n {\n limit: 10,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, SlackTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst slackTokenPayloadOauth: SlackTokenPayloadOauth = {\t\n channelId: "channel_id",\n installationId: "installation_id",\n scope: "scope"\n};\n\n\nconst slackTokenPayloadWebhook: SlackTokenPayloadWebhook = {\t\n url: "url"\n};\n\nconst slackTokenPayload: SlackTokenPayload = {\t\n oauth: slackTokenPayloadOauth,\n webhook: slackTokenPayloadWebhook\n};\n\n const { data } = await client.channels.saveSlackToken(\n slackTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/slack/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getSlackToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardSlackToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/teams/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getTeamsTokens(\n {\n limit: 2,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, TeamsTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst teamsTokenPayloadWebhook: TeamsTokenPayloadWebhook = {\t\n url: "url"\n};\n\nconst teamsTokenPayload: TeamsTokenPayload = {\t\n webhook: teamsTokenPayloadWebhook\n};\n\n const { data } = await client.channels.saveTeamsToken(\n teamsTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/teams/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getTeamsToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardTeamsToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/channels/web_push/tokens": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getWebPushTokens(\n {\n limit: 2,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"post": "import { Client, WebPushTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst webPushTokenPayloadKeys: WebPushTokenPayloadKeys = {\t\n auth: "auth",\n p256dh: "p256dh"\n};\n\nconst webPushTokenPayload: WebPushTokenPayload = {\t\n endpoint: "endpoint",\n keys: webPushTokenPayloadKeys\n};\n\n const { data } = await client.channels.saveWebPushToken(\n webPushTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/channels/web_push/tokens/{token_id}": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getWebPushToken(\n "token_id"\n);\n\n console.log(data);\n})();\n",
"delete": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.discardWebPushToken(\n "token_id"\n);\n\n console.log(data);\n})();\n"
},
"/integrations/inbox/installations": {
"post": "import { Client, InboxConfigPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst images: Images = {\t\n emptyInboxUrl: "emptyInboxUrl"\n};\n\n\nconst banner: Banner = {\t\n backgroundColor: "backgroundColor",\n backgroundOpacity: 6.57,\n fontSize: "fontSize",\n textColor: "textColor"\n};\n\n\nconst dialog: Dialog = {\t\n accentColor: "accentColor",\n backgroundColor: "backgroundColor",\n textColor: "textColor"\n};\n\n\nconst footer: Footer = {\t\n backgroundColor: "backgroundColor",\n borderRadius: "borderRadius",\n fontSize: "fontSize",\n textColor: "textColor"\n};\n\n\nconst header: Header = {\t\n backgroundColor: "backgroundColor",\n borderRadius: "borderRadius",\n fontFamily: "fontFamily",\n fontSize: "fontSize",\n textColor: "textColor"\n};\n\n\nconst icon: Icon = {\t\n borderColor: "borderColor",\n width: "width"\n};\n\n\nconst defaultHover: DefaultHover = {\t\n backgroundColor: "backgroundColor"\n};\n\n\nconst defaultState: DefaultState = {\t\n color: "color"\n};\n\nconst default_: Default_ = {\t\n backgroundColor: "backgroundColor",\n borderRadius: "borderRadius",\n fontFamily: "fontFamily",\n fontSize: "fontSize",\n hover: defaultHover,\n margin: "margin",\n state: defaultState,\n textColor: "textColor"\n};\n\n\nconst unreadHover: UnreadHover = {\t\n backgroundColor: "backgroundColor"\n};\n\n\nconst unreadState: UnreadState = {\t\n color: "color"\n};\n\nconst unread: Unread = {\t\n backgroundColor: "backgroundColor",\n hover: unreadHover,\n state: unreadState,\n textColor: "textColor"\n};\n\n\nconst unseenHover: UnseenHover = {\t\n backgroundColor: "backgroundColor"\n};\n\n\nconst unseenState: UnseenState = {\t\n color: "color"\n};\n\nconst unseen: Unseen = {\t\n backgroundColor: "backgroundColor",\n hover: unseenHover,\n state: unseenState,\n textColor: "textColor"\n};\n\nconst themeNotification: ThemeNotification = {\t\n default: default_,\n unread: unread,\n unseen: unseen\n};\n\n\nconst unseenBadge: UnseenBadge = {\t\n backgroundColor: "backgroundColor"\n};\n\nconst theme: Theme = {\t\n banner: banner,\n dialog: dialog,\n footer: footer,\n header: header,\n icon: icon,\n notification: themeNotification,\n unseenBadge: unseenBadge\n};\n\nconst inboxConfigPayload: InboxConfigPayload = {\t\n images: images,\n locale: "locale",\n theme: theme\n};\n\n const { data } = await client.integrations.saveInboxInstallation(\n inboxConfigPayload\n);\n\n console.log(data);\n})();\n"
},
"/integrations/inbox/installations/start": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.integrations.startInboxInstallation();\n\n console.log(data);\n})();\n"
},
"/integrations/slack/installations": {
"post": "import { Client, SlackInstallation } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst authedUser: AuthedUser = {\t\n accessToken: "access_token",\n expiresIn: 8,\n id: "id",\n refreshToken: "refresh_token",\n scope: "scope",\n tokenType: "token_type"\n};\n\n\nconst enterprise: Enterprise = {\t\n id: "id",\n name: "name"\n};\n\n\nconst incomingWebhook: IncomingWebhook = {\t\n channel: "channel",\n configurationUrl: "configuration_url",\n url: "url"\n};\n\n\nconst team: Team = {\t\n id: "id",\n name: "name"\n};\n\nconst slackInstallation: SlackInstallation = {\t\n accessToken: "access_token",\n appId: "app_id",\n authedUser: authedUser,\n botUserId: "bot_user_id",\n enterprise: enterprise,\n expiresIn: 2,\n id: "1QDFZ-h/5vDSBD",\n incomingWebhook: incomingWebhook,\n isEnterpriseInstall: true,\n refreshToken: "refresh_token",\n scope: "scope",\n team: team,\n tokenType: "token_type"\n};\n\n const { data } = await client.integrations.saveSlackInstallation(\n slackInstallation\n);\n\n console.log(data);\n})();\n"
},
"/integrations/slack/installations/finish": {
"post": "import { Client, SlackFinishInstallResponse } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst slackFinishInstallResponse: SlackFinishInstallResponse = {\t\n appId: "app_id",\n code: "code",\n redirectUrl: "redirect_url"\n};\n\n const { data } = await client.integrations.finishSlackInstallation(\n slackFinishInstallResponse\n);\n\n console.log(data);\n})();\n"
},
"/integrations/slack/installations/start": {
"post": "import { Client, SlackStartInstall } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst slackStartInstall: SlackStartInstall = {\t\n appId: "app_id",\n authUrl: "auth_url",\n extraScopes: ["extra_scopes"],\n redirectUrl: "redirect_url"\n};\n\n const { data } = await client.integrations.startSlackInstallation(\n slackStartInstall\n);\n\n console.log(data);\n})();\n"
},
"/integrations/templates/installations": {
"post": "import { Client, TemplatesInstallation } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst templatesInstallation: TemplatesInstallation = {\t\n category: "category",\n channel: "channel",\n text: "text"\n};\n\n const { data } = await client.integrations.saveTemplatesInstallation(\n templatesInstallation\n);\n\n console.log(data);\n})();\n"
},
"/integrations/web_push/installations": {
"post": "import { Client, WebPushTokenPayload } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n \nconst webPushTokenPayloadKeys: WebPushTokenPayloadKeys = {\t\n auth: "auth",\n p256dh: "p256dh"\n};\n\nconst webPushTokenPayload: WebPushTokenPayload = {\t\n endpoint: "endpoint",\n keys: webPushTokenPayloadKeys\n};\n\n const { data } = await client.integrations.saveWebPushInstallation(\n webPushTokenPayload\n);\n\n console.log(data);\n})();\n"
},
"/integrations/web_push/installations/start": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.integrations.startWebPushInstallation();\n\n console.log(data);\n})();\n"
},
"/notifications": {
"get": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.notifications.listNotifications(\n {\n limit: 3,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n status: "status",\n topic: "topic",\n }\n);\n\n console.log(data);\n})();\n"
},
"/notifications/{notification_id}/archive": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.notifications.archiveNotification(\n "notification_id"\n);\n\n console.log(data);\n})();\n"
},
"/notifications/{notification_id}/read": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.notifications.markNotificationRead(\n "notification_id"\n);\n\n console.log(data);\n})();\n"
},
"/notifications/{notification_id}/unarchive": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.notifications.unarchiveNotification(\n "notification_id"\n);\n\n console.log(data);\n})();\n"
},
"/notifications/{notification_id}/unread": {
"post": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.notifications.markNotificationUnread(\n "notification_id"\n);\n\n console.log(data);\n})();\n"
}
},
"example": "import { Client } from '@magicbell/user-client';\n\n(async () => {\n const client = new Client({\n\ttoken: 'YOUR_TOKEN'});\n\n const { data } = await client.channels.getInAppInboxTokens(\n {\n limit: 1,\n startingAfter: "starting_after",\n endingBefore: "ending_before",\n }\n);\n\n console.log(data);\n})();\n",
"authentication": {
"bearer": {
"constructor": "const sdk = new Client({ token: 'YOUR_TOKEN' });",
"setter": "const sdk = new Client();\nsdk.token = 'YOUR_TOKEN';"
}
}
}