//native
type Docspring = {
tokenId: string
tokenSecret: string
}
/**
* Check the status of a combined submission (merged PDFs)
*
*/
export async function main(auth: Docspring, combined_submission_id: string) {
const url = new URL(
`https://api.docspring.com/api/v1/combined_submissions/${combined_submission_id}`
)
const token = btoa(auth.tokenId + ':' + auth.tokenSecret)
const response = await fetch(url, {
method: 'GET',
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