//native
type Pinterest = {
token: string;
};
/**
* Get integration metadata
* Get integration metadata by ID.
Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.
*/
export async function main(auth: Pinterest, id: string) {
const url = new URL(`https://api.pinterest.com/v5/integrations/${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