Skip to content

Gets geofence lists​

GET
/users/{userid}/geofenceLists

Authorizations​

ApiKeyAuth

API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See Authentication for more details.

Type
API Key (header: Authorization)
Example"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Parameters​

Path Parameters

userid*

User ID. 0 can be used for the current user

Type
integer
Required

Query Parameters

_limit

Limit for pagination, default 10, max 10000

Type
integer
_page

Page for pagination

Type
integer
_sort

Sort by this field

Type
string
_direction

Sort in this direction (asc, desc)

Type
string

Request example

Responses​

OK

application/json
JSON
{
  
"data": [
  
  
{
  
  
  
"color": "string",
  
  
  
"id": 0,
  
  
  
"name": "string",
  
  
  
"ownerId": 0
  
  
}
  
],
  
"limit": 0,
  
"page": 0,
  
"totalElements": 0,
  
"totalPages": 0
}
Try this endpoint

Playground​

Authorization
Variables
Key
Value

OpenAPI definition ​

References are expanded below, except recursive definitions and references with sibling fields. Documentation overrides are included. Full original OpenAPI spec (JSON).

View endpoint OpenAPI definition
yaml
info:
  title: Lightbug API
  version: '2'
externalDocs:
  description: ''
  url: ''
openapi: 3.1.0
servers:
  - url: https://api.lightbug.cloud/v2
security:
  - ApiKeyAuth: []
tags: []
paths:
  /users/{userid}/geofenceLists:
    get:
      parameters:
        - description: User ID. 0 can be used for the current user
          in: path
          name: userid
          required: true
          schema:
            type: integer
        - description: Limit for pagination, default 10, max 10000
          in: query
          name: _limit
          schema:
            type: integer
        - description: Page for pagination
          in: query
          name: _page
          schema:
            type: integer
        - description: Sort by this field
          in: query
          name: _sort
          schema:
            type: string
        - description: Sort in this direction (asc, desc)
          in: query
          name: _direction
          schema:
            type: string
      responses:
'200':
yaml
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: Paginated data
                    items:
                      properties:
                        color:
                          type: string
                        id:
                          type: integer
                        name:
                          type: string
                        ownerId:
                          type: integer
                      required:
                        - color
                        - name
                      type: object
                    type: array
                    uniqueItems: false
                  limit:
                    description: Requested elements per page
                    type: integer
                  page:
                    description: Requested page number
                    type: integer
                  totalElements:
                    description: Total elements in the database for given filters
                    type: integer
                  totalPages:
                    description: Total pages of elements given limit and filters
                    type: integer
                type: object
          description: OK
'400':
yaml
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: 400
                    type: integer
                  message:
                    example: status bad request
                    type: string
                type: object
          description: Bad Request
'401':
yaml
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: 400
                    type: integer
                  message:
                    example: status bad request
                    type: string
                type: object
          description: Unauthorized
'404':
yaml
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: 400
                    type: integer
                  message:
                    example: status bad request
                    type: string
                type: object
          description: Not Found
'429':
yaml
          content:
            application/json:
              schema:
                type: string
          description: Limit exceeded
          headers:
            X-Ratelimit-Limit:
              schema:
                type: integer
            X-Ratelimit-Remaining:
              schema:
                type: integer
            X-Ratelimit-Reset:
              schema:
                type: integer
yaml
      security:
        - ApiKeyAuth: []
      summary: Gets geofence lists
      tags:
        - geofencelists
      operationId: get-users-userid-geofenceLists
components:
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey
      description: API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See <a href='/apis/authentication'>Authentication</a> for more details.
      example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...