0

Get Satisfactions

by
Published Oct 17, 2025

Retrieves a paginated list of satisfaction forms for the organization. Any one of the following roles is required for this endpoint: |Legacy Role|Equivalent Permission Set Role| |-----|--------| |org.user.satisfaction.read|org.permission.satisfaction.read|

Script kustomer Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Kustomer = {
3
  apiKey: string;
4
};
5
/**
6
 * Get Satisfactions
7
 * Retrieves a paginated list of satisfaction forms for the organization.
8

9
Any one of the following roles is required for this endpoint:
10

11
|Legacy Role|Equivalent Permission Set Role|
12
|-----|--------|
13
|org.user.satisfaction.read|org.permission.satisfaction.read|
14
 */
15
export async function main(
16
  auth: Kustomer,
17
  page: string | undefined,
18
  pageSize: string | undefined,
19
) {
20
  const url = new URL(`https://api.kustomerapp.com/v1/satisfaction`);
21
  for (const [k, v] of [
22
    ["page", page],
23
    ["pageSize", pageSize],
24
  ]) {
25
    if (v !== undefined && v !== "" && k !== undefined) {
26
      url.searchParams.append(k, v);
27
    }
28
  }
29
  const response = await fetch(url, {
30
    method: "GET",
31
    headers: {
32
      Authorization: "Bearer " + auth.apiKey,
33
    },
34
    body: undefined,
35
  });
36
  if (!response.ok) {
37
    const text = await response.text();
38
    throw new Error(`${response.status} ${text}`);
39
  }
40
  return await response.json();
41
}
42