//native
type Zoho = {
token: string;
};
/**
* Update appointments rescheduled history
*
*/
export async function main(
auth: Zoho,
body: {
data: {
$currency_symbol: string;
Rescheduled_To: string;
$review_process: false | true;
Reschedule_Reason: string;
$sharing_permission: string;
Name: string;
Modified_By: { name: string; id: string; email: string };
$review: false | true;
Rescheduled_By: { name: string; id: string; email: string };
$state: string;
$canvas_id: string;
$process_flow: false | true;
id: string;
Rescheduled_Time: string;
$zia_visions: false | true;
$approved: false | true;
Modified_Time: string;
$approval: {
delegate: false | true;
approve: false | true;
reject: false | true;
resubmit: false | true;
};
Created_Time: string;
Rescheduled_From: string;
Appointment_Name: { name: string; id: string };
$editable: false | true;
$orchestration: false | true;
$in_merge: false | true;
Created_By: { name: string; id: string; email: string };
$approval_state: string;
Reschedule_Note: string;
}[];
},
) {
const url = new URL(
`https://zohoapis.com/crm/v8/Appointments_Rescheduled_History__s`,
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: "Zoho-oauthtoken " + auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago