Multipart/form-data custom app

:bullseye: What is your goal?

There is no documentation on how to do this circa 2025. This should be easy but it is not. A https POST where one field is a text field and the other is a file (which would of course be the data from something like Google download file). Unfortunately, there is zero documentation on how to do such a thing. There is various posts but none seem to be up to date.

Communications

{
  "url": "/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}",
    "Content-Type": "multipart/form-data"
  },
  "body": {
    "LayoutData": {
      "value": "{{ parameters.LayoutData }}",
      "fieldType": "file"
    },
    "DlexPath": {
      "value": "{{ parameters.DlexPath }}",
      "fieldType": "text"
    }
  },
  "response": {
    "output": {
      "type": "buffer"
    }
  }
}

Mappable Parameters

[
  {
    "name": "apiKey",
    "type": "text",
    "label": "DynamicPDF API Key",
    "required": true
  },
  {
    "name": "DlexPath",
    "type": "text",
    "label": "DLEX Path",
    "required": true
  },
  {
    "name": "LayoutData",
    "type": "buffer",
    "label": "Layout Data File (JSON)",
    "required": true,
    "semantic": "file:data"
  }
]

This returns JSON and never makes a form post.

1 Like

So far I’ve tried every combination suggested by chatgpt and nothing works. Does Make employees monitor this community forum, if so, please advise, as after a few days of this and trial and error, chatgpt is throwing up its hands and basically advising me that you guys didn’t implement it in 2025 editor or its not documented. I’m certain there has to be some “secret sauce” not documented.

Here’s latest and last attempt, but it sure looks like you can’t implement a multipart/form-data request using a custom component in Make using 2025 syntax changes. It automagically converts to content-type json rather than a form posting.

Communication

{
  "url": "/dlex-layout",
  "method": "POST",
  "headers": {
    "Accept": "application/pdf",
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "body": [
    {
      "type": "text",
      "name": "DlexPath",
      "value": "{{parameters.DlexPath}}"
    },
    {
      "type": "file",
      "name": "LayoutData",
      "data": "{{parameters.LayoutData}}"
    }
  ]
}

Mappable Parameters

[
  {
    "name": "apiKey",
    "type": "text",
    "label": "DynamicPDF API Key",
    "required": true
  },
  {
    "name": "DlexPath",
    "type": "text",
    "label": "DLEX Path",
    "required": true
  },
  {
    "name": "LayoutData",
    "type": "file",
    "label": "Layout Data File (JSON)",
    "required": true
  }
]

Raw Request (edited for length)

{
  "_engineData": {
    "calledAt": "Not available"
  },
  "response": {
    "status": 500,
    "headers": {
      "connection": "close",
      "content-type": "application/json; charset=utf-8",
      "date": "Wed, 26 Nov 2025 20:35:19 GMT",
      "server": "Kestrel",
      "transfer-encoding": "chunked",
      "strict-transport-security": "max-age=2592000"
    },
    "body": {
      "id": "7a20f427-a51f-46f5-b059-e7cb699c67ba",
      "message": "Object reference not set to an instance of an object."
    },
    "_engineData": {
      "calledAt": "Not available"
    }
  },
  "request": {
    "url": "https://api.dpdf.io/v1.0/dlex-layout",
    "headers": {
      "user-agent": "Make/production",
      "accept": "application/pdf",
      "authorization": "Bearer DP.—redacted----",
      "content-type": "application/json"
    },
    "method": "POST",
    "body": [
      {
        "name": "DlexPath",
        "type": "text",
        "value": "samples/dlex-layout/SimpleReportWithCoverPage.dlex"
      },
      {
        "data": "...",
        "name": "LayoutData",
        "type": "file"
      }
    ]
  }
}
1 Like

According to Multipart/form-data | Custom Apps Documentation | Make Developer Hub,

Your body should be a COLLECTION, with a property named file.

You are currently doing an ARRAY.

Hope this helps! If you are still having trouble, please provide more details.

— @samliew

And there lies the issue. Type file? Okay, then what is the field’s name? So I tried something reasonable, “name” as the attribute. Now, before you object to what I post not matching exactly, I tried that too.

{
  "url": "/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "body": {
    "text": {
      "name" : "DlexLayout",
      "value": "{{parameters.DlexPath}}"
    },
    "file": {
      "name" : "LayoutData",
      "value": "{{parameters.LayoutData}}",
      "options": {
        "filename": "{{parameters.file_name}}"
      }
    }
  }
}

And,

[
  {
    "name": "apiKey",
    "type": "text",
    "label": "DynamicPDF API Key",
    "required": true
  },
  {
    "name": "DlexPath",
    "type": "text",
    "label": "DLEX Path",
    "required": true
  },
  {
    "name": "file_name",
    "type": "text",
    "label": "LayoutData File Name",
    "required": true,
    "semantic": "file:name"
  },
  {
    "name": "LayoutData",
    "type": "buffer",
    "label": "Layout Data File (Data)",
    "required": true,
    "semantic": "file:data"
  }
]

And the request.

{
    "_engineData": {
        "calledAt": "Not available"
    },
    "response": false,
    "request": {
        "url": "https://api.dpdf.io/v1.0/dlex-layout",
        "headers": {
            "user-agent": "Make/production",
            "authorization": "Bearer --snip---",
            "content-type": "multipart/form-data"
        },
        "method": "POST",
        "body": {
            "file": {
                "name": "LayoutData",
                "value": "IMTBuffer(13934, binary, 2f823c8caaaba458108c953c18cdac392c0908c7)",
                "options": {
                    "filename": "SimpleReportWithCoverPage.json"
                }
            },
            "text": {
                "name": "DlexLayout",
                "value": "samples/dlex-layout/SimpleReportWithCoverPage.dlex"
            }
        }
    }
}

And it never makes the request. Delivers this error.

{
    "type": "error",
    "array": "source.on is not a function",
    "_engineData": {
        "calledAt": "Not available"
    }
}

The frustrating part is can try a lot of different ideas…instead of file and text have it Layoutdata and DlexPath, no dice. At least now it is showing content-type header as multipart/form-data.

This is the curl request, and this works fine in postman so I know it’s not an error with the inputs or the call.

curl --location 'https://api.dpdf.io/v1.0/dlex-layout' \
--header 'Authorization: Bearer --- snip ----' \
--form 'LayoutData=@"/C:/Users/James Brannan/Downloads/SimpleReportWithCoverPage.json"' \
--form 'DlexPath="samples/dlex-layout/SimpleReportWithCoverPage.dlex"'

I also tried:

{
  "url": "/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "body": {
    "DlexPath": {
      "value": "{{parameters.DlexPath}}"
    },
    "LayoutData": {
      "value": "{{parameters.LayoutData}}",
      "options": {
        "filename": "{{parameters.file_name}}"
      }
    }
  }
}

But same result.

{
    "type": "error",
    "array": "source.on is not a function",
    "_engineData": {
        "calledAt": "Not available"
    }
}

And the raw request.

{
    "_engineData": {
        "calledAt": "Not available"
    },
    "response": false,
    "request": {
        "url": "https://api.dpdf.io/v1.0/dlex-layout",
        "headers": {
            "user-agent": "Make/production",
            "authorization": "Bearer  ---snip---",
            "content-type": "multipart/form-data"
        },
        "method": "POST",
        "body": {
            "DlexPath": {
                "value": "samples/dlex-layout/SimpleReportWithCoverPage.dlex"
            },
            "LayoutData": {
                "value": "IMTBuffer(13934, binary, 2f823c8caaaba458108c953c18cdac392c0908c7)",
                "options": {
                    "filename": "SimpleReportWithCoverPage.json"
                }
            }
        }
    }
}

And even more mystifying, the curl from Make’s Live Stream:

curl -X POST 'https://api.dpdf.io/v1.0/dlex-layout' -H 'user-agent: Make/production' -H 'authorization: Bearer --snip--' -H 'content-type: multipart/form-data' -d '{"DlexPath":{"value":"samples/dlex-layout/SimpleReportWithCoverPage.dlex"},"LayoutData":{"value":"IMTBuffer(13934, binary, 2f823c8caaaba458108c953c18cdac392c0908c7)","options":{"filename":"SimpleReportWithCoverPage.json"}}}'

I am pretty familiar with curl and POST and form posting, but am I correct in thinkng Make is trying to send json?

Seems like this might be a limitation/bug with either the documentation or implementation, as what is provided by the documentation doesn’t appear to work as documented.

@James_A_Brannan You can try doing this if you haven’t tried it. I hope this helps you!

Module (Get a file) > Map (file_name) (file_data)

Parameters (file_data = buffer)

[
  { "name": "apiKey",    "type": "text",   "required": true },
  { "name": "DlexPath",  "type": "text",   "required": true },
  {
    "name": "file_name",
    "type": "text",
    "required": true,
    "semantic": "file:name"
  },
  {
    "name": "file_data",
    "type": "buffer",
    "required": true,
    "semantic": "file:data"
  }
]

Communication (Body = Collection)

{
  "url": "https://api.dpdf.io/v1.0/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "body": {
    "DlexPath": {
      "value": "{{parameters.DlexPath}}"
    },
    "LayoutData": {
      "value": "{{parameters.file_data}}",
      "options": {
        "filename": "{{parameters.file_name}}"
      }
    }
  },
  "response": {
    "output": {
      "type": "buffer"
    }
  }
}

Didn’t work. So here’s where I’m at currently.

Communication (the mapping tab is the same)

{
  "url": "https://api.dpdf.io/v1.0/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "log": {
    "sanitize": [ "request.headers.authorization" ]
  },
  "body": {
    "DlexPath": "{{parameters.DlexPath}}",
    "LayoutData": {
      "value": "{{parameters.file_data}}",
      "options": {
        "filename": "{{parameters.file_name}}"
      }
    }
  },
  "response": {
    "output": {
      "type": "buffer"
    }
  }
}

When I run and view with the Make Flow Viewing tool for Chrome.

{
    "user-agent": "Make/production",
    "authorization": "***",
    "content-type": "multipart/form-data"
}

and

{
    "DlexPath": "samples/dlex-layout/SimpleReportWithCoverPage.dlex",
    "LayoutData": {
        "options": {
            "filename": "SimpleReportWithCoverPage.json"
        }
    }
}

and in response body

{
    "id": "8b2e78fa-fc05-49d9-beec-1971d65dfd5a",
    "message": "'u' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0."
}

and the raw request

[
    {
        "apiKey": "-- redacted --",
        "DlexPath": "samples/dlex-layout/SimpleReportWithCoverPage.dlex",
        "file_name": "SimpleReportWithCoverPage.json",
        "LayoutData": "IMTBuffer(13934, binary, 2f823c8caaaba458108c953c18cdac392c0908c7): efbbbf7b0d0a2020225265706f727443726561746564466f72223a2022416c657820536d697468222c0d0a20202250726f6475637473223a205b0d0a202020207b0d0a2020202020202250726f647563744944223a2031372c0d0a202020202020225072"
    }
]

and output bundle

[
    null
]

So if anyone sees anything that strikes them would appreciate any help. I know the files are all valid, as I checked the call in postman. Sure seems sketchy considering this is such an easy thing to do…form post with a field and a file.

I finally got it to work. Thanks for help. Here is the communication tab, mappable parameters, and the interface. Note: for some reason the options, filename was not optional lol - without it my code didn’t work. Also fiddled with lots of response/output but this ultimately worked. Hope this helps others down the line. Now on to the next step…allowing users to add multiple files to a multipart/form-data custom app :open_mouth: - btw…shameless plug: doing all this so we can add a custom module for dpdf.io (I’m the developer evanglist).

{
  "url": "https://api.dpdf.io/v1.0/dlex-layout",
  "method": "POST",
  "type": "multipart/form-data",
  "headers": {
    "Authorization": "Bearer {{parameters.apiKey}}"
  },
  "log": {
    "sanitize": [ "request.headers.authorization" ]
  },
  "body": {
    "DlexPath": "{{parameters.DlexPath}}",
    "LayoutData": {
      "value": "{{parameters.LayoutData}}",
      "options": {
        "filename": "{{parameters.file_name}}"
      }
    }
  },
  "response": {
    "output": {
      "data": "{{body}}"
    }
  }
}

and for interface:

[
  { "name": "data", "type": "buffer", "label": "Data", "semantic": "file:data" }
]

And mappable parameters:

[
  {
    "name": "apiKey",
    "type": "text",
    "label": "DynamicPDF API Key",
    "required": true
  },
  {
    "name": "DlexPath",
    "type": "text",
    "label": "DLEX Path",
    "required": true
  },
  {
    "name": "file_name",
    "type": "text",
    "required": true,
    "semantic": "file:name"
  },
  {
    "name": "LayoutData",
    "type": "buffer",
    "label": "Layout Data File (Data)",
    "required": true,
    "semantic": "file:data"
  }
]
1 Like