//native
type Botify = {
token: string
}
/**
* Clone values list
* Clone all keyword groups of the current project to another one. This endpoint is a little more general (for further use). That's why you will see a 'type' field (with a default value of: 'keywords').
*/
export async function main(auth: Botify, username: string, project_slug: string) {
const url = new URL(
`https://api.botify.com/projects/${username}/${project_slug}/values_list/clone`
)
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 52 days ago