Location
/api/apps/{appID}/users/{userID}/facebook/link
This resource allows to link the accessed user with
a
Facebook account.
Request Headers (Applies to all methods)
Authorization
header
Required: Yes
POST
/api/apps/{appID}/users/{userID}/facebook/link
Description
Link the accessed user with Facebook.
Security
Only the administrator and the user himself can access this method.
Content-Type application/vnd.kii.LinkFacebookRequest+json
The needed data to link the user. application/json can be used as content-type for the compatibility.
Name
Required?
type
Description
Authorization
Yes
string
Authorization header. OAuth2 Bearer token
Name
Required?
Type
Description
accessToken
Yes
string
The access token from Facebook
Sample Request
{
"accessToken": "[string]"
}
Responses
204
Content-Type (None)
The user has been linked with the Facebook account
successfully.
Note
This response has no contents.
404
Content-Type application/vnd.kii.UserNotFoundException+json
The user was not found.
Contents
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
401
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Not authorized to link the user.
Contents
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |
409
Content-Type application/vnd.kii.FacebookUserAlreadyLinkedException+json
The user was already linked with a facebook account.
Contents
Name | Type | Description |
---|---|---|
errorCode | string | Error code "FACEBOOK_USER_ALREADY_LINKED". |
message | string | The error message. |
facebookID | string | The facebook ID of the user. |