Back

cookies when working with python sdk

  • 0
  • React Native
ks
6 Mar, 2025, 19:01
TypeScript
from appwrite.client import Client
from appwrite.services.account import Account

project_id = os.getenv("PROJECT_ID")


client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1')  
client.set_project(project_id) 


account = Account(client)

email = "asd@gmail.com"  
password = "password123" 

session = account.create_email_password_session(email=email, password=password)
session_id = session['$id']  


client.set_session(session_id)

response = account.create_verification(
    url='https://example.com'  
)

print(response)

This doesnt work, even when I use correct credentials, I seem to recall that when working locally the sdk doesnt apply sessions and requires cookies?

Whats the correct method to make this work aside from using an API key, I keep getting User (role: guests) missing scope (account)

TL;DR
Issue: Error message "User (role: guests) missing scope (account)" when using the Python SDK to send a verification email. Solution: The error is due to missing permissions. Try setting the correct permissions for the user role. Also, when working locally, ensure that cookies are handled correctly.
ks
6 Mar, 2025, 19:02

that might not even be the right endpoint actually, trying to send a verification email to the user

ks
6 Mar, 2025, 19:44

An error occurred: User (role: guests) missing scope (account)

im using the python sdk, cant get it to work and searched for other users that asked this on the server here too

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more