1. Home
  2. Limnu API
  3. Function: userActive

Function: userActive

Overview

userActive returns a list of boards that a user is currently connected to.

Parameters

Input parameters:

  1. apiKey: string - the private API key issued by Limnu to developers.
  2. userId: string - the id of the user you wish to examine, as issued by userCreate.

Response attribute details: users

boards contains all the boards that the user in the input parameters is currently connected to. Each board contains the number of times the user has connected to the board, along with the total number of seconds the user has spent connected to the board (ie: since the page was most recently loaded).

There may be a delay of a few seconds after a user disconnects from a board before the results of userActive is updated.

The data is structured like this:

"boards":{

"B_B7LyhbF2QGaCV4": {"seconds": 3280 },

"B_uh86rnYhQFOLuf": {"seconds": 3100 }

}

Example data

Example of correct JSON input:

{

"apiKey": "K_isR4E6qcQamY0NxFuKa9aw7k5hssRBQXuqpStgR1qU1A",

"userId": "U_8jksmRr4bqmjPl",

}

Example of JSON output from a successful call:

{

"success": true,

"boards":{

"B_B7LyhbF2QGaCV4": {"seconds": 3280 },

"B_uh86rnYhQFOLuf": {"seconds": 3100 }

}

}

Example of JSON output from a failed call:

{

"success": false,

"reason": "No such user: U_8jksmRr4bqmjPl"

}

Command Line Testing

Here’s an example of how to test userActive from the command line:

curl \

https://api.limnu.com/v1/userActive \

--request POST \

--header "Content-Type: application/json" \

--data @userActive.json

 

The contents of the file named userActive.json are:

{

"apiKey": "K_isR4E6qcQamY0NxFuKa9aw7k5hssRBQXuqpStgR1qU1A",

"userId": "U_8jksmRr4bqmjPl"

}