//native
type Pinterest = {
token: string;
};
/**
* Get media upload details
* Get details for a registered media upload, including its current status.
Learn more about video Pin creation.
*/
export async function main(auth: Pinterest, media_id: string) {
const url = new URL(`https://api.pinterest.com/v5/media/${media_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