Error calling /assets from CMApi

  • 19 August 2022
  • 3 replies

Userlevel 3

I’m trying to upload a document using the /assets api found here:


I have modified my curl command to look like the one in the documents (removing some non-needed optional parameters):


 curl -X POST
-H 'api_key: redacted'
-H 'authorization: redacted'
-H 'content-type: multipart/form-data'
-F 'asset[upload]=/home/tmarshall/Downloads/My-pdf.pdf'

And the error I am getting back is:

{"error_message":"We're sorry, but something went wrong. We've been notified about this issue and will take a look at it shortly. Please contact for assistance.","error_code":194}

Please advise!


Best answer by Saqlain 22 August 2022, 08:10

View original

3 replies

Userlevel 1

Hi Tyler,

I checked the curl command you shared. Seems like the command is not able to access the file location and instead of accepting the file as location it is treated just as a text. You can modify the command to get it working. Here is an working example:


curl --location --request POST '' \

--header 'api_key: redacted' \

--header 'authorization: redacted' \

--form 'asset[upload]=@"/Users/saqlainkali/Downloads/image.png"'


I hope this helps!

Userlevel 3

Hi @Saqlain,


While I can post correctly using CURL to that url, I am having troubles doing it thru nodejs/axios. I appear to be consistently getting the same error I had previously.


I see that if I do not submit the header of `content-type: multipart/form-data` then a `Content-Type:multipart x-www-form-urlencoded` gets set instead. I’ve set both below… I am not sure if this is expected? Here is my headers being sent:



"message": "Request failed with status code 500",
"name": "AxiosError",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
"transformRequest": [
"transformResponse": [
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "multipart/form-data; boundary=--------------------------806978901154770207635157",
"api_key": "redacted",
"authorization": "redacted",
"User-Agent": "axios/0.27.2",
"content-type": "multipart/form-data; boundary=--------------------------672053836125832480963207"
"method": "post",
"url": "",
"data": {
"_overheadLength": 339,
"_valueLength": 175,
"_valuesToMeasure": [],
"writable": false,
"readable": true,
"dataSize": 0,
"maxDataSize": 2097152,
"pauseStreams": true,
"_released": true,
"_streams": [],
"_currentStream": null,
"_insideLoop": false,
"_pendingNext": false,
"_boundary": "--------------------------672053836125832480963207",
"_events": {},
"_eventsCount": 1
"status": 500

Thanks in advance

Userlevel 3

Ah, I resolved this, I had to FS read in the file, and cannot specify a filename locally.