# RESTful Application Development Guide

# Session Manager

## Operations

Although a particular operator may choose to run an installation in a sessionless mode, by default Oracle Communications Services Gatekeeper requires that applications acquire a Oracle Communications Services Gatekeeper session before beginning to send request traffic. The RESTful Session Manager interfaces provide access to the Session Manager Web Service. Applications use the Session Manager interface to get a session ID. The application then adds this session ID to the header of all its requests. Oracle Communications Services Gatekeeper uses this value to keep track of all the traffic that an application sends for the duration of the session.

The RESTful Session Manager interfaces allow an application to get a session ID, to get the time remaining in a session’s lifetime, and to destroy a session.

Note: | An HTML version of this information is at `http://host:port/rest/session_manager/index.html` where host and port depend on the Oracle Communications Services Gatekeeper installation.

### Get Session

Creates a session with an ID. This ID is used in the `X-Session-ID` header of all subsequent traffic requests.

#### Request

##### URI

`http://host:port/rest/session_manager/sessions`

##### HTTP Method

POST

#### Response

##### Body

`{"getSessionReturn": "String"}`

The session ID, a string

#### Error Response

General Exception

### Get Session Remaining Lifetime

Gets the time remaining in this session, in milliseconds.

#### Request

##### URI

`http://host:port/rest/session_manager/session/${sessionId}`

${sessionId}: The session ID, a string

##### HTTP Method

GET

#### Response

##### Body

`{"getSessionRemainingLifeTimeReturn": "Integer"}`

The remaining time, in milliseconds, an integer.

#### Error Response

General Exception

### Destroy a Session

Destroys this session.

#### Request

##### URI

`http://host:port/rest/session_manager/session/${sessionId}`

${sessionId}: The session ID, a string

##### HTTP Method

DELETE

#### Response

##### Body

{"destroySessionReturn": "Boolean"}

A boolean, true if the session was destroyed

#### Error Response

General Exception

## Errors

### General Exception

{"error":{

"type":"com.bea.wsdl.wlcp.wlng.session_manager.service.GeneralException"

"message":"String"

}}