Class GupshupPartnerApiClient

Gupshup Partner API Client

Provides methods to interact with the Gupshup Partner API for managing subscriptions, templates, business profiles, media, and other partner-related operations.

const client = new GupshupPartnerApiClient({
appId: 'your-app-id',
appToken: 'your-app-token',
debug: true
});

const templates = await client.getTemplates();

Constructors

Methods

  • Deletes a specific subscription

    Parameters

    • subscriptionId: string

      The unique identifier of the subscription to delete

    Returns Promise<AxiosResponse<any, any>>

    Promise resolving to deletion result

  • Deletes a template by element name

    Parameters

    • elementName: string

      The element name of the template to delete

    Returns Promise<any>

    Promise resolving to deletion result

  • Disables button click analytics for a template

    Parameters

    • templateId: string

      The template ID to disable analytics for

    Returns Promise<any>

    Promise resolving to analytics disable result

  • Uploads a file and generates a media ID

    Parameters

    • file: any

      The file to upload

    • fileType: string

      The type of the file

    Returns Promise<any>

    Promise resolving to media ID and upload result

  • Gets discount information for a specific year and month

    Parameters

    • year: string

      The year (YYYY format)

    • month: string

      The month (MM format)

    Returns Promise<any>

    Promise resolving to discount data

  • Retrieves a specific subscription by ID

    Parameters

    • subscriptionId: string

      The unique identifier of the subscription

    Returns Promise<AxiosResponse<any, any>>

    Promise resolving to subscription data

  • Gets usage statistics for a date range

    Parameters

    • from: string

      Start date in YYYY-MM-DD format

    • to: string

      End date in YYYY-MM-DD format

    Returns Promise<any>

    Promise resolving to usage statistics

  • Checks if a phone number is opted in

    Parameters

    • phone: string

      The phone number to check

    Returns Promise<boolean>

    Promise resolving to boolean indicating if phone is opted in

  • Sets the callback URL for webhook notifications

    Parameters

    • callbackUrl: string

      The URL to receive webhook notifications

    Returns Promise<any>

    Promise resolving to callback URL setting result

  • Updates event modes for callbacks

    Parameters

    • events: string[]

      Array of event types to enable

    Returns Promise<boolean>

    Promise resolving to boolean indicating success

    This method is deprecated and may be removed in future versions