POST /_facebook_token

In this document

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:

NameTypeDescription
access_tokenstringUser access token
emailstringUser email address
remote_urlstringURL of remote server

Response


Status codes

Response headers

This response uses only standard HTTP headers.

Message body

The message body is a JSON document that contains the following objects:

NameTypeDescription
emailstringUser's email address
errorstringError message. The possible errors include:
  • invalid remote_url
  • invalid access_token
  • required fields: access_token, email, remote_url
okstringIndicates 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"
}