-
Notifications
You must be signed in to change notification settings - Fork 0
Login
ahnl edited this page Aug 18, 2020
·
6 revisions
Login is fairly easy.
First, do a GET request to https://<wilmaserver>/index_json
to get SessionId
:
{
"LoginResult": "Failed",
"SessionID": "<SESSIONID>",
"ApiVersion": 11,
"Workers": [],
"oidc_test_mode": false,
"oidc_providers": []
}
Secondly, do a POST request to https://<wilmaserver>/index_json
. This will log you into Wilma and give you a session cookie.
POST body (formdata):
-
Login
: Username -
Password
: Password -
SESSIONID
: SessionId you got earlier -
CompleteJson
: This key will force Wilma to give everything which is available in JSON format -
format
: Format for i.e. errors
Note that there aren't any results, so you'll have to follow redirects. You have to tell your HTTP client to disable following redirects.
If login fails (invalid password or username), you'll be redirected to:
https://<wilmaserver>/?loginfailed
.
If it succeeds, you'll be redirected to: https://<wilmaserver>/?checkcookie
.
You'll get cookie Wilma2SID
, your session. Save this cookie for future requests.
Error response:
{
"error": {
"id": "example-1",
"message": "Some weird error",
"description": "Don't worry, this is an example ;-)",
"whatnext": "",
"statuscode": 403
}
}