mondaycom/monday-sdk-js

Encountered Internal server error when trying to upload a file through query

Livia-Gu-Notitia opened this issue · 1 comments

In my app, I have set up the sdk with the right token, I can make other query, however When I try to upload a file to a column on a board, it hits an internal server error.
my code as following:

const file = await fetch('/images/test.pdf').then(r => r.arrayBuffer());
console.log(file)
const query = mutation {add_file_to_column (item_id: 1844256842, column_id: "files", file: ${file}) {id}}

try{
const response = await monday.api(query)
console.log(24, response)

}catch(e){
console.log(e)
}
error message as follow

Screenshot 2024-02-26 at 9 39 02 am Screenshot 2024-02-26 at 9 39 14 am

@Livia-Gu-Notitia this is not related to the SDK itself, but to monday api. You can find all relevant documentation here: https://developer.monday.com/api-reference/reference/assets-1