Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3641

Upload files in SuiteCRM using the v4.1 API through the body of the request

$
0
0

I'm using the Suite CRM v4.1 API and I'm developing a webapp that allows users to upload files to the CRM.

The code works, however the request requires the use of parameters which get appended to the URL, hence when uploading a file (which has to be encoded in Base 64) I run into the URL char limit (2k~ characters) since even an empty pdf encoded in B64 takes up at least 30k characters. (when uploading an empty or almost empty txt file it works fine because of this).

The solution would obviously be to send the data in the request body, however the documentation isn't great and I haven't found any way of doing so.

I may be doing this completely the wrong way but I haven't found anything in regards to sending data to the API using the request body.

If anyone has encountered the same issue in the past and has any tips I'd appreciate it.

The params I'm sending look like this on Postman:

method:set_document_revisioninput_type:JSONresponse_type:JSONrest_data: {"session":"[token]","note": {"id":"[entry id]","file":"[encoded file (in B64)]","filename":"[filename eg. test.pdf]" }}

Viewing all articles
Browse latest Browse all 3641

Trending Articles