Public
Documentation Settings

LabKey V2

Complete documentation of examples for LabKey api

Once the Authorize call has been made and the authentication Token has been received, it is necessary to insert it in the header of subsequent calls.
- id_panel: Postman variable useful to form the URL for all calls.
- secret_key: Postman variable, code referred to your IP address, can be found in the API / Settings section of your LabKey panel
- Bearer: Postman variable, the result is saved once the Authorize call is made.
- unique_name: Postman variable, unique name of the LabKey.
AUTHORIZATIONBearer Token
Token

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

USERS

APIS RELATED TO USERS

AUTHORIZATIONBearer Token
This folder is using Bearer Token from collectionLabKey V2

PUTAddUser

https://demo.manage.labkey.io/api/v2/adduser?email=demo@labkey.io&phone=12345678900&prefix=%2b39&name=Jon&surname=Doe&tags[]=MyTag1&tags[]=MyTag2

Create new users (example with all possible accepted parameters)

Mandatory parameters:

  • Name (user name)

  • Surname (user surname)

Optional parameters:

  • Email

  • Phone

  • Prefix (N.B. the encoded national prefix must be entered, e.g. +39 +39 )

  • Tags (N.B. each comma will be replaced with an undersocre, can be an array)

  • status: the user is enable, 0 the user is disable

  • fields: is an array of additionals fields, each cell has an array [id:value] where id is the id of the additional field and the value is the value.

Response

  • 200 OK

    • user_id

    • pinpad_key_code

    • pinpad_key_id

  • 400 Bad Request

    • email already exists

    • invalid email format, retry

    • phone number must be long from 6 to 30 digits

    • prefix must contain +

    • prefix not valid

    • phone number already exist

    • name can't be empty

    • surname can't be empty

AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionLabKey V2
PARAMS
email

demo@labkey.io

Email (optional)

phone

12345678900

Phone (optional)

prefix

%2b39

Phone prefix (mandatory if phone is set)

name

Jon

Name (mandatory)

surname

Doe

Surname (mandatory)

tags[]

MyTag1

Tag (optional)

tags[]

MyTag2

Tag (optional)

status

0

1 the user is enable, 0 the user is disable

fields

[ [id:value],[id:value] ]

Example Request
curl
curl --location --request PUT 'https://demo.manage.labkey.io/api/v2/adduser?email=demo%40labkey.io&phone=123456789&prefix=%252b39&name=Jon&surname=Doe'
200 OK
Example Response
json
{
  "status": "OK",
  "message": {
    "user_id": 1,
    "pinpad_key_code": 759291,
    "pinpad_key_id": 17,
    "barcode": "+39123456789.759291.136.3133331455982337"
  }
}
Server

nginx

Date

Fri, 16 Jun 2023 08:19:27 GMT

Content-Type

application/json

Transfer-Encoding

chunked

Connection

keep-alive

X-Powered-By

PHP/7.2.15

Cache-Control

private, must-revalidate

pragma

no-cache

expires

-1

X-RateLimit-Limit

1000

X-RateLimit-Remaining

1000

PUTUpdateUser

https://demo.manage.labkey.io/api/v2/updateuser?user_id=1&email=michael@labkey.io&phone=987654321&prefix=%2b39&name=Michael&surname=Jackson

Update a user's data.

Mandatory parameters:

  • User Id (N.B.: user_id to update)

  • Name

  • Surname

Optional parameters:

  • Email

  • Phone

  • Prefix (N.B. for the phone the same rule applies to the adduser national prefix, for more info see AddUser)

  • tags

  • status: the user is enable, 0 the user is disable

  • fields: is an array of additionals fields, each cell has an array [id:value] where id is the id of the additional field and the value is the value

Response

  • 200 OK

    • user updated successfully
  • 400 Bad Request

    • user_id does not exists

    • invalid email format

    • prefix must contain +

    • prefix not valid

    • phone number must be numeric, retry

    • phone number must be long from 6 to 30 digits

    • Name is mandatory

    • Surname is mandatory

AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionLabKey V2
PARAMS
user_id

1

Update user_id (mandatory)

email

michael@labkey.io

Email (optional)

phone

987654321

Phone (optional)

prefix

%2b39

Phone prefix (mandatory if phone is set)

name

Michael

Name (mandatory)

surname

Jackson

Surname (mandatory)

tags[]

tag1

Tag (optional)

status

1

0 or 1 (optional)

fields

[ [id:value],[id:value] ]

(optional)

Example Request
curl
curl --location --request PUT 'https://demo.manage.labkey.io/api/v2/updateuser?user_id=1&email=michael%40labkey.io&phone=987654321&prefix=%252b39&name=Michael&surname=Jackson'
200 OK
Example Response
json
{
  "status": "OK",
  "message": "user updated successfully"
}
Server

nginx

Date

Fri, 16 Jun 2023 08:37:37 GMT

Content-Type

application/json

Transfer-Encoding

chunked

Connection

keep-alive

X-Powered-By

PHP/7.2.15

Cache-Control

private, must-revalidate

pragma

no-cache

expires

-1

X-RateLimit-Limit

1000

X-RateLimit-Remaining

1000