GET login/users/find by
From Social ID Developers
(Difference between revisions)
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | Finds | + | Finds a user by username, e-mail or reset password token. |
== Resource URL == | == Resource URL == | ||
Line 19: | Line 19: | ||
| width="200px" | optional | | width="200px" | optional | ||
| user e-mail address. | | user e-mail address. | ||
+ | |- | ||
+ | ! align="left" width="200px" | reset_password_token <sup>1</sup> | ||
+ | | width="200px" | optional | ||
+ | | user reset password token. | ||
|} | |} | ||
Line 25: | Line 29: | ||
== Authentication == | == Authentication == | ||
− | This API requires | + | This API requires Login App authentication. See [[Authentication]]. |
== Response == | == Response == | ||
− | + | === Response Status === | |
{| | {| | ||
! align="left" width="200px" | ok (200) | ! align="left" width="200px" | ok (200) | ||
Line 45: | Line 49: | ||
! align="left" width="200px" | internal_server_error (500) | ! align="left" width="200px" | internal_server_error (500) | ||
| An unknown error happened. | | An unknown error happened. | ||
+ | |} | ||
+ | |||
+ | === Response Body === | ||
+ | |||
+ | The following fields are returned: | ||
+ | |||
+ | {| | ||
+ | ! align="left" width="200px" | id | ||
+ | | user identifier in the Social Login. | ||
+ | |- | ||
+ | ! align="left" width="200px" | signed_in_at | ||
+ | | date of user latest login. | ||
+ | |- | ||
+ | ! align="left" width="200px" | signed_up_at | ||
+ | | date of user creation. | ||
+ | |- | ||
+ | ! align="left" width="200px" | token | ||
+ | | user token. This token is used as user identifier in some Javascript APIs. See [[Social Login Tokens]] for more details. | ||
+ | |- | ||
+ | ! align="left" width="200px" | username | ||
+ | | username. Set by [[POST login/users]] and [[PUT login/users/:user_id]] apis. | ||
+ | |- | ||
+ | ! align="left" width="200px" | email_address | ||
+ | | email_address. Set by [[POST login/users]] and [[PUT login/users/:user_id]] apis. | ||
+ | |- | ||
+ | ! align="left" width="200px" | active | ||
+ | | boolean flag to inform whether the user is activated for login. Set by [[PUT login/users/:user_id/activate]] and [[PUT login/users/:user_id/deactivate]] apis. | ||
+ | |- | ||
+ | ! align="left" width="200px" | confirmed | ||
+ | | boolean flag to inform whether the user has confirmed his email address. See [[POST login/users/send_email_confirmation]] for instructions on how to add email address confirmation. | ||
|} | |} | ||
Line 53: | Line 87: | ||
==== Request ==== | ==== Request ==== | ||
− | curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?username= | + | curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?username=john_doe' \ |
-H 'Content-type: application/json' \ | -H 'Content-type: application/json' \ | ||
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | ||
Line 71: | Line 105: | ||
"signed_up_at": "2014-10-23T16:47:15Z", | "signed_up_at": "2014-10-23T16:47:15Z", | ||
"token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", | "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", | ||
+ | "username": "john_doe", | ||
+ | "email_address": "john_doe@domain.com", | ||
+ | "active": true, | ||
+ | "confirmed": true, | ||
+ | "locked": false | ||
} | } | ||
Line 77: | Line 116: | ||
==== Request ==== | ==== Request ==== | ||
− | curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?email_address= | + | curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?email_address=john_doe@domain.com' \ |
+ | -H 'Content-type: application/json' \ | ||
+ | --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | ||
+ | |||
+ | ==== Response ==== | ||
+ | |||
+ | ===== Response Headers ===== | ||
+ | |||
+ | HTTP/1.1 200 Ok | ||
+ | Status: 200 | ||
+ | |||
+ | ===== Response Body ===== | ||
+ | |||
+ | { | ||
+ | "id": 341, | ||
+ | "signed_in_at": "2014-10-24T08:13:51Z", | ||
+ | "signed_up_at": "2014-10-23T16:47:15Z", | ||
+ | "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", | ||
+ | "username": "john_doe", | ||
+ | "email_address": "john_doe@domain.com", | ||
+ | "active": true, | ||
+ | "confirmed": true, | ||
+ | "locked": false | ||
+ | } | ||
+ | |||
+ | === Using reset_password_token === | ||
+ | |||
+ | ==== Request ==== | ||
+ | |||
+ | curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?reset_password_token=1eba3avc9c3bf803411l8d9e630e1800cba7666a3ccc93c71b6d31c43779j2bf' \ | ||
-H 'Content-type: application/json' \ | -H 'Content-type: application/json' \ | ||
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | ||
Line 95: | Line 163: | ||
"signed_up_at": "2014-10-23T16:47:15Z", | "signed_up_at": "2014-10-23T16:47:15Z", | ||
"token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", | "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", | ||
+ | "username": "john_doe", | ||
+ | "email_address": "john_doe@domain.com", | ||
+ | "active": true, | ||
+ | "confirmed": true, | ||
+ | "locked": false | ||
} | } |
Latest revision as of 16:48, 30 December 2021
Contents |
Description
Finds a user by username, e-mail or reset password token.
Resource URL
GET https://api.socialidnow.com/v1/marketing/login/users/find_by
Parameters
URL Parameters
username 1 | optional | username. |
---|---|---|
email_address 1 | optional | user e-mail address. |
reset_password_token 1 | optional | user reset password token. |
1 At least one of these fields must be given to identify the user.
Authentication
This API requires Login App authentication. See Authentication.
Response
Response Status
ok (200) | The user was found successfully. |
---|---|
bad_request (400) | Some required parameter was not informed. |
unauthorized (401) | The authentication is wrong. See Authentication. |
not_found (404) | The user was not found. |
internal_server_error (500) | An unknown error happened. |
Response Body
The following fields are returned:
id | user identifier in the Social Login. |
---|---|
signed_in_at | date of user latest login. |
signed_up_at | date of user creation. |
token | user token. This token is used as user identifier in some Javascript APIs. See Social Login Tokens for more details. |
username | username. Set by POST login/users and PUT login/users/:user_id apis. |
email_address | email_address. Set by POST login/users and PUT login/users/:user_id apis. |
active | boolean flag to inform whether the user is activated for login. Set by PUT login/users/:user_id/activate and PUT login/users/:user_id/deactivate apis. |
confirmed | boolean flag to inform whether the user has confirmed his email address. See POST login/users/send_email_confirmation for instructions on how to add email address confirmation. |
Examples
Using username
Request
curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?username=john_doe' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 200 Ok Status: 200
Response Body
{ "id": 341, "signed_in_at": "2014-10-24T08:13:51Z", "signed_up_at": "2014-10-23T16:47:15Z", "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", "username": "john_doe", "email_address": "john_doe@domain.com", "active": true, "confirmed": true, "locked": false }
Using email_address
Request
curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?email_address=john_doe@domain.com' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 200 Ok Status: 200
Response Body
{ "id": 341, "signed_in_at": "2014-10-24T08:13:51Z", "signed_up_at": "2014-10-23T16:47:15Z", "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", "username": "john_doe", "email_address": "john_doe@domain.com", "active": true, "confirmed": true, "locked": false }
Using reset_password_token
Request
curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?reset_password_token=1eba3avc9c3bf803411l8d9e630e1800cba7666a3ccc93c71b6d31c43779j2bf' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 200 Ok Status: 200
Response Body
{ "id": 341, "signed_in_at": "2014-10-24T08:13:51Z", "signed_up_at": "2014-10-23T16:47:15Z", "token": "f83f40b5658970893f2dc8e9dcbe01527573fb304c441c21513ef0be29a25990", "username": "john_doe", "email_address": "john_doe@domain.com", "active": true, "confirmed": true, "locked": false }