//native
type Shutterstock = {
token: string;
};
/**
* Get details about contributors' collections
* This endpoint gets more detailed information about a contributor's collection, including its cover image, timestamps for its creation, and most recent update. To get the items in collections, use GET /v2/contributors/{contributor_id}/collections/{id}/items.
*/
export async function main(
auth: Shutterstock,
contributor_id: string,
id: string,
) {
const url = new URL(
`https://api.shutterstock.com/v2/contributors/${contributor_id}/collections/${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 235 days ago