Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Cases

Index

Constructors

constructor

Properties

Private Readonly store

store: Store

Static Readonly DEFAULT_FIELDS

DEFAULT_FIELDS: string = ...

Methods

add

  • Add a new support case.

    import { CaseSource } from 'outseta-api-client/dist/models/support/case-source';
    
    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.support.cases.add({
      Subject: 'Test Case 1',
      Body: 'This is the initial message that opened the case',
      FromPerson: {
        Uid: 'dQGn2ozm'
      },
      Source: CaseSource.Website
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • newCase: CaseAdd

      The case to add.

    • options: { fields?: string; sendAutoResponder?: boolean } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

      • Optional sendAutoResponder?: boolean

        Whether or not to send the customer the "your ticket has been received" email. Defaults to true.

    Returns Promise<Case | ValidationError<Case>>

    The response body if response status OK, or response body with validation errors if response status 400.

addReplyFromAgent

  • Add a reply from an agent to an existing case.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.support.cases.addReplyFromAgent({
      AgentName: 'Firstname Lastname',
      Case: {
        Uid: 'rmkyza9g'
      },
      Comment: 'This is a response comment'
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • reply: SupportReply

      The reply from an agent to add to a case.

    Returns Promise<null>

    Null if response status OK.

addReplyFromClient

  • Add a reply from a customer to an existing case.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.support.cases.addReplyFromClient({
      Case: {
        Uid: 'rmkyza9g'
      },
      Comment: 'This is a response comment'
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • reply: ClientReply

      The reply from the customer to add to a case.

    Returns Promise<CaseHistory>

    The response body if response status OK.

getAll

  • getAll(options?: { FromPerson?: Required<Pick<Person, "Uid">> & Partial<Person> & Required<Pick<Person, "Email">> & Partial<Person>; fields?: string; limit?: number; offset?: number }): Promise<List<Case>>
  • Get all support cases:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.support.cases.getAll();
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • options: { FromPerson?: Required<Pick<Person, "Uid">> & Partial<Person> & Required<Pick<Person, "Email">> & Partial<Person>; fields?: string; limit?: number; offset?: number } = {}
      • Optional FromPerson?: Required<Pick<Person, "Uid">> & Partial<Person> & Required<Pick<Person, "Email">> & Partial<Person>

        Filter cases by person.

      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

      • Optional limit?: number

        The number of results returned by the API.

      • Optional offset?: number

        For pagination; returns (limit) results after this value.

    Returns Promise<List<Case>>

    The response body if response status OK.

Generated using TypeDoc