Incremental Attributes Values Export

Returns a stream of changes that occurred on routing attribute values. #### Allowed For * Admins #### Parameters Optional | Name | Type | Comment | ------ | ------ | ------- | cursor | string | The `cursor` parameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. See [Pagination](#pagination).

Script zendesk Verified

by hugo697 ยท 11/7/2023

The script

Submitted by hugo697 Typescript (fetch-only)
Verified 377 days ago
1
type Zendesk = {
2
  username: string;
3
  password: string;
4
  subdomain: string;
5
};
6
/**
7
 * Incremental Attributes Values Export
8
 * Returns a stream of changes that occurred on routing attribute values.
9

10
#### Allowed For
11

12
* Admins
13

14
#### Parameters
15

16
Optional
17

18
| Name   | Type   | Comment
19
| ------ | ------ | -------
20
| cursor | string | The `cursor` parameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. See [Pagination](#pagination).
21

22
 */
23
export async function main(auth: Zendesk) {
24
  const url = new URL(
25
    `https://${auth.subdomain}.zendesk.com/api/v2/incremental/routing/attribute_values`
26
  );
27

28
  const response = await fetch(url, {
29
    method: "GET",
30
    headers: {
31
      Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
32
    },
33
    body: undefined,
34
  });
35
  if (!response.ok) {
36
    const text = await response.text();
37
    throw new Error(`${response.status} ${text}`);
38
  }
39
  return await response.json();
40
}
41