#[solved] can't create collection
34 messages · Page 1 of 1 (latest)
Is this with a Client SDK or a Server SDK?
Server sdk
Hello! Could you please share your code or the problematic fragment, so we take a look into what could be failing?
It is the basic code from GitHub python sdk examples
“databases.create_collection(database_id="658f2efa61",collection_id="",name="Wow")“
Where exactly did you see this example? Because this is missing the collection ID
But this error occurs because of access (missing or incorrect API key)
i want collection id to be random
You want an auto generated id?
Yes, you need to use ID.unique() just like you would for documents
also in python ?
Yes of course
still error
appwrite.exception.AppwriteException: User (role: guests) missing scope (collections.write)
Could you please copypaste here the entire code?
And remove your endpoint domain if it's not a localhost address
from appwrite.services.databases import Databases
client = Client()
(client .set_endpoint("https/455/rg")
.set_project("efsbsf864sefse"))
databases = Databases(client)
databases.create_collection(database_id="efseff45",collection_id="453534drg",name="WAW")```
I’m assuming you’ve redacted the endpoint address here?
And you don’t seem to be setting your API key?
I think the issue is that the user is trying to perform the creation client side and it needs to be server side since it's a collection and not a document
Yep
Let me check
@pseudo pilotAre you doing this in flutter or in an Appwrite function?
Function
It’s Python - there’s no Client SDK