Integrating Postal directly with your application via API gives you more control over how your mailings are sent and received. You can read more about the difference between API and SMTP integration here.
The integration has two parts:
- API connection to send messages.
- Webhook connection to receive status on sent messages.
We recommend that you also integrate webhooks to receive status on the messages you send, but this is optional.
Client libraries
There are several ready-made client libraries to help you send emails with Postal:
These libraries are open source and provided by the community. Unfortunately, we cannot offer any support for the libraries but refer to the respective library’s GitHub repository.
Send directly to the API
You can also make your own connection to the Postal API. There are two APIs:
- Messages API. Get information about a sent message.
- Send API. Send messages from your application.
All information on these two APIs, as well as information on structure, errors and connectivity can be found in the API documentation.
When using the API, you should use the base URL https://postalserver.oderland.com
For example, the URL for sending a message will be: https://postalserver.oderland.com/api/v1/send/message
Receive status via webhooks
We recommend that you also receive the status of the messages you send. To be able to get status back, you need to send using the API and not via SMTP. With webhooks you get the possibility to:
- See which messages are bouncing, so you can, for example, remove the address from your register.
- See which links are clicked in your message.
- See how many times your message has been opened.
- Get information about other errors that may occur when sending your message.
More information about each webhook, its response structure and which events are available can be found in the webhooks documentation. We have also written the following guide on how to set up a webhook in the Postal web interface.