NodeJS - Send attachments #5149
-
Hello! I need help with something... I'm trying to send files through the ChatWoot API but I'm not able to do it... I'm using NestJS, a NodeJS framework. I make the requests using "HttpService" from "@nestjs/axios" package. The "file" variable is from type "fs.ReadStream", pointing to file location. And I get this response: What am I doing wrong? I checked this post #1809 on the same topic, but I couldn't figure it out... Thank you very much!!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Can anyone give me a hand with this? Thanks! |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone, here is the solution to the problem:
Adding ...form.getHeaders() to the request headers, i solved the problem. |
Beta Was this translation helpful? Give feedback.
In case it helps anyone, here is the solution to the problem:
const headers = { api_access_token: this.token, ...form.getHeaders(), }
Adding ...form.getHeaders() to the request headers, i solved the problem.