Handle returned by BatchCallsResource.upload. It is both:
await
.then
.catch
.on
parsing
parsed
error
parse_failed
const job = client.batchcall.upload({ filePath: "./leads.csv" });job.on("parsed", (batch) => client.batchcall.create({ batchId: batch.batchId, ...campaign }));job.on("error", (err) => console.error(err));// or, for linear code:const batch = await job; Copy
const job = client.batchcall.upload({ filePath: "./leads.csv" });job.on("parsed", (batch) => client.batchcall.create({ batchId: batch.batchId, ...campaign }));job.on("error", (err) => console.error(err));// or, for linear code:const batch = await job;
Internal
Created by BatchCallsResource.upload; not constructed directly.
Optional
Attaches callbacks for the resolution and/or rejection of the Promise.
The callback to execute when the Promise is resolved.
The callback to execute when the Promise is rejected.
A Promise for the completion of which ever callback is executed.
Handle returned by BatchCallsResource.upload. It is both:
awaitit (or use.then/.catch) to get the parsed BatchCall, or have it throw if the upload or parsing fails, and.onfor progress:parsing→parsed, orerror(alsoparse_failed) on failure.