POST login/users/:user id/mac addresses
(Difference between revisions)
(→Response Status) |
|||
Line 46: | Line 46: | ||
! align="left" width="200px" | unauthorized (401) | ! align="left" width="200px" | unauthorized (401) | ||
| The authentication is wrong. See [[Authentication]]. | | The authentication is wrong. See [[Authentication]]. | ||
− | |||
− | |||
− | |||
|- | |- | ||
! align="left" width="200px" | forbidden (403) | ! align="left" width="200px" | forbidden (403) | ||
| The user does not belong to the Social Login App. | | The user does not belong to the Social Login App. | ||
+ | |- | ||
+ | ! align="left" width="200px" | unprocessable_entity (422) | ||
+ | | Validation error in the field "mac_address". | ||
|- | |- | ||
! align="left" width="200px" | internal_server_error (500) | ! align="left" width="200px" | internal_server_error (500) |
Revision as of 14:32, 23 May 2017
Contents |
Description
Creates a new mac address associated with an user.
Resource URL
POST https://api.socialidnow.com/v1/marketing/login/users/:user_id/mac_addresses
Parameters
URL Parameters
user_id | required | user identifier. |
---|
JSON Parameters
mac_address | required | mac_address formatted as a string with 6 pairs of hexadecimal numbers (uppercase or lowercase) joined by ":" or "-". |
---|
Authentication
This API requires Social Login App authentication. See Authentication.
Response
Response Status
created (201) | The mac address was created successfully and associated with the user. |
---|---|
ok (200) | The mac address had already been associated with the user. |
bad_request (400) | The parameter "mac_address" was not informed. |
unauthorized (401) | The authentication is wrong. See Authentication. |
forbidden (403) | The user does not belong to the Social Login App. |
unprocessable_entity (422) | Validation error in the field "mac_address". |
internal_server_error (500) | An unknown error happened. |
Examples
Request
Creates a new mac address with value "0a:1b:2c:3d:4e:5f" and associates it with the user "180".
curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/180/mac_addresses' \ -d '{"mac_address": "0a:1b:2c:3d:4e:5f" }' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 201 Created Status: 201