
hi ! I'm using npm appwrite integration, i'm trying to save a mesage in my brand new collection, but i have this error :
at Client.<anonymous> (./node_modules/appwrite/dist/cjs/sdk.js:393:27)
at Generator.next (<anonymous>)
at fulfilled (./node_modules/appwrite/dist/cjs/sdk.js:24:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 401,
type: 'user_unauthorized',
response: {
message: 'The current user is not authorized to perform the requested action.',
code: 401,
type: 'user_unauthorized',
version: '0.12.111'
}
}```
here's my code so far :
try {
// Save the message to Appwrite database
const response = await databases.createDocument(
APPWRITE_DATABASE_ID,
APPWRITE_COLLECTION_ID,
'unique()',
{
message: message,
}
);
await interaction.reply({ content: `Message saved with ID: ${response.$id}`, ephemeral: true });
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while saving the message.', ephemeral: true });
}
I've double checked Database id (with letters), the collection id (with numbers), and my api rights accept all database related actions.
Can i make the error message more specific on the missing right ?
thank you !

Do you have set permissions?

i'm discovering appwrite, so maybe ? 😅

you are talking about that ?

Is your code running server side or client side

it's a discord bot, so i will say server side, the error is generated by discord

How are you creating the Client?

for dev purpose, i have a node server in my pc, i launch the bot with node src/index.js

@tnnIs this appwrite cloud or you're self-hosting?

appwrite cloud 🙂
Recommended threads
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Row with the requested ID already exists...
I’m hitting a blocking issue creating rows in Appwrite (both from the console and my React Native app). After successfully inserting the first row, every subseq...
