CRM integrations: HubSpot, Salesforce and Zoho
Process CRM attachments with MaxScanner from HubSpot workflows, Salesforce Flow or Apex, and Zoho CRM Deluge functions.
Short answer
CRMs call the MaxScanner API with their own HTTP features: a HubSpot workflow webhook or custom code action, a Salesforce Flow HTTP Callout or Apex with a Named Credential, or Zoho CRM's Deluge invokeurl in a workflow function. Send the attachment's URL to /documents/import/ or /jobs/, keep the jobId on the record, and update the record when the processing.completed webhook arrives.
The pattern
Keep the CRM side small. The CRM sends a file reference and a stable ID, MaxScanner does the work, and a webhook handler (often a tiny serverless function or an automation tool) writes the result back. Store the API key in the CRM's secret store: HubSpot secrets, a Salesforce Named Credential, Zoho connections or org variables.
- Use the CRM record ID in the Idempotency-Key, e.g. deal-18273-quote-pdf
- Save jobId on the record so you can match the webhook later
- Attach the result by downloading output.downloadUrl immediately — it expires in five minutes
HubSpot
Workflows can call external APIs with the "Send a webhook" action or a custom code action on plans that include them (Operations Hub, now Data Hub, Professional or Enterprise). A custom code action in Node.js can call /jobs/ and return the jobId as an output for later steps.
// HubSpot custom code action (Node.js). Add MAXSCANNER_API_KEY under Secrets.
exports.main = async (event, callback) => {
const res = await fetch('https://maxscanner.app/api/v1/jobs/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MAXSCANNER_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `deal-${event.object.objectId}-quote-pdf`,
},
body: JSON.stringify({ url: event.inputFields.quote_url, filename: 'quote.docx', format: 'pdf' }),
});
const job = await res.json();
callback({ outputFields: { maxscanner_job_id: job.jobId } });
};Salesforce
Create an External Credential and a Named Credential for https://maxscanner.app with a custom header Authorization: Bearer <key>. Then call the API from Flow with an HTTP Callout action, or from Apex as below. Callouts cannot run in the same transaction as uncommitted DML, so trigger them from an asynchronous context such as Queueable Apex or a scheduled path.
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:MaxScanner/api/v1/jobs/');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Idempotency-Key', 'opp-' + opp.Id + '-pdf');
req.setBody(JSON.serialize(new Map<String, Object>{
'url' => fileUrl, 'filename' => 'contract.docx', 'format' => 'pdf'
}));
HttpResponse res = new Http().send(req);
Map<String, Object> job = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
opp.MaxScanner_Job_Id__c = (String) job.get('jobId');Zoho CRM
Create a connection or store the key in an org variable, then call the API from a Deluge function attached to a workflow rule.
headers = Map();
headers.put("Authorization", "Bearer " + zoho.crm.getOrgVariable("maxscanner_api_key"));
headers.put("Idempotency-Key", "lead-" + leadId + "-ocr");
body = {"url": fileUrl, "filename": "scan.png"};
resp = invokeurl
[
url: "https://maxscanner.app/api/v1/documents/import/"
type: POST
parameters: body.toString()
headers: headers
content-type: "application/json"
];
info resp.get("documentId");Frequently asked questions
Is there a native MaxScanner app in the HubSpot, Salesforce or Zoho marketplaces?
Not yet. The patterns here use each CRM's standard HTTP features, so they work today without installing anything.
Are CRM attachment URLs public?
Often not. If the CRM gives a private or expiring link, download the file in your function and use the direct upload flow instead of /documents/import.