Forum Discussion

Anonymous0909's avatar
3 years ago

getting user id of the user whenever the email address of the user is entered

I want to get the user id of a user using the email address of the user. I want to use api v2 to return the user id of a particular user whenever the email address of that user is entered.
  • Parshant's avatar
    3 years ago

    Anonymous0909 , You can use API V1 to fetch user record based on there email id.

    Below is the API at the end you need to add actual {email} of the user, this will return the information of that user.

    https://community.lithium.com/restapi/vc/users/email/{email}

    <response status="success">
      <user type="user" href="/users/id/43">
        <registered type="boolean">false</registered>
        <id type="int">43</id>
        <deleted type="boolean">false</deleted>
        <email type="string">john.doe@example.com</email>
        <anonymous type="boolean">false</anonymous>
        <login type="string">john_doe</login>
        <sso_id type="string">johndoe47</sso_id>
        <registration_time type="date_time">2006-07-18T22:13:32+00:00</registration_time>
        <last_visit_time type="date_time">2006-08-12T11:14:04+00:00</last_visit_time>
        <average_message_rating type="float">4.6</average_message_rating>
        <average_rating type="float">3.9</average_rating>
        <profiles>
          <profile name="name_last" type="string">Doe</profile>
          <profile name="name_first" type="string">John</profile>
        </profiles>
        <banned type="boolean">false</banned>
      </user>
    </response>

    From the response you can get ID of the user.

    <id type="int">43</id>