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

Function: userUsage

Overview

userUsage returns a list of boards that have been used by a user, and how much time the user has spent on each board.

Parameters

Input parameters:

  1. apiKey: Private API key issued by Limnu to developers.
  2. userId: The userId of the user you wish to examine, as issued by userCreate.

Response attribute details: users

boards contains all the boards that have been used by the user in the input parameters. 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. The data is structured like this:

"boards":{

"B_B7LyhbF2QGaCV4":{"connectionCount":2,"secondsUsed":3280},

"B_uh86rnYhQFOLuf":{"connectionCount":3,"secondsUsed":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":{"connectionCount":2,"secondsUsed":3280},

"B_uh86rnYhQFOLuf":{"connectionCount":3,"secondsUsed":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 userUsage from the command line:

curl \

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

--request POST \

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

--data @userUsage.json

 

The contents of the file named userUsage.json are:

{

"apiKey": "K_isR4E6qcQamY0NxFuKa9aw7k5hssRBQXuqpStgR1qU1A",

"userId": "U_8jksmRr4bqmjPl"

}