type Zendesk = {
username: string;
password: string;
subdomain: string;
};
/**
* Verify Identity
* Sets the specified identity as verified.
For security reasons, you can't use this endpoint to update the email identity of the account owner. To verify the person's identity, send a verification email. See [Verifying the account owner's email address](https://support.zendesk.com/hc/en-us/articles/4408828975130) in Zendesk help.
#### Allowed For
* Agents
*/
export async function main(
auth: Zendesk,
user_id: string,
user_identity_id: string
) {
const url = new URL(
`https://${auth.subdomain}.zendesk.com/api/v2/users/${user_id}/identities/${user_identity_id}/verify`
);
const response = await fetch(url, {
method: "PUT",
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 377 days ago
type Zendesk = {
username: string;
password: string;
subdomain: string;
};
/**
* Verify Identity
* Sets the specified identity as verified.
For security reasons, you can't use this endpoint to update the email identity of the account owner. To verify the person's identity, send a verification email. See [Verifying the account owner's email address](https://support.zendesk.com/hc/en-us/articles/4408828975130) in Zendesk help.
#### Allowed For
* Agents
*/
export async function main(
auth: Zendesk,
user_id: string,
user_identity_id: string
) {
const url = new URL(
`https://${auth.subdomain}.zendesk.com/api/v2/users/${user_id}/identities/${user_identity_id}/verify`
);
const response = await fetch(url, {
method: "PUT",
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 923 days ago