POST binary file to REST API (lexoffice)

I like to upload a file to the german bookkeeping platform Lexoffice. Unfortunately there is not app for them in n8n so I tried to use there Public API. In the flow I already downloaded the file from another app and also see the binary in the editor. Clicking on “View” renders the correct PDF file.

But when sending to the lexoffice API I always get an error: {\"i18nKey\":\"bad_request_error\",\"source\":\"Required part 'file' is not present.\",\"type\":\"bad_request_error\"}

workflow

Share the output returned by the last node

{\"i18nKey\":\"bad_request_error\",\"source\":\"Required part 'file' is not present.\",\"type\":\"bad_request_error\"}

Information on your n8n setup

  • n8n version: 1.31.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

hello @AAArtist

You can open the dev console (f12, console tab) and see what the exact request is being sent to the API endpoint.

Thanks for your response. Did this already and there is an object for file. My first thought was that maybe the API is wrong, but that’s not the problem. I think I don’t get how this is handled in n8n exactly.

After failing with this workflow I created a Python script which is working perfectly.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.