GET login/users/find by
(Difference between revisions)
(→Response) |
|||
Line 29: | Line 29: | ||
== Response == | == Response == | ||
− | + | === Response Status === | |
{| | {| | ||
! align="left" width="200px" | ok (200) | ! align="left" width="200px" | ok (200) | ||
Line 45: | Line 45: | ||
! 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]] apis. | ||
+ | |- | ||
+ | ! align="left" width="200px" | email_address | ||
+ | | email_address. Set by [[POST login/users]] and [[PUT login/users]] 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. | ||
|} | |} | ||
Revision as of 17:19, 16 January 2015
Contents |
Description
Finds an user by username or e-mail.
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. |
1 At least one of these fields must be given to identify the user.
Authentication
This API requires Social 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 apis. |
email_address | email_address. Set by POST login/users and PUT login/users 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=new_user' \ -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", }
Using email_address
Request
curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/users/find_by?email_address=new_user@user_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", }