Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerClient

Server client class that can be used to interact with an individual Postmark Server.

Hierarchy

  • default
    • ServerClient

Index

Constructors

  • Create a client.

    Parameters

    • serverToken: string

      The token for the server that you wish to interact with.

    • Optional configOptions: Configuration

      Options to customize the behavior of the this client.

    Returns ServerClient

Properties

clientVersion: string
httpClient: HttpClient

Methods

  • Activate email address that was deactivated due to a Bounce.

    Parameters

    • id: number

      The ID of the Bounce for which you wish to activate the associated email.

    • Optional callback: Callback<BounceActivationResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<BounceActivationResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Cause an Inbound Message to bypass filtering rules defined on this Client's associated Server.

    Parameters

    • messageId: string

      The ID of the Inbound Message for which you wish to bypass the filtering rules.

    • Optional callback: Callback<DefaultResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DefaultResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Create an Inbound Rule Trigger.

    Parameters

    • options: CreateInboundRuleRequest

      Configuration options to be used when creating this Trigger.

    • Optional callback: Callback<InboundRule>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<InboundRule>

    A promise that will complete when the API responds (or an error occurs).

  • Create a message stream on the associated server.

    Parameters

    • options: CreateMessageStreamRequest

      Configuration options to be used when creating message stream on the server.

    • Optional callback: Callback<MessageStream>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<MessageStream>

    A promise that will complete when the API responds (or an error occurs).

  • Add email addresses to a suppressions list on a message stream on a server.

    Parameters

    • messageStream: string

      Select message stream

    • options: SuppressionEntries

      Suppressions you wish to add.

    • Optional callback: Callback<SuppressionStatuses>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<SuppressionStatuses>

    A promise that will complete when the API responds (or an error occurs).

  • Create a new template on the associated server.

    Parameters

    • options: CreateTemplateRequest

      Configuration options to be used to create the Template.

    • Optional callback: Callback<Template>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Template>

    A promise that will complete when the API responds (or an error occurs).

  • Create a Webhook on the associated server.

    Parameters

    • options: CreateWebhookRequest

      Configuration options to be used when creating Webhook trigger.

    • Optional callback: Callback<Webhook>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Webhook>

    A promise that will complete when the API responds (or an error occurs).

  • Delete an Inbound Rule Trigger.

    Parameters

    • id: number

      The ID of the Inbound Rule Trigger you wish to delete.

    • Optional callback: Callback<DefaultResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DefaultResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Delete email addresses from a suppressions list on a message stream on a server.

    Parameters

    • messageStream: string

      Select message stream

    • options: SuppressionEntries

      Suppressions you wish to delete.

    • Optional callback: Callback<SuppressionStatuses>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<SuppressionStatuses>

    A promise that will complete when the API responds (or an error occurs).

  • Delete a template associated with this server.

    Parameters

    • idOrAlias: string | number

      ID or template alias you wish to delete.

    • Optional callback: Callback<DefaultResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DefaultResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Delete an existing Webhook.

    Parameters

    • id: number

      The ID of the Webhook you wish to delete.

    • Optional callback: Callback<DefaultResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DefaultResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Update message stream on the associated server.

    Parameters

    • id: string

      Id of the webhook you wish to update.

    • options: UpdateMessageStreamRequest

      Webhook options you wish to update.

    • Optional callback: Callback<MessageStream>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<MessageStream>

    A promise that will complete when the API responds (or an error occurs).

  • Modify the Server associated with this Client.

    Parameters

    • options: UpdateServerRequest

      The options you wish to modify.

    • Optional callback: Callback<Server>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Server>

    A promise that will complete when the API responds (or an error occurs).

  • Update a template on the associated server.

    Parameters

    • idOrAlias: string | number

      Id or alias of the template you wish to update.

    • options: UpdateTemplateRequest

      Template options you wish to update.

    • Optional callback: Callback<Template>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Template>

    A promise that will complete when the API responds (or an error occurs).

  • Update Webhook on the associated server.

    Parameters

    • id: number

      Id of the webhook you wish to update.

    • options: UpdateWebhookRequest

      Webhook options you wish to update.

    • Optional callback: Callback<Webhook>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Webhook>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific Bounce.

    Parameters

    • id: number

      The ID of the Bounce you wish to retrieve.

    • Optional callback: Callback<Bounce>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Bounce>

    A promise that will complete when the API responds (or an error occurs).

  • Get statistiscs on emails that bounced after being sent from the Server associated with this Client.

    Parameters

    Returns Promise<BounceCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get a Bounce Dump for a specific Bounce.

    Parameters

    • id: number

      The ID of the Bounce for which you wish to retrieve Bounce Dump.

    • Optional callback: Callback<BounceDump>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<BounceDump>

    A promise that will complete when the API responds (or an error occurs).

  • Get a batch of bounces.

    Parameters

    Returns Promise<Bounces>

    A promise that will complete when the API responds (or an error occurs).

  • Get total clicks statistics for tracked links for messages sent from the Server associated with this Client.

    Parameters

    Returns Promise<ClickCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get click location (in HTML or Text body of the email) statistics for tracked links for messages sent from the Server associated with this Client.

    Parameters

    Returns Promise<ClickLocationCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get bounce statistic information for the associated Server.

    Parameters

    • Optional callback: Callback<DeliveryStatistics>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DeliveryStatistics>

    A promise that will complete when the API responds (or an error occurs).

  • Get Open statistics for messages sent from the Server associated with this Client.

    Parameters

    Returns Promise<OpenCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific Inbound Message.

    Parameters

    • messageId: string

      The ID of the Inbound Message you wish to retrieve.

    • Optional callback: Callback<InboundMessageDetails>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<InboundMessageDetails>

    A promise that will complete when the API responds (or an error occurs).

  • Get a list of Inbound Rule Triggers.

    Parameters

    • filter: FilteringParameters = ...

      Optional filtering parameters.

    • Optional callback: Callback<InboundRules>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<InboundRules>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific message stream on a server.

    Parameters

    • id: string

      The ID of the message stream you wish to retrieve.

    • Optional callback: Callback<MessageStream>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<MessageStream>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific Outbound Message.

    Parameters

    • messageId: string

      The ID of the OutboundMessage you wish to retrieve.

    • Optional callback: Callback<OutboundMessageDetails>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<OutboundMessageDetails>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific Outbound Message.

    Parameters

    • messageId: string

      The ID of the OutboundMessage you wish to retrieve.

    • Optional callback: Callback<OutboundMessageDump>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<OutboundMessageDump>

    A promise that will complete when the API responds (or an error occurs).

  • Get statistics on email sent from the Server associated with this Client.

    Parameters

    Returns Promise<SentCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get the information for the Server associated with this Client.

    Parameters

    • Optional callback: Callback<Server>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Server>

    A promise that will complete when the API responds (or an error occurs).

  • Get SPAM complaint statistics for email sent from the Server associated with this Client.

    Parameters

    Returns Promise<SpamCounts>

    A promise that will complete when the API responds (or an error occurs).

  • Get the list of suppressions for a message stream on a server.

    Parameters

    • messageStream: string

      Select message stream

    • Optional callback: Callback<Suppressions>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Suppressions>

    A promise that will complete when the API responds (or an error occurs).

  • Get the a specific template associated with this server.

    Parameters

    • idOrAlias: string | number

      ID or alias for the template you wish to retrieve.

    • Optional callback: Callback<Template>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Template>

    A promise that will complete when the API responds (or an error occurs).

  • Get the list of templates associated with this server.

    Parameters

    Returns Promise<Templates>

    A promise that will complete when the API responds (or an error occurs).

  • Get details for a specific Webhook.

    Parameters

    • id: number

      The ID of the Webhook you wish to retrieve.

    • Optional callback: Callback<Webhook>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<Webhook>

    A promise that will complete when the API responds (or an error occurs).

  • Get the list of Webhooks for specific server.

    Parameters

    Returns Promise<Webhooks>

    A promise that will complete when the API responds (or an error occurs).

  • Request that Postmark retry POSTing to the Inbound Hook for the specified message.

    Parameters

    • messageId: string

      The ID of the Inbound Message for which you wish to retry the inbound hook.

    • Optional callback: Callback<DefaultResponse>

      If the callback is provided, it will be passed to the resulting promise as a continuation.

    Returns Promise<DefaultResponse>

    A promise that will complete when the API responds (or an error occurs).

  • Validate template markup to verify that it will be parsed. Also provides a recommended template model to be used when sending using the specified template content.

    Parameters

    Returns Promise<TemplateValidation>

    A promise that will complete when the API responds (or an error occurs).