(integrations)
Integration endpoints
- slackOAuthCallback - Slack OAuth callback
- getSlackInstallUrl - Get Slack install URL
- slackWebhook - Slack webhook handler
- slackInteractions - Slack interactions handler
- gmailOAuthCallback - Gmail OAuth callback
- getGmailInstallUrl - Get Gmail install URL
- outlookOAuthCallback - Outlook OAuth callback
- getOutlookInstallUrl - Get Outlook install URL
- xeroOAuthCallback - Xero OAuth callback
- getXeroInstallUrl - Get Xero install URL
- quickBooksOAuthCallback - QuickBooks OAuth callback
- getQuickBooksInstallUrl - Get QuickBooks install URL
- fortnoxOAuthCallback - Fortnox OAuth callback
- getFortnoxInstallUrl - Get Fortnox install URL
Handles OAuth callback from Slack after user authorization. Exchanges authorization code for access token and creates app integration.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.slackOAuthCallback({
code: "<value>",
state: "North Carolina",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsSlackOAuthCallback } from "@midday-ai/sdk/funcs/integrationsSlackOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsSlackOAuthCallback(midday, {
code: "<value>",
state: "North Carolina",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsSlackOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SlackOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.SlackOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SlackOAuthCallbackBadRequestError | 400 | application/json |
| errors.SlackOAuthCallbackInternalServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for Slack integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getSlackInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetSlackInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetSlackInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetSlackInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetSlackInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetSlackInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles incoming webhook events from Slack. Verifies request signature and processes events.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.slackWebhook();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsSlackWebhook } from "@midday-ai/sdk/funcs/integrationsSlackWebhook.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsSlackWebhook(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsSlackWebhook failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.SlackWebhookResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles interactive component actions from Slack (button clicks, etc.)
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.slackInteractions();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsSlackInteractions } from "@midday-ai/sdk/funcs/integrationsSlackInteractions.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsSlackInteractions(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsSlackInteractions failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.SlackInteractionsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles OAuth callback from Google after user authorization. Exchanges authorization code for access token and creates inbox account.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.gmailOAuthCallback({
state: "Delaware",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGmailOAuthCallback } from "@midday-ai/sdk/funcs/integrationsGmailOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGmailOAuthCallback(midday, {
state: "Delaware",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGmailOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GmailOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GmailOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GmailOAuthCallbackBadRequestError | 400 | application/json |
| errors.GmailOAuthCallbackInternalServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for Gmail integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getGmailInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetGmailInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetGmailInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetGmailInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetGmailInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetGmailInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles OAuth callback from Microsoft after user authorization. Exchanges authorization code for access token and creates inbox account.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.outlookOAuthCallback({
state: "New Hampshire",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsOutlookOAuthCallback } from "@midday-ai/sdk/funcs/integrationsOutlookOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsOutlookOAuthCallback(midday, {
state: "New Hampshire",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsOutlookOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.OutlookOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.OutlookOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.OutlookOAuthCallbackBadRequestError | 400 | application/json |
| errors.OutlookOAuthCallbackInternalServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for Outlook integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getOutlookInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetOutlookInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetOutlookInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetOutlookInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetOutlookInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetOutlookInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles OAuth callback from Xero after user authorization. Exchanges authorization code for access token and creates app integration.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.xeroOAuthCallback({
state: "Maryland",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsXeroOAuthCallback } from "@midday-ai/sdk/funcs/integrationsXeroOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsXeroOAuthCallback(midday, {
state: "Maryland",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsXeroOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.XeroOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.XeroOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for Xero integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getXeroInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetXeroInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetXeroInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetXeroInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetXeroInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetXeroInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles OAuth callback from QuickBooks after user authorization. Exchanges authorization code for access token and creates app integration.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.quickBooksOAuthCallback({
state: "Georgia",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsQuickBooksOAuthCallback } from "@midday-ai/sdk/funcs/integrationsQuickBooksOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsQuickBooksOAuthCallback(midday, {
state: "Georgia",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsQuickBooksOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.QuickBooksOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.QuickBooksOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for QuickBooks integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getQuickBooksInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetQuickBooksInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetQuickBooksInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetQuickBooksInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetQuickBooksInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetQuickBooksInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Handles OAuth callback from Fortnox after user authorization. Exchanges authorization code for access token and creates app integration.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.fortnoxOAuthCallback({
state: "South Dakota",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsFortnoxOAuthCallback } from "@midday-ai/sdk/funcs/integrationsFortnoxOAuthCallback.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsFortnoxOAuthCallback(midday, {
state: "South Dakota",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsFortnoxOAuthCallback failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.FortnoxOAuthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.FortnoxOAuthCallbackResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Generates OAuth install URL for Fortnox integration. Requires authentication.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.integrations.getFortnoxInstallUrl();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { integrationsGetFortnoxInstallUrl } from "@midday-ai/sdk/funcs/integrationsGetFortnoxInstallUrl.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await integrationsGetFortnoxInstallUrl(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("integrationsGetFortnoxInstallUrl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetFortnoxInstallUrlResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |