ASI/session

GET ^top

Returns the current session, if any.

Access

Free

Returns

  • 200

Response example


{
  "entry": {
    "app_id": "aNfxPwHXmr3PkIacr-fEfL",
    "user_id": "tmoCBomrl993MCurh"
  }
}
            

POST ^top

Starts a new session. Sessions can be associated either with an application only or with an application and a user.

To start a session without logging a user in, provide no username or password.

Using HTTPS for logging in is recommended.

When using CAS for logging in, expect possible response with 303 - See other. This happens when user has not logged in before using CAS and the credentials cannot be linked with existing ASI account. Response will contain a JSON with fields {"redirect" => {"message" => "Redirect to given uri.", "uri" => "http://cos.sizl.org/coreui/profile?guid=" }, where redirect will contain an URI with a guid. Extract redirect address from JSON's uri field and add to that uri two extra parameters: redirect and fallback. Redirect will be used in case of succesfull ASI account creation and linking with CAS credentials and fallback in case something goes wrong. New login with CAS is required after the operation.

Parameters

session
proxy_ticket

A CAS proxy ticket (optional).

app_name

The application's name.

username

The user's username (optional).

app_password

The application's password.

password

The user's password (optional).

Access

Free

Returns

  • 201 - Successfully logged in.
  • 303 - In case of CAS login further actions are required. See below.
  • 401 - Invalid login details.
  • 409 - A session already exists.

Response example


{
  "entry": {
    "app_id": "aNfxPwHXmr3PkIacr-fEfL",
    "user_id": "tmoCBomrl993MCurh"
  }
}
            

DELETE ^top

Ends the current session.

Returns

  • 200