Hi,
It would help if you shared with us what low code are you using.
In the forum there are several Bubble, OutSystems and other low code developers that perhaps can help.
In your post I’m not sure your request is missing parts or you just omitted them.
Typically the issue with making these manual requests is sending the file in binary, and making these requests by hand is always tricky.
My approach is to compare what is being sent from a tool like Postman or cUrl of a successful request to what is being sent from the low code tool.
So, for example Postman sends this:
POST /api/2.0/files/content?fields=id,type,name HTTP/1.1
Host: upload.box.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: Bearer Vx4g3daqhjFTgS37ZDC2w8LZIs7jQJYe
Cookie: box_visitor_id=65d64b39d64cc8.84093859; site_preference=desktop
Content-Length: 417
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attributes"
{
"name": "CR-USA238.pdf",
"parent": {
"id": "253757099719"
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="Document (PDF).docx"
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Where the (data) was omitted because it is difficult to represent a binary file in characters.
Another tool to get a full trace you can use is cUrl, for example:
curl --trace-ascii /dev/stdout --location 'https://upload.box.com/api/2.0/files/content' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Bearer y788...hkH' \
--form 'attributes="{
\"name\": \"Photo.png\",
\"parent\": {
\"id\": \"0\"
}
}"' \
--form 'file=@"/Users/rbarbosa/Downloads/box_admin_pic.png"'
Returns:
0000: POST /api/2.0/files/content HTTP/2
0024: Host: upload.box.com
003a: user-agent: curl/7.88.1
0053: accept: */*
0060: authorization: Bearer y788...uhkH
0098: content-length: 3111
00ae: content-type: multipart/form-data; boundary=--------------------
00ee: ----acf11690303b651d
0104:
=> Send data, 3111 bytes (0xc27)
0000: --------------------------acf11690303b651d
002c: Content-Disposition: form-data; name="attributes"
005f:
0061: {. "name": "Photo.png",. "parent": {. "id": "0". }.}
009d: --------------------------acf11690303b651d
00c9: Content-Disposition: form-data; name="file"; filename="box_admin
0109: _pic.png"
0114: Content-Type: image/png
012d:
012f: .PNG
0135: ......IHDR...@...@.....%.......pHYs................zIDATx..Y{lV.
0175: ..=.{......J..JK[67E....)........,f..........{.]]HD.2.8...d.ef..
01b5: ,....m)..~...n.}..q.......Ic.'..4.w......%U..Yx....L..h.$0.2I`.e
#####################
0bb5: b.$.hwt........@....O..h.$0.2I`.e..D.$...O=...H*..Vy.Y....IEND.B
0bf5: `.
0bf9: --------------------------acf11690303b651d--
Now you have something that works to compare with what you are sending.
To check what is actually being sent, you can use the Postman echo service. For example:
curl --location 'https://postman-echo.com/post' \
--header 'Content-Type: multipart/form-data' \
--form 'attributes="{
\"name\": \"CR-USA238.pdf\",
\"parent\": {
\"id\": \"253757099719\"
}
}"' \
--form 'file=@"/Users/rbarbosa/Downloads/CR-USA238 Box_Upload_18 - CR DA - DocuSign.pdf"'
Returns:
{
"args": {},
"data": {},
"files": {
"CR-USA238 Box_Upload_18 - CR DA - DocuSign.pdf": "data:application/octet-stream;base64,JVBERi0xLjUKJfv8/f4KMTAgMCBvYmoKPDwvTGVuZ3RoIDQ
… many more lines …
+PnN0cmVhbQp4nGMAgf9AwMjAdCQJxGFkYJ7dA2IwAXEgMoMRKLWAD1mECcZghjFYYQx2GIMFxmCDMThAdr2C2MV0Sh/KOPcbyrg0BeqM6XJQxsJuEAMAXnUR3QplbmRzdHJlYW0KZW5kb2JqCnN0YXJ0eHJlZgoyMzc5NjMKJSVFT0Y="
},
"form": {
"attributes": "{\n \"name\": \"CR-USA238.pdf\",\n \"parent\": {\n \"id\": \"253757099719\"\n }\n}"
},
"headers": {
"x-forwarded-proto": "https",
"x-forwarded-port": "443",
"host": "postman-echo.com",
"x-amzn-trace-id": "Root=1-660ed7a2-58c55cba3e0cac2f1d3cb085",
"content-length": "238720",
"user-agent": "curl/8.4.0",
"accept": "*/*",
"content-type": "multipart/form-data; boundary=------------------------eFaCmpNpRCS4r0ODRNxhbg"
},
"json": null,
"url": "https://postman-echo.com/post"
}
Let us know if this helps