//native
type Botify = {
token: string
}
/**
* Get project collections
* List all collections for a project
*/
export async function main(auth: Botify, username: string, project_slug: string) {
const url = new URL(`https://api.botify.com/projects/${username}/${project_slug}/collections`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Token ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 28 days ago