Back to Users / JESS / JEA / JBODY API

User Check-in operation

User authentication and authorization for ENSIMS Web Service uses the JSON Web Tokens (JWT) mechanism. A JWT token has a limited lifespan, hence the Check-in operation can be performed before other transactions in order to check its validity and get a new token.


Authorization return object

A successful authorization return object contains the status flag, message, user's name, email address, and a new JWT, as shown in the example below.

    "ok": true,
    "status": "Session renewed successfully!",
    "jwt" : "Session key cookie",
    "user": "Yi",
    "role" : "user",
    "email": ""

Example using curl://

Assuming that you have logged on successfully and saved the session token to the cookies file using the log-on transaction, you can use the following to send the check-in command using cURL:

curl -b cookies -X POST

On successful check-in, an Auth return object with 'OK' status will be received with a new JWT. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be received.

Example using Python Requests

Make sure Requests is correctly installed in your Python environment, and run the following the lines:

import request

# Make a post request with the stored cookies from the log on transaction
r ='', cookies=cookies)

# Show the returned info

A successful operation will return the JSON content such as the following:

  "ok" : true,
  "status" : "Session renewed successfully!",
  "jwt" : "Session key cookie",
  "user" : "Yi",
  "role" : "user",
  "email" : ""