You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What problem is this request going to solve?
It would be nice to be able to run a file request through the SDK rather than sending it in as a post request with my token key.
When sending a file as a post request to /v2 or /v2/file endpoint from a host such as ngrok.io, I get a CORS issue.
If I send a file to /v2 endpoint from a published build from website.monday.com, I am able to successfully send a file through a post request. Unfortunately /v2/file still gets a CORS issue.
What is the solution you'd like to see?
It would be great to send a file through the SDK. I know that most of the queries/mutations for monday.api() are JSON string so it's going to be different than file that is multipart/form-data. I don't know what goes on in house as it gets sent home with window.parent.postMessage(), but my recommendation is sending it with a different function. So instead of Monday.api(query, options) , create a new one and call it something like: Monday.file()
Or if the backend is in charge of converting file to formdata, then the user could write: Monday.file(query, {variables: {update_ID: 123, file: file}})
Describe alternatives you've considered
I have it already working by sending the file to the backend which bypasses the CORS issue straight to the v2/file endpoint since I can't access it through the client side.
What problem is this request going to solve?
It would be nice to be able to run a file request through the SDK rather than sending it in as a post request with my token key.
When sending a file as a post request to
/v2
or/v2/file
endpoint from a host such as ngrok.io, I get a CORS issue.If I send a file to
/v2
endpoint from a published build from website.monday.com, I am able to successfully send a file through a post request. Unfortunately/v2/file
still gets a CORS issue.What is the solution you'd like to see?
It would be great to send a file through the SDK. I know that most of the queries/mutations for monday.api() are JSON string so it's going to be different than file that is
multipart/form-data
. I don't know what goes on in house as it gets sent home withwindow.parent.postMessage()
, but my recommendation is sending it with a different function. So instead ofMonday.api(query, options)
, create a new one and call it something like:Monday.file()
Or if the backend is in charge of converting file to formdata, then the user could write:
Monday.file(query, {variables: {update_ID: 123, file: file}})
Describe alternatives you've considered
I have it already working by sending the file to the backend which bypasses the CORS issue straight to the
v2/file
endpoint since I can't access it through the client side.Additional information
I created a post regarding this topic here: https://community.monday.com/t/requesting-code-example-for-file-upload-via-mondays-sdk-client-side/10099
And here's a separate discussion regarding the CORS limitation on the client side via file post requests: https://community.monday.com/t/cors-issue-when-uploading-file-with-api-v2/9993
The text was updated successfully, but these errors were encountered: