GET login/users/find by
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | == 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 === | ||
+ | |||
+ | {| | ||
+ | ! align="left" width="200px" | username <sup>1</sup> | ||
+ | | width="200px" | optional | ||
+ | | username. | ||
+ | |- | ||
+ | ! align="left" width="200px" | email_address <sup>1</sup> | ||
+ | | width="200px" | optional | ||
+ | | user e-mail address. | ||
+ | |} | ||
+ | |||
+ | <sup>1</sup> 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 ==== | ||
+ | {| | ||
+ | ! align="left" width="200px" | ok (200) | ||
+ | | The user was found successfully. | ||
+ | |- | ||
+ | ! align="left" width="200px" | bad_request (400) | ||
+ | | Some required parameter was not informed. | ||
+ | |- | ||
+ | ! align="left" width="200px" | unauthorized (401) | ||
+ | | The authentication is wrong. See [[Authentication]]. | ||
+ | |- | ||
+ | ! align="left" width="200px" | not_found (404) | ||
+ | | The user was not found. | ||
+ | |- | ||
+ | ! align="left" width="200px" | internal_server_error (500) | ||
+ | | An unknown error happened. | ||
+ | |} | ||
+ | |||
+ | == 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", | ||
+ | } |
Revision as of 03:35, 4 November 2014
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. |
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", }