POST login/users/login
(Difference between revisions)
(→Response Status) |
Renato.neves (Talk | contribs) (→Response Status) |
||
Line 46: | Line 46: | ||
! align="left" width="200px" | forbidden (403) | ! align="left" width="200px" | forbidden (403) | ||
| The sign in could not be performed. See the table below for detailed error information. | | The sign in could not be performed. See the table below for detailed error information. | ||
+ | |- | ||
+ | ! align="left" width="200px" | forbidden (404) | ||
+ | | The email_address or username was not found for this login app. | ||
|- | |- | ||
! align="left" width="200px" | internal_server_error (500) | ! align="left" width="200px" | internal_server_error (500) |
Revision as of 14:23, 4 June 2018
Contents |
Description
Creates a sign in for an user given its password and username or e-mail. The user must set a password in order to login.
Resource URL
POST https://api.socialidnow.com/v1/marketing/login/users/login
Parameters
JSON Parameters
username 1 | optional | username. |
---|---|---|
email_address 1 | optional | user e-mail. |
password | required | user password. |
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
created (201) | The sign in was created successfully. |
---|---|
bad_request (400) | Some required parameter was not informed. |
unauthorized (401) | The authentication is wrong. See Authentication. |
forbidden (403) | The sign in could not be performed. See the table below for detailed error information. |
forbidden (404) | The email_address or username was not found for this login app. |
internal_server_error (500) | An unknown error happened. |
If the user login fails with forbidden (403) status, one of the following status codes will be set in the response body:
Code | Description |
---|---|
active | The user was manually deactivated. See PUT_login/users/:user_id/activate and PUT_login/users/:user_id/deactivate. |
confirmed | The user email is not confirmed yet. See POST_login/users/send_email_confirmation. |
locked | The user is locked due to too many login attempt with an incorrect password. See Login App Security Settings. |
invalid_password | The combination of username/password or email/password is incorrect. |
Examples
Using username and password
Request
curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/login' \ -d '{ "username": "john_doe", "password": "john_doe_secret" }' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 201 Created Location: https://api.socialidnow.com/v1/marketing/login/sign_ins/9678 Status: 201
Response Body
{ "connection":"https://api.socialidnow.com/v1/marketing/login/connections/f6a13b09cf19ce1b9eaf849d59f220250210b5c44c10c71033d253de8b61ed9b", "connection_id":"f6a13b09cf19ce1b9eaf849d59f220250210b5c44c10c71033d253de8b61ed9b", "login_token":"658cd5300e49d2834ffab3c3c9103b71a5075a9cda4621df56b4d59cffbaec08", "user_id":341 }
Using email_address and password
Request
curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/login' \ -d '{ "email_address": "john_doe@domain.com", "password": "john_doe_secret" }' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 201 Created Location: https://api.socialidnow.com/v1/marketing/login/sign_ins/9678 Status: 201
Response Body
{ "connection":"https://api.socialidnow.com/v1/marketing/login/connections/f6a13b09cf19ce1b9eaf849d59f220250210b5c44c10c71033d253de8b61ed9b", "connection_id":"f6a13b09cf19ce1b9eaf849d59f220250210b5c44c10c71033d253de8b61ed9b", "login_token":"658cd5300e49d2834ffab3c3c9103b71a5075a9cda4621df56b4d59cffbaec08", "user_id":341 }