type Zendesk = {
username: string;
password: string;
subdomain: string;
};
/**
* Show Audit Log
* #### Allowed For
* Admins on accounts that have audit-log access
*/
export async function main(auth: Zendesk, audit_log_id: string) {
const url = new URL(
`https://${auth.subdomain}.zendesk.com/api/v2/audit_logs/${audit_log_id}`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 45 days ago
type Zendesk = {
username: string;
password: string;
subdomain: string;
};
/**
* Show Audit Log
* #### Allowed For
* Admins on accounts that have audit-log access
*/
export async function main(auth: Zendesk, audit_log_id: string) {
const url = new URL(
`https://${auth.subdomain}.zendesk.com/api/v2/audit_logs/${audit_log_id}`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 592 days ago