Login

post

/restapi/login

This API logs user in and returns a session cookie.

Request

There are no request parameters for this operation.

Back to Top

Response

200 Response

OK
Headers
Back to Top

Examples

Example of Accessing the API with cURL

The following example shows how to logs user in and returns a session cookie by submitting a POST request on the REST resource using cURL. If the request requires a timestamp, use the timestamp from the response of the /login API. For more information about cURL, see Use cURL.

curl -X POST \
    -c cookies.txt \
    -d@request.json \
    --header "Content-Type: application/json" https://$IPADDR/restapi/login

The following shows an example of the contents of the request.json file sent as the request body.

{ "login":
  { 
    "username":"talariuser",
    "password":"<talari password>"
  }
}

Example of the Response Headers

The following shows an example of the response headers.

HTTP/1.1 200 OK
Date: Wed, 09 Dec 2020 15:49:00 GMT
Server: Apache/2.4.6 () OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.40
Set-Cookie: CGISESSID=97c835c039b1d1e3eecd223b097ee04d80ce60aadda1abc70d858a1eb7ba2cc2; path=/; secure
Vary: Accept-Encoding
X-UA-Compatible: IE=Edge,chrome=1
Transfer-Encoding: chunked
Content-Type: application/json; charset=ISO-8859-1

Example of the Response Body

The following example shows the contents of the response body in JSON format.

{
  "status": "success",
  "user_level": 1,
  "user_level_str": "admin",
  "message": "Login Success - Created session for user talariuser - level: 1",
  "timestamp": "MTYwNzUyODk0MQ=="
}
Back to Top