{"id":22194,"date":"2022-08-30T09:05:52","date_gmt":"2022-08-30T08:05:52","guid":{"rendered":"https:\/\/www.oderland.se\/support\/artikel\/integrera-postal-med-din-applikation-via-api\/"},"modified":"2026-03-16T14:15:39","modified_gmt":"2026-03-16T13:15:39","slug":"integrate-postal-with-your-application-via-api","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/integrate-postal-with-your-application-via-api\/","title":{"rendered":"Integrate Postal with your application via API"},"content":{"rendered":"\n<p>Integrating <a href=\"https:\/\/www.oderland.com\/postal\/\" target=\"_blank\" rel=\"noreferrer noopener\">Postal<\/a> 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 <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/should-i-use-api-or-smtp\/\" data-type=\"ht_kb\" data-id=\"22180\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>The integration has two parts:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>API connection to send messages.<\/li>\n\n\n\n<li>Webhook connection to receive status on sent messages.<\/li>\n<\/ol>\n\n\n\n<p>We recommend that you also integrate webhooks to receive status on the messages you send, but this is optional.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><a href=\"https:\/\/wordpress.org\/plugins\/oderland-smtp-postal-mailer\/\" target=\"_blank\" rel=\"noreferrer noopener\">Our in-house developed SMTP and Postal plugin for WordPress<\/a> has built-in support for the Postal API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Client libraries<\/h2>\n\n\n\n<p>There are several ready-made client libraries to help you send emails with Postal:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/postalserver\/postal-ruby\" target=\"_blank\">Ruby<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/postalserver\/postal-rails\" target=\"_blank\">Rails<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/postalserver\/postal-mailgem\" target=\"_blank\">Ruby (mail gem)<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/postalserver\/postal-php\" target=\"_blank\">PHP<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/postalserver\/postal-node\" target=\"_blank\">Node<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/matthewmgamble\/postal-java\" target=\"_blank\">Java<\/a><\/li>\n<\/ul>\n\n\n\n<p>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&#8217;s GitHub repository.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Send directly to the API<\/h2>\n\n\n\n<p>You can also make your own connection to the Postal API. There are two APIs:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"http:\/\/apiv1.postalserver.io\/controllers\/messages.html\"><strong>Messages API<\/strong><\/a>. Get information about a sent message.<\/li>\n\n\n\n<li><a href=\"http:\/\/apiv1.postalserver.io\/controllers\/send.html\"><strong>Send API<\/strong><\/a>. Send messages from your application.<\/li>\n<\/ol>\n\n\n\n<p>All information on these two APIs, as well as information on structure, errors and connectivity can be found <a href=\"http:\/\/apiv1.postalserver.io\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">in the API documentation<\/a>.<\/p>\n\n\n\n<p>When using the API, you should use the base URL <code>https:\/\/postalserver.oderland.com<\/code><\/p>\n\n\n\n<p>For example, the URL for sending a message will be: <code>https:\/\/postalserver.oderland.com\/api\/v1\/send\/message<\/code><\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-danger\">Replace <code>postalserver.oderland.com<\/code> with the Postal server on which your service is hosted. You can see it based on <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-login-to-the-postal-web-interface\/#find-the-correct-postal-server\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/a> (section &#8220;Find the correct Postal server&#8221; at the beginning).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Receive status via webhooks<\/h2>\n\n\n\n<p>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:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>See which messages are bouncing, so you can, for example, remove the address from your register.<\/li>\n\n\n\n<li>See which links are clicked in your message.<\/li>\n\n\n\n<li>See how many times your message has been opened.<\/li>\n\n\n\n<li>Get information about other errors that may occur when sending your message.<\/li>\n<\/ul>\n\n\n\n<p>More information about each webhook, its response structure and which events are available can be found in <a href=\"https:\/\/docs.postalserver.io\/developer\/webhooks\" target=\"_blank\" rel=\"noreferrer noopener\">the webhooks documentation<\/a>. We have also written <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-create-webhooks-in-postal\/\" target=\"_blank\" rel=\"noreferrer noopener\">the following guide<\/a> on how to set up a webhook in the Postal web interface.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: We recommend that you also integrate webhooks to receive status on the&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[1102],"ht-kb-tag":[],"class_list":["post-22194","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-postal-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/22194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=22194"}],"version-history":[{"count":7,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/22194\/revisions"}],"predecessor-version":[{"id":25096,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/22194\/revisions\/25096"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=22194"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=22194"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=22194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}