Hierarchy

  • default
    • FormsApps

Constructors

  • Parameters

    Returns FormsApps

    const OneBlink = require('@oneblink/sdk')
    const options = {
    accessKey: '123455678901ABCDEFGHIJKL',
    secretKey: '123455678901ABCDEFGHIJKL123455678901ABCDEFGHIJKL',
    }
    const formsAppsSDK = new OneBlink.FormsApps(options)

Methods

  • Create a Forms App

    Minimum Role Permission

    Apps: Manager

    Parameters

    Returns Promise<FormsApp>

    formsAppsSDK.createFormsApp(formsApp).then((savedFormsApp) => {
    // Use Forms App here...
    })
  • Create a Forms App User

    Minimum Role Permission

    App Users: Manager

    Parameters

    Returns Promise<FormsAppUser>

    formsAppsSDK.createUser(formsAppUser).then((savedFormsAppUser) => {
    // Use Forms App User here...
    })
  • Delete a Forms App by its identifier

    Minimum Role Permission

    Apps: Manager

    Parameters

    • formsAppId: number

      The exact identifier of the Forms App you wish to delete

    Returns Promise<void>

    const formsAppId = 1
    formsAppsSDK.deleteFormsApp(formsAppId).then(() => {
    // Forms App has been deleted...
    })
  • Remove a custom sending address for a forms app

    Minimum Role Permission

    App Users: Manager

    Parameters

    • formsAppId: number

      The ID of the forms app you wish to remove the sending address from

    Returns Promise<void>

    const formsAppId = 1
    await formsAppsSDK.deleteSendingAddress(formsAppId)
  • Delete a Forms App User by its identifier

    Minimum Role Permission

    App Users: Manager

    Parameters

    • formsAppUserId: number

      The exact Forms App User identifier you wish to delete

    Returns Promise<void>

    const formsAppUserId = 1
    formsAppsSDK.deleteUser(formsAppUserId).then(() => {
    // Forms App User has been deleted...
    })
  • Get a single Forms App by its identifier

    Minimum Role Permission

    Apps: Read Only

    Parameters

    • formsAppId: number

      The exact identifier of the Forms App you wish to get

    Returns Promise<FormsApp>

    const formsAppId = 1
    formsAppsSDK.getFormsApp(formsAppId).then((formsApp) => {
    // Use Forms App here...
    })
  • Get a single Forms App for the Bearer token of a Forms App User

    Parameters

    • OptionalformsAppUserToken: unknown

      The Bearer token in the Authorization header from a request from an App User

    Returns Promise<FormsApp>

    const bearerToken = ''
    formsAppsSDK.getMyFormsApp(bearerToken).then((formsApp) => {
    // Use Forms App here...
    })
  • Get the email address forms app emails will be sent from

    Minimum Role Permission

    Apps: Read Only

    Parameters

    • formsAppId: number

      The ID of the forms app you wish to get the sending address for

    Returns Promise<FormsAppSendingAddressResponse>

    const res = await formsAppsSDK.getSendingAddress(formsAppId)
    
  • Set the email address forms app emails will be sent from

    Minimum Role Permission

    App Users: Manager

    Parameters

    • formsAppId: number

      The ID of the forms app you wish to set the sending address for

    • sendingAddressConfig: {
          emailAddress: string;
          emailName?: string;
      }

      The object containing the emailAddress & emailName properties

      • emailAddress: string
      • OptionalemailName?: string

    Returns Promise<FormsAppSendingAddressResponse>

    const res = await formsAppsSDK.setSendingAddress(
    formsAppId,
    sendingAddressConfig,
    )
  • Update a Forms App

    Minimum Role Permission

    Apps: Manager

    Parameters

    Returns Promise<FormsApp>

    formsAppsSDK.updateFormsApp(formsApp).then((savedFormsApp) => {
    // Use Forms App here...
    })
  • A Static function to verify a JWT and return its result

    Type Parameters

    • T extends Record<string, unknown>

    Parameters

    • token: string

      The JWT you wish to verify

    Returns Promise<T>

    const token =
    'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
    // or
    const token =
    'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
    OneBlink.FormsApps.verifyJWT(token)
    .then((result) => {
    // Result is Decoded Token
    })
    .catch((e) => {
    // Token was invalid
    })