General

Lookups

General Lookups API Calls

General Lookups

This API returns all lookup values to be used in all other API calls including the Contact Centre API.

Path
GET /lookups

Request (GET)

Any of the following query parameters can be provided for filtering results.

Query ParameterData typeDescription
typestringFilter by lookup type
categorystringFilter by lookup category

Response (JSON)

Data is returned as a JSON object in the following format:

JSON response
{
  "lookups": [{
  "id": "56926d84-6039-4f32-b46a-73d2d5d7f7c5",
  ...
  }, ...]
}

Lookups section

Field name

Data type

Description

id

uuid

ID number associated with lookup, can be used as an input to other API call values. Null if it can not be used as an input e.g. for product unit names.

type

string

Type associated with the lookup e.g. ‘Bank’

title

string

Descriptive lookup string e.g. ‘NEDBANK’, can be used as an input to other API call values

category

string

Category associated with the lookup e.g. ’BankAccounts’

value

string

Optional value associated with the lookup e.g. ‘198765’

parent_lookups_id

uuid

Used by ‘Regions’ (provinces) and ‘ID’ number type categories, links to ‘Country’ IDs. When set to null this field is applicable to all countries.

Filter Lookups

To filter the lookup fields pass the type can category like below to filter the lookups.

Path
GET /lookups/{type}}/{category}

Example: /lookups/bank/accounts

Custom Field Lookups

This API returns lookup values to be used in all other API calls.

Path
GET /lookups/custom_fields/{people|companies}

Request (GET)

Response (JSON)

Data is returned as a JSON object in the following format:

{
  "status": true,
  "records": {
    "Farm Type": {
      "type": "enum",
      "name": "Farm Type",
      "description": "Main produce",
      "options": ["Pork", "Veggies"]
    },
    ...
  }
}

Records section

Field name

Data type

Description

type

string

String, enum, number, decimal, boolean, date, array or enum_array. Enum is used to select a single value and enum_array is a multi select scenario. Both array and enum_array values should be passed as comma separated strings e.g. ‘potatoes,grapes,pumpkins’

name

string

Key name to be used for the custom field

description

string

Optional description about the custom field.

options

array

String array of options available for enum and enum_array types.


Copyright © 2024 SwitchTransact