//native
type Docspring = {
tokenId: string
tokenSecret: string
}
/**
* Merge submission PDFs, template PDFs, or custom files
*
*/
export async function main(auth: Docspring) {
const url = new URL(`https://api.docspring.com/api/v1/combined_submissions?v=2`)
const token = btoa(auth.tokenId + ':' + auth.tokenSecret)
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Basic ${token}`
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 536 days ago