//native
type Zoho = {
token: string;
baseUrl: string;
};
/**
* Get Forms
* This API fetches the meta information of all the forms present in a Zoho Creator application.
*/
export async function main(
auth: Zoho,
account_owner_name: string,
app_link_name: string,
) {
const url = new URL(
`${auth.baseUrl}/creator/v2.1/meta/${account_owner_name}/${app_link_name}/forms`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Zoho-oauthtoken " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago