Token API.
The token API allows clients to generate tokens that are used to login to the Realview Viewer.
Realview will need to setup your publication to have access to this API.
You will need to provide all your IP addresses that you will use to request tokens.
You will need to let Realview know if you are using user (GetLoginKeyForUser) or anonymous logins (GetUniqueLoginKey, GetUniqueLoginKeys).
Realview will setup a subscription that will give access to the users. By default this will be full access to all issues in the viewer. If this is not what you want then please inform Realview of the access you require.
Once you have emailed [email protected] with your IP Addresses we will send you your clientkey.
The URL for the API is located at http://client.url/api/uniquekeyapi.asmx.asmx
The service description is located at http://client.url/api/uniquekeyapi.asmx?WSDL
All methods raise a soap exception if an error occurs. These will need to be handled by the client.
Methods
Method : GetUniqueLogonKey
This method generates a one-time token that will log a user in when placed on the query string. This is an anonymous login.
Parameter | Type | Description |
clientkey | String | This is a unique key for each publication that allows access to the token API. This will be supplied by Realview. |
Return Value. A token string is returned.
Method : GetUniqueLogonKeys
This method generates a batch of one-time tokens that will log a user in when placed on the query string. This is an anonymous login.
Parameter | Type | Description |
clientkey | String | This is a unique key for each publication that allows access to the token API. This will be supplied by Realview. |
keyCount | Int | The number of tokens to generate. 10000 is the maximum. |
keyExpiryHours | Int | The number of hours, from when the tokens are generated, the keys are valid for. 168 hours (7 days) is the maximum. |
Return Value. An array of token strings are returned.
Method: GetLogonKeyForUser
This method generates a token for the given user and publication. It creates a user in the Realview database so users can be tracked, use bookmarks etc.
Parameter | Type | Description |
clientkey | string | This is a unique key for each publication that allows access to the token API. This will be supplied by Realview. |
userid | String | This is the unique identifier for a user on the clients system. A user with this login will be created in the Realview database. |
Return Value. A token string is returned. The returned token is Url Encoded.
Examples
This example uses the VS2008 “Add Web Reference” to generate C# proxy classes for the webservice. wsdl2perl, wsdl2java should produce similar proxy classes for Perl and Java.
Request a one-time token for an anonymous login.
realview.tokenapi.uniquekeyapi tokenapi = new realview.tokenapi.uniquekeyapi();
string token = tokenapi.GetUniqueLogonKey("93AD2943-072F-4513-874A-221C5F12DD17");
This token is then used on the querystring to log the user in.
e.g http://your.url.com/?tlk=7dfffded3544ef0f484d2ebb4f489a09
Request a one-time token for a given user.
realview.tokenapi.uniquekeyapi tokenapi = new realview.tokenapi.uniquekeyapi();
string token = tokenapi.GetLogonKeyForUser("93AD2943-072F-4513-874A-221C5F12DD17", "myuser");
Both tokens returned can then be add to the query string in the viewer.
This token is then used on the querystring to log the user in.
e.g http://your.url.com/?utoken= DZP0yXw1BsT6jlu3EPvxjA%3d%3d
Request a batch of one-time tokens for an anonymous login.
realview.tokenapi.uniquekeyapi tokenapi = new realview.tokenapi.uniquekeyapi();
string [] token = tokenapi.GetUniqueLogonKeys("93AD2943-072F-4513-874A-221C5F12DD17", 1000, 168);
// store your tokens
// retrieve them when needed and use as follows.
This token is then used on the querystring to log the user in.
e.g http://your.url.com/?tlk=7dfffded3544ef0f484d2ebb4f489a09