0

Upload a single file with POST API

Can please someone help me with the following API call within Ninox? What am I doing wrong?

I am trying to upload a document in a record and I call this http request from a record with a button.

let xMethod := "POST";
let xURL := "https://api.ninox.com/v1/teams/" + TeamID + "/databases/" + 'Database ID' + "/tables/" + 'Table ID' + "/records/" + 'record ID' + "/files/";
let xHeader := {
Authorization: "Bearer IADDMYKEY HERE",
'Content-Type': "multipart/form-data"    };
let xBody := "file=@/Users/virco/Downloads/ss.png";
do as server
let xResponse := http(xMethod, xURL, xHeader, xBody);
'API result' := text(xResponse.result)
end

 

These are the Ninox Instructions

 

curl https://api.ninox.com/v1/teams/Cf8fqfNeCaAvBrjkS/databases/zvdufqsrxwr2/tables/A/records/4/files

-X POST

-H 'Authorization: Bearer c0da1580-1a26-11ec-ba4d-f9d8817e4f95'

-H 'Content-Type: multipart/form-data'

-F 'file=@"/Users/anastasiya/Downloads/iStock-184877012.jpeg"'

 

I get Internal Server error

Reply

null

Content aside

  • 1 yr agoLast active
  • 115Views
  • 1 Following