Previous Topic

Book Contents

Book Index

Next Topic

Logging In

Basically, the login has two phases, which correspond to the order the user is prompted to enter the data when logging in through GUI:

In the first phase (1), you aim to get the collection of clients corresponding to the given user. With this in mind, call the login method, passing the user name/password as parameters. If your authorization is correctly verified, login returns a collection of clients to which the given user is mapped. Here, you progress to the second phase – selecting the client (2).

Browse the ApiCollection of clients using item(int), which will return client by object number. If the collection holds just one client, then you can proceed directly to the third phase. Otherwise, you should choose (by the user’s selection), which client to get. Client holds, like any other object, a container of BOFields. Two of these BOFields, “clientId” and “description” are normally used for identification of clients. To learn how to browse BOFields, see BOFields.

When you hold the right client, you can proceed to the final phase (3) – call the login once again, passing the user name, password and the client as parameters. Having done that, login will return the Application object, which contains main functions for work with API.

See also Login Syntax.

Note: if your company uses domains, you muss also pass the correct domain as an additional parameter in both (1) and (3).

Help Image
Logging into API

  • Logging without domains

ApiLogin.login(UserName,UserPassword)

Returns a collection of all clients that are mapped to the given user.  The purpose of this method is to provide a unique identification and authentication of a user.

ApiLogin.login(UserLogin,UserPassword,ClientObj)

Returns the Application object. As an additional parameter, you pass the client object you get using login in the first step.

  • Logging into domains

ApiLogin.loginDomain(UserName,UserPassword,Domain)

Returns a collection of all clients that are mapped to the given user. The purpose of this method is to provides a unique identification and authentication of a user in a domain.

ApiLogin.loginDomain(UserName,UserPassword,Domain,ClientObj)

Returns the Application object. As an additional parameter, you pass the client object you get using login in the first step.

Note: If your VM uses domains and users attempt to log in without specifying theirs, the system will try to log them in as the first user with matching name it finds, regardless the domain. This practice will, of course, fail if there are more domains containing users with this id.

  • Getting Client ID

If you know the ID of the client the user belongs to beforehand, you can get the client directly and then call login (or loginDomain) only once. This is useful mainly for testing purposes

ApiLogin.getClient(clientId)

– returns client object by its ID.

Note: the ID always has 6 characters and therefore, if you have created a client with a shorter ID, you must now fill the rest of the string parameter with blanks.

See Also

Logging into Valuemation

Initialize login through GUI

Logging Out

Login Syntax

Domains