Back

[SOLVED] Unable to fetch the UserID

  • 0
  • Android
  • Accounts
  • Users
Chirag_doosra
8 Jul, 2023, 10:53

I'm unable to fetch the user list. Currently I'm developing an Android app using Java and trying to implement the Phone Authentication using AppWrite. For the verification, I need to get the userID and so I was trying to use the User API but the io.appwrite.services.Users library isn't working. Also,

TypeScript
        .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
        .setProject("5df5acd0d48c2") // Your project ID
        .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key```
the ```.setkey()``` function is not getting called. Is there any updation in the function?
TL;DR
User is unable to fetch the UserID for phone verification using the AppWrite API. They are trying to use the User API but it is not working. They are also having trouble with the `.setKey()` function.
Chirag_doosra
8 Jul, 2023, 16:21

Can anyone assist me on how can I fetch the userID of an unverified phone number for phone verification?

Chirag_doosra
8 Jul, 2023, 16:22

Unable to fetch the UseID

Chirag_doosra
8 Jul, 2023, 16:23

Unable to fetch the UserID

Drake
8 Jul, 2023, 16:58

The Users service is not available in a client SDK. See the note about users API vs account API: https://appwrite.io/docs/server/users

Drake
8 Jul, 2023, 16:59

Why do you need to fetch the user id for phone verification?

Chirag_doosra
8 Jul, 2023, 17:14

To authenticate the number using the the secret code sent to number and the userID

Chirag_doosra
8 Jul, 2023, 17:14
Chirag_doosra
8 Jul, 2023, 17:15

Here you can see that the number is unverified

Chirag_doosra
8 Jul, 2023, 17:16

I need to pass the userID and the secret code. I'm able to pass the secret code but idk how to get the userId

Drake
8 Jul, 2023, 17:17

Oh interesting...

Drake
8 Jul, 2023, 17:18

After you log in, you can call account.get() to get the user details including the user id

Drake
8 Jul, 2023, 17:18

Also, the API call before this one that creates the phone verification returns a token object which has user id

Chirag_doosra
8 Jul, 2023, 17:21

so for login I need to use the "Create Phone Session" API right?

Chirag_doosra
8 Jul, 2023, 17:22

Which API are you talking about sir?

Chirag_doosra
8 Jul, 2023, 17:24

Okay! Got it

Chirag_doosra
8 Jul, 2023, 17:24

Thank you so much!

Drake
8 Jul, 2023, 17:26

[SOLVED] Unable to fetch the UserID

ROHIT KHANDEKAR
16 Aug, 2023, 10:04

TWILO

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