Sending records to another system
Connections to other systems and chats: set one up, what is sent and signed, and when a send fails.
What a connection is for
A connection is the web address of another system that accepts records: an accounting or document system, a spreadsheet tool, or a service such as Zapier or Make. Once it is set up, an automation can use the action Send to another system to send it each record it acts on.
A connection can also be a chat channel in Slack, Microsoft Teams or Google Chat, for the action Post in a chat. See Chats below.
You find connections on the Automations page, under Connections.
Setting one up
- Open Automations, click Connections, then New connection.
- Give it a Name people will recognize, such as "Accounting system".
- Paste the Web address the other system gave you. It must start with
https://. - Click Set it up.
- Copy the Signing key that appears and give it to the other system. It is shown only once.
- Click Send a test and check that the sample record (TEST-1) arrived on the other side.
Chats
To post messages in a channel, connect it once with its incoming webhook address:
- Click New connection and choose the chat under What it connects to.
- Get the channel's incoming webhook address. The form says where to find it: in Slack, add the Incoming Webhooks app to the channel; in Microsoft Teams, use the channel's Workflows, “Post to a channel when a webhook request is received”; in Google Chat, the space's Apps & integrations.
- Paste it and click Set it up, then Send a test message.
- In an automation, add Post in a chat, choose the channel and write the message. Insert a field works as in emails.
Only the chat's own addresses are accepted (for Slack, ones starting with https://hooks.slack.com/). During a live trial, messages meant for a chat come to the person trying it as a notice instead.
What is sent
Each time the action runs, the other system receives one request with the record as JSON:
| Part | What it holds |
|---|---|
id | The same for every try of one action, so the other system can ignore a repeat. |
event | created, changed, deleted or scheduled. |
automation | Which automation sent it. |
record_type, record | The kind of record, its number and its fields as automations see them. |
changes | For a change, each field's old and new value. |
For whoever builds the receiving side: the request carries X-ERP-Timestamp and X-ERP-Signature. The signature is sha256= followed by the HMAC-SHA256 of the timestamp, a dot, and the request body, using the signing key. Reject requests whose signature doesn't match.
Safety limits
- Only
https://addresses on the public internet. Addresses on your own private network are refused. - Redirects are not followed. If the other system answers with a redirect, use the address it points to.
- It waits up to 30 seconds for an answer.
- The address and signing key are stored encrypted.
When a send fails
If the other system doesn't answer or reports a problem on its side, the action is tried again after 1, 5 and 30 minutes. If it refuses the request (for example the address is wrong), the run fails straight away. Either way the run on the automation's page says what happened, and the Last request column on the Connections page shows the latest result.
| What you see | What to do |
|---|---|
| "points to a private network address" | The address is on an internal network the ERP can't reach. Use a public address. |
| "refused it (401)" or "(403)" | The other system didn't accept the request. Check the address and that it has the current signing key. |
| "refused it (404)" | The address is wrong. Copy it again from the other system. |
| "answered with a redirect" | Use the final address instead. |
| "didn't answer within 30 seconds" or "had a problem (500)" | The other system is down or slow. The action is tried again by itself. |
| "is switched off" | Open the connection and tick On, then try the run again. |
Changing the key, switching off, deleting
- Make a new signing key if the old one may have been seen by someone else. The other system rejects requests until you give it the new key.
- Untick On to stop sending without changing any automation. Automations that use it fail instead of sending.
- Delete is only possible when no automation uses the connection.