//native
type Pinterest = {
token: string;
};
/**
* Get interest details
* Get details of a specific interest given interest ID. Click here for a spreadsheet listing interests and their IDs.
*/
export async function main(auth: Pinterest, interest_id: string) {
const url = new URL(
`https://api.pinterest.com/v5/resources/targeting/interests/${interest_id}`,
);
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 536 days ago