ASI/session

GET

Returns the current session, if any.

Access: Free

Returns:

200 Ok

Response example:

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

POST

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
app_name The application's name.
app_password The application's password.
username The user's username (optional).
password The user's password (optional).
proxy_ticket A CAS proxy ticket (optional).

Access: Free

Returns:

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

Response example:

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

DELETE

Ends the current session.

Returns:

200 Ok
 
Leave feedback:



Name (if you want):