mondaycom / monday-sdk-js

Node.js and JavaScript SDK for developing over the monday.com platform
https://monday.com
MIT License
87 stars 39 forks source link

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

Closed Livia-Gu-Notitia closed 7 months ago

Livia-Gu-Notitia commented 7 months ago

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
gregra81 commented 7 months ago

@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