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
- database documents relationships
after migrating from 1.7.4 to 1.8, database get document and list documents is getting results but with no relationship values, the relationship attribute will...
- Failed to load data from database
My app broken, it throw AppwriteException exception. Few days ago it works well. AppwriteException: , ClientException with SocketException: Failed host lookup:...
- Getting CORS error when accessing websit...
When accessing my website I'm getting: (index):1 Access to font at 'https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2' from origin 'https://mvp-site-ra...