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
- Rate Limit of project
AppwriteException: Rate limit for the current endpoint has been exceeded. Please try again after some time. So , how much time I have to wait and why does it h...
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...