Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter Twenty-oneEDGARView Integration (continued)

EDGARSessionOpenSession Function

Overview

The EDGARSessionOpenSession function returns a handle to the current session or opens a new session if there is existing session with the same login CIK.

Syntax/Parameters

Syntax

handle = EDGARSessionOpenSession ( int type, [string cik, string password],
                              [string name] );

handle = EDGARSessionOpenSession ( int type, [string username, string password,
                              string totpsecret, string cik], [string name] );

Parameters

type

An optional int specifying whether to access the EDGAR System or the Online Forms System. The default is ES_CONNECT_MAIN but can also be set to ES_CONNECT_ONLINE_FORMS.

cik and password

An optional pair of string values to use as credentials to log into the EDGAR System. The maximum cik size is 10 characters and the password parameter 8 characters. Exceeding the size will result in a runtime error. The default values for the CIK/Password combination are retrieved from the application preferences or as overridden by project settings. If the parameters must be provided to set the name parameter, set the values to empty strings.

username, password, totpsecret and cik

An optional set of string values to use as credentials to log into the EDGAR System. The maximum size of the username and password parameters is 256 characters. The maximum size of the totpsecret parameter is 48 characters. The maximum cik size is 10 characters. Exceeding the size will result in a runtime error. The default values for the Username/Password/ToTPSecret and CIK combination are retrieved from the application preferences or as overridden by project settings. If the parameters must be provided to set the name parameter, set the values to empty strings.

name

An optional string to name the connection. The default value is “Legato Script”.

Return Value

Returns a handle to a session or NULL_HANDLE on failure. Use the GetLastError and GetLastErrorMessage functions to retrieve a formatted error code or textual error detail..

Remarks

Use of the filing features in no way abrogates the per workstation licensing requirements of application or its components. Use of the filing SDK functions serving commercial production services, web services or large scale filing is prohibited under the standard license agreement unless covered by a separate and specific license agreement.

Only one session can be open within the application at any time. If a session with the same login CIK is open, a handle to the existing session will be returned. If a session is not open, or the existing session CIK is different than the requested CIK, the existing session will be closed and a new session opened.

If a CIK and password is not provided (or are empty strings), the credentials in the application preferences will be employed. If a project is open with override preferences, the credentials may be in place.

Use caution on failed login attempts. The EDGAR System allows for a limited number of failed login attempts before temporally locking the account or permanently locking if too many lockouts occur.

The name parameter is used to display which particular tasks have a connection open to the EDGAR System in the application status bar.

Opening a session causes the API to perform the necessary web scraping to access the system and retrieve a Session ID. The Session ID must be added all subsequent HTTP requests to the EDGAR System. Use the EDGARSessionGetProperties function to retrieve the Session ID and verify the CIK used to authenticate the connection.

Should the login fail, the reason can be retrieved via the GetLastErrorMessage function. For example: “Login information is invalid”.

The EDGAR System employs various levels of security and continuing authentication. If the Session ID becomes invalid, a “Login Session Discontinued” or “Session discontinued. Try again in a few minutes” string will be returned on an HTTP request.

When done, the handle can be closed using the CloseHandle function, although the connection is not terminated on close. Avoid holding the session open since it will lock out other operations such as background mailbox updates. In addition, the session can time out from extended inactivity.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE