Login with Twitter

HTTP MethodURLRequires Auth

POST

/api/v1/login

no

Body Parameters

KeyExample ValueDescription

serviceName*

twitter

The desired OAuth service name. In this case, twitter.

accessToken*

hash

Access token provided by Twitter OAuth.

accessTokenSecret*

hash

The access token secret provided by Twitter OAuth.

appSecret*

hash

The app secret provided by Twitter.

appId*

hash

The app ID provided by Twitter.

expiresIn*

200

Lifetime of token (in seconds).

Example Call - As JSON

curl -H "Content-type:application/json" \
      http://localhost:3000/api/v1/login \
      -d '{ 
            "serviceName": "twitter", 
            "accessToken": "hash", 
            "accessTokenSecret": "hash",
            "appSecret": "hash", 
            "appId": "hash", 
            "expiresIn": 200}'

Example Response

{
  "status": "success",
  "data": {
      "authToken": "9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq",
      "userId": "aobEdbYhXfu5hkeqG",
      "me": {
            "_id": "aYjNnig8BEAWeQzMh",
            "name": "Rocket Cat",
            "emails": [
                {
                  "address": "rocket.cat@rocket.chat",
                  "verified": false
                }
            ],
            "status": "offline",
            "statusConnection": "offline",
            "username": "rocket.cat",
            "utcOffset": -3,
            "active": true,
            "roles": [
                "admin"
            ],
            "settings": {
                "preferences": {}
              },
            "avatarUrl": "http://localhost:3000/avatar/test"
        }
   }
}

Change Log

VersionDescription

1.0.0

Added avatarUrl property to response

0.64.0

Added me property to response

0.63.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.