//native
type Botify = {
token: string
}
/**
* Create job
* Creates a job instance of a class which depends on the "job_type" parameter you sent. Returns the model id that manages the task.
*/
export async function main(auth: Botify) {
const url = new URL(`https://api.botify.com/jobs`)
const response = await fetch(url, {
method: 'POST',
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 2 days ago