//native
type Bitly = {
token: string;
};
/**
* Retrieve Group Preferences
* Returns preferences for the specified group.
*/
export async function main(auth: Bitly, group_guid: string) {
const url = new URL(
`https://api-ssl.bitly.com/v4/groups/${group_guid}/preferences`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + 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 428 days ago