Can't get to add a user to a team with the following error.
Here is my code
let membership = teams
.createMembership(teamId, teamRole, email, undefined, undefined, URL, fullName)
.then((response) => {
console.log('Team Membership', response);
return response;
})
.catch((error) => {
console.error(error);
throw error;
});
I have also tried using the browser directly with https://cloud.appwrite.io/v1/teams/teamId but i still get the error
{
"message": "Team with the requested ID could not be found.",
"code": 404,
"type": "team_not_found",
"version": "1.5.6"
}
Have you confirmed that the team ID is correct?
And the current user has the owner role in the team?
Verify the 'teamId' variable to ensure it contains the correct ID. Have you double checked Api endpoint?Check Permissions To access and modify team memberships.
yes, Iam using the ID which i copied when the team was created
yes i created the team
for the permissions i get a different error with Unauthorized .. i had already confirmed that
Please call account.get() before the create membership call and share the response of account.get() from the browser dev tools network log.
Please also share the request info like url and headers from the browser dev tools network log for the create membership call.
Lastly, please share the members of the team from the appwrite console
This is the response of account.get()
{
"$id": "#",
"$createdAt": "2024-05-28T10:36:42.817+00:00",
"$updatedAt": "2024-05-28T10:36:42.817+00:00",
"userId": "#",
"expire": "2024-05-28T11:36:42.808+00:00",
"provider": "email",
"providerUid": "hobbit@mailinator.com",
"providerAccessToken": "",
"providerAccessTokenExpiry": "",
"providerRefreshToken": "",
"ip": "41.212.114.64",
"osCode": "WIN",
"osName": "Windows",
"osVersion": "10",
"clientType": "browser",
"clientCode": "PS",
"clientName": "Microsoft Edge",
"clientVersion": "125.0",
"clientEngine": "Blink",
"clientEngineVersion": "125.0.0.0",
"deviceName": "desktop",
"deviceBrand": "",
"deviceModel": "",
"countryCode": "ke",
"countryName": "Kenya",
"current": true,
"mfaUpdatedAt": ""
}
This isn't the response of account.get(). This is the session....but this was called right before the create membership call? What's the userId?
For the create membership, I see
https://cloud.appwrite.io/v1/teams/highway_hospital_team/memberships
But I don't see the project set so you may not have called client.setProject()
Deleting since there's a cookie. You might want to log out to kill your session cookies
Recommended threads
- Console down yet again ?
Seeing it stuck on the "loading" screen yet again ... second time today. (last time 10+ hours ago). 'roles' and 'plan' requests just hung. Meanwhile, appwrit...
- Fulltext index creation fails due to Inn...
I'm running a self-hosted Appwrite 1.8.1 instance and encountering an issue when creating fulltext indexes on a collection. **The Problem:** Fulltext index cre...
- Function Building show 500 Error
Region: sfo Temple: Starter Function Runtime: Nodejs 22 What happened? Before 2 minutes it show ‘server error.","code":500,"version":"0.7.24"}’ after it show c...