⚙️ Service module Inbound API
Get information about the service.
Status method
Retrieve the condition of the service.
Usage
ts
import { MailChannelsClient, Service } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const service = new Service(mailchannels)
const { success, error } = await service.status()ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { success, error } = await mailchannels.service.status()Response
successbooleanguaranteed: Whether the operation was successful.errorstring | nullnullable
Subscriptions method
Get a list of your subscriptions to MailChannels Inbound.
Usage
ts
import { MailChannelsClient, Service } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const service = new Service(mailchannels)
const { data, error } = await service.subscriptions()ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { data, error } = await mailchannels.service.subscriptions()Response
dataobject[] | nullnullableactivebooleanguaranteedactiveAccountsCountnumberguaranteedhandlestringguaranteedlimitsobject[]guaranteedfeatureHandlestringguaranteedvaluestringguaranteed
planobjectguaranteedhandlestringguaranteednamestringguaranteed
errorstring | nullnullable
Report method
Submit a false negative or false positive report.
Usage
ts
import { MailChannelsClient, Service } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const service = new Service(mailchannels)
const { success, error } = await service.report({
type: 'false_positive',
messageContent: 'Your message content'
})ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { success, error } = await mailchannels.service.report({
type: 'false_positive',
messageContent: 'Your message content'
})Params
optionsServiceReportOptionsrequired: The report options.type"false_negative" | "false_positive"required: The type of report. Can be eitherfalse_positiveorfalse_negative.messageContentstringrequired: The full, unaltered message content in accordance with the RFC 2822 specifications without dot stuffing.smtpEnvelopeInformationobjectoptional: The SMTP envelope information.ehlostringguaranteedmailFromstringguaranteedrcptTostringguaranteed
sendingHostInformationobjectoptional: The sending host information.namestringguaranteed
Response
successbooleanguaranteed: Whether the operation was successful.errorstring | nullnullable
Type declarations
ts
class Service {
constructor (protected mailchannels: MailChannelsClient);
async status (): Promise<SuccessResponse>;
async subscriptions (): Promise<ServiceSubscriptionsResponse>;
async report (options: ServiceReportOptions): Promise<SuccessResponse>;
}All type declarations
Responses
ts
interface DataResponse<T> {
data: T | null;
error: string | null;
}ts
interface SuccessResponse {
success: boolean;
error: string | null;
}Subscriptions type declarations
ts
type ServiceSubscriptionsResponse = DataResponse<{
active: boolean;
activeAccountsCount: number;
handle: string;
limits: {
featureHandle: string;
value: string;
}[];
plan: {
handle: string;
name: string;
};
}[]>;Report type declarations
ts
interface ServiceReportOptions {
type: "false_negative" | "false_positive";
messageContent: string;
smtpEnvelopeInformation?: {
ehlo: string;
mailFrom: string;
rcptTo: string;
};
sendingHostInformation?: {
name: string;
};
}Source
Source • Playground • Docs