Back

Help Needed with Appwrite Teams API - Invalid Email Address Error

  • 0
  • Teams
  • Web
  • Cloud
Binyamin
7 Jun, 2023, 16:20

Also, what version of Appwrite you're using?

TL;DR
The user is seeking help with an "Invalid Email Address" error while using the Appwrite Teams API. They discuss the issue of the "roles" parameter being required and the order of parameters in the documentation. The solution is to use the correct order of parameters in the code. They also mention a different signature for the "createMembership" function and provide code for it. Finally, they ask about the version of Appwrite being used.
anyuru
7 Jun, 2023, 16:20
anyuru
7 Jun, 2023, 16:20

There

anyuru
7 Jun, 2023, 16:20

The latest version

anyuru
7 Jun, 2023, 16:20

I'm working with the cloud

Binyamin
7 Jun, 2023, 16:21

And last the createTeamMebership code?

anyuru
7 Jun, 2023, 16:22
anyuru
7 Jun, 2023, 16:22

It's there

Binyamin
7 Jun, 2023, 16:29

It's interesting but the createMemebership has a different signature then the one you see online. https://github.com/appwrite/sdk-for-node/blob/master/lib/services/teams.js#L231

Try this in your code

TypeScript
const membership = await teams.createMembership(
  teamID,
  roles,
  redirectUrl,
  userEmail
);
Binyamin
7 Jun, 2023, 16:29

Because the order is different you've sent the redirectUrl as email and it wasn't an email.

anyuru
7 Jun, 2023, 16:29

Alright

anyuru
7 Jun, 2023, 16:32

It works fine. Thanks

anyuru
7 Jun, 2023, 16:33

I don't even know how I missed that.

Binyamin
7 Jun, 2023, 16:33

<:appwritefire:823999000330895380>

Binyamin
7 Jun, 2023, 16:33

It's not on you The order on the docs aren't clear (correct)

anyuru
7 Jun, 2023, 16:34

Yeah. But it's kind of the norm that optional parameters come after the mandatory ones.

Binyamin
7 Jun, 2023, 16:35

I think it meant to be to other langauges that you can choose and have named parameters.

anyuru
7 Jun, 2023, 16:36

That's right

Nimit Savant
7 Jun, 2023, 16:37

roles should be above though

Nimit Savant
7 Jun, 2023, 16:37

if its a required param

Binyamin
7 Jun, 2023, 16:38

Ohh., sure also this Agreed.

Binyamin
7 Jun, 2023, 16:51
Drake
7 Jun, 2023, 23:35

I'm actually surprised roles is required πŸ˜…

Binyamin
7 Jun, 2023, 23:36

πŸ˜‚ So maybe the issue will get an upvote from you.

Binyamin
8 Jun, 2023, 00:05

πŸ‘

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