Skip to content
ahnl edited this page Aug 18, 2020 · 6 revisions

Login is fairly easy.

Step 1. Get SessionID

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": []
}

Step 2. Submit Login

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.

Example of an error response

Error response:

{
  "error": {
    "id": "example-1",
    "message": "Some weird error",
    "description": "Don't worry, this is an example ;-)",
    "whatnext": "",
    "statuscode": 403
  }
}
Clone this wiki locally