10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/getty_up/api/create_session.rb', line 10
def create_session
request = {
:RequestHeader => {},
:CreateSessionRequestBody =>
{
:SystemId => @system_id,
:SystemPassword => @system_password,
:UserName => @api_username,
:UserPassword => @api_password
}
}
response = post_json(request, ENDPOINT)
@token = response["CreateSessionResult"]["Token"]
@status = response["ResponseHeader"]["Status"]
@secure_token = response["CreateSessionResult"]["SecureToken"]
@token_duration = response["CreateSessionResult"]["TokenDurationMinutes"]
@token_expiration = @token_duration.minutes.from_now
end
|