Sending a Binary File Using an API Call Notification

Last edit: Feb 28, 2020

This guide will help you send a file using an API Call Notification.


This is an advanced tutorial. To follow it, you should be familiar with basic platformOS concepts, HTML, Liquid, APIs and Forms, and the topics in the Get Started section, especially topics related to Notifications.


Sending a binary file using an API Call Notification is a special case of creating a regular API Call Notification as described in Get Started: Creating an API Call Notification. This tutorial describes the difference between a regular request and sending a file, so it consists of only one step.

  1. Create API Call Notification

Step 1: Create API Call Notification

Create the API Call Notification notifications/api_call_notifications/send_file.liquid:

name: send_file
to: ''
delay: 0
enabled: true
format: http
trigger_condition: true
request_type: post_multipart
  "file": {
    "url": "",
    "name": "my-file.jpg",
    "content_type": "image/jpeg"
  "file2": {
    "url": "",
    "name": "other-file.jpg",
    "content_type": "image/jpeg"

This defines a POST request to the endpoint, which would send two binary files. The main difference between a regular API call and sending a binary file is the _multipart suffix in request type. Valid request types are post_multipart, patch_multipart and put_multipart. The required body format for *_multipart requests is JSON following structure:

  "<param name>": {
    "url": "<required url to file remote location>",
    "name": "<optional file name>",
    "content_type": "<optional content type>"

If url includes special characters, for example & [which is the case for custom_attachment.url] please make sure to use the html_safe filter.


We are always happy to help with any questions you may have.