POST /_facebook_token
This request registers a Facebook Login user access token with Couchbase Lite. For information about access tokens, see Facebook Login access tokens.
Request
Request headers
This request does not have any required headers.
Query parameters
This request does not use query parameters.
Message body
The message body is a JSON document that contains the following objects:
| Name | Type | Description |
|---|---|---|
access_token | string | User access token |
email | string | User email address |
remote_url | string | URL of remote server |
Response
Status codes
- 200 OK – Request completed successfully
- 400 — Invalid parameter in HTTP query or JSON body
Response headers
This response uses only standard HTTP headers.
Message body
The message body is a JSON document that contains the following objects:
| Name | Type | Description |
|---|---|---|
email | string | User's email address |
error | string | Error message. The possible errors include:
|
ok | string | Indicates the request was successful and the user is registered |
Example
The following example registers the Facebook access token.
Request
POST /_facebook_token HTTP/1.1
Host: localhost:/59840
{
"access_token": "mytoken",
"email": "[email protected]",
"remote_url": "http://10.17.31.175"
}
Response
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: application/json
Date: Thu, 17 Apr 2014 00:21:33 GMT
Server: CouchbaseLite 1.495
Transfer-Encoding: chunked
{
"email" : "[email protected]",
"ok" : "registered"
}