wtfast Keys API
keyservice.KeyService Class Reference

Defines methods for managing wtfast keys. More...

Inheritance diagram for keyservice.KeyService:

Public Member Functions

bool Authenticate (string login, string password, out string sessionToken)
 Authenticate seller and start API session. More...
 
void Logout (string sessionToken)
 Logout the seller and close API session. More...
 
string BuyKey (string sessionToken, int membershipId, int computers, KeyTimeUnit timeUnit, int timeAmount, KeyType type, bool master, int masterLimit, bool activate)
 Buy a new inactive key with the specified parameters. More...
 
string [] BuyKeyBulk (string sessionToken, int membershipId, int computers, KeyTimeUnit timeUnit, int timeAmount, KeyType type, bool master, int masterLimit, bool activate, int numberOfKeys)
 Buy multiple new keys with the specified parameters. More...
 
void ActivateKey (string sessionToken, string keyId)
 Activate the key to be available for user. More...
 
void DeactivateKey (string sessionToken, string keyId)
 Deactivates an active key. More...
 
KeyInfo [] GetAllKeys (string sessionToken)
 Returns the list of all keys associated with the given seller's account. More...
 
KeyInfo [] GetKeys (string sessionToken, int? year, int? month, KeyState? state, KeyOrder? sortOrder, OrderDir? sortDir, int start, int perPage)
 Returns the list of keys associated with the given seller's account filtered and ordered according to the given parameters. More...
 
KeyInfo [] GetKeysByDate (string sessionToken, int? year, int? month, KeyState? state, KeyOrder? sortOrder, OrderDir? sortDir, DateTime createdAfter, int start, int perPage)
 Returns the list of keys associated with the given seller's account filtered and ordered according to the given parameters. More...
 
int GetKeysCount (string sessionToken, int? year, int? month, KeyState? state)
 Returns number of keys associated with the given seller's account filtered according to the given parameters. More...
 
KeyInfo GetKey (string sessionToken, string keyId)
 Returns information about a single key. More...
 
PriceInfo GetKeyPriceInfo (string sessionToken, int membershipId, int computers, KeyTimeUnit timeUnit, int timeAmount, KeyType type)
 Returns key pricing information for given key parameters. More...
 
SellerInfo GetSellerInfo (string sessionToken)
 Returns information about seller's account. More...
 
MembershipInfo [] GetMembershipTypes (string sessionToken, bool all)
 Returns list of available membership types. More...
 
int GetKeyUseInfoCount (string sessionToken, string keyId)
 Returns number of users who used given key. This information is only relevant to master keys. More...
 
UseInfo [] GetKeyUseInfo (string sessionToken, string keyId, int start, int perPage)
 Returns information about users who used given key. More...
 

Detailed Description

Defines methods for managing wtfast keys.

Version 1.2

Member Function Documentation

◆ ActivateKey()

void keyservice.KeyService.ActivateKey ( string  sessionToken,
string  keyId 
)

Activate the key to be available for user.

Call this method after you sell the key to the end-user.

SOAP example

Parameters
sessionTokensession token
keyIdkey identifier

◆ Authenticate()

bool keyservice.KeyService.Authenticate ( string  login,
string  password,
out string  sessionToken 
)

Authenticate seller and start API session.

Call this method before calling any other method in this class.

Supply your login and password as input parameters and the method will return a session token for use during the session. Supply the returned session token as the first argument for each of the remaining methods.

SOAP example

Parameters
loginseller login
passwordseller password
sessionTokensession token
Returns
true if authentication is successful

◆ BuyKey()

string keyservice.KeyService.BuyKey ( string  sessionToken,
int  membershipId,
int  computers,
KeyTimeUnit  timeUnit,
int  timeAmount,
KeyType  type,
bool  master,
int  masterLimit,
bool  activate 
)

Buy a new inactive key with the specified parameters.

The key will be added to the seller's account and the seller's credit will be decreased by the value of the key price.

To get PriceInfo for specific key parameter configuration call GetKeyPriceInfo method.

SOAP example

Parameters
sessionTokensession token
membershipIdmembership id - the only supported id value is 3. See GetMembershipTypes to obtain detailed information
computersnumber of computers. Must be between 1 and 100.
timeUnitunit of the key duration - Day or Month - see KeyTimeUnit
timeAmountnumber of time units of the key duration. If time unit is month, the only valid amount values are 1, 2, 3, 6, 12
typetype of key - see KeyType
mastertrue to buy master key. Master keys can be used by more then one user.
masterLimitmaximum number of users for master key. This value is ignored for non-master keys.
activatetrue if the key should be activated
Returns
key identifier of the new key
Exceptions
SoapExceptionif membership id is invalid
SoapExceptionif computers is outside the valid range
SoapExceptionif time unit is month and time amount is not one of 1, 2, 3, 6, 12
SoapExceptionif a KeyType.Subscription is requested and seller does not have subscription keys enabled
SoapExceptionif a master is set to true and seller does not have master keys enabled
SoapExceptionif seller does not have sufficient credit

◆ BuyKeyBulk()

string [] keyservice.KeyService.BuyKeyBulk ( string  sessionToken,
int  membershipId,
int  computers,
KeyTimeUnit  timeUnit,
int  timeAmount,
KeyType  type,
bool  master,
int  masterLimit,
bool  activate,
int  numberOfKeys 
)

Buy multiple new keys with the specified parameters.

To get PriceInfo for specific key parameter configuration call GetKeyPriceInfo method.

The keys will be added to the seller's account and the seller's credit will be decreased by the value of the keys price.

This method allows to create keys which are already activated.

SOAP example

Parameters
sessionTokensession token
membershipIdmembership id - the only supported id value is 3. See GetMembershipTypes to obtain detailed information
computersnumber of computers. Must be between 1 and 100.
timeUnitunit of the key duration - Day or Month - see KeyTimeUnit
timeAmountnumber of time units of the key duration. If time unit is month, the only valid amount values are 1, 2, 3, 6, 12
typetype of key - see KeyType
mastertrue to buy master key. Master keys can be used by more then one user.
masterLimitmaximum number of users for master key. This value is ignored for non-master keys.
activatetrue if the key should be activated
numberOfKeysnumber of keys to buy - must be between 1 and 50.0000
Exceptions
SoapExceptionif membership id is invalid
SoapExceptionif computers is outside the valid range
SoapExceptionif time unit is month and time amount is not one of 1, 2, 3, 6, 12
SoapExceptionif numberOfKeys is invalid
SoapExceptionif a KeyType.Subscription is requested and seller does not have subscription keys enabled
SoapExceptionif a master is set to true and seller does not have master keys enabled
SoapExceptionif seller does not have sufficient credit

◆ DeactivateKey()

void keyservice.KeyService.DeactivateKey ( string  sessionToken,
string  keyId 
)

Deactivates an active key.

This a utility method and should be used only in legitimate cases. Once a key is deactivated, the user's subscription is also canceled and no further use of given key is possible.

SOAP example

Parameters
sessionTokensession token
keyIdkey identifier

◆ GetAllKeys()

KeyInfo [] keyservice.KeyService.GetAllKeys ( string  sessionToken)

Returns the list of all keys associated with the given seller's account.

This methods does not support paging. If you have large number of keys, use GetKeys instead.

SOAP example

Parameters
sessionTokensession token

◆ GetKey()

KeyInfo keyservice.KeyService.GetKey ( string  sessionToken,
string  keyId 
)

Returns information about a single key.

SOAP example

Parameters
sessionTokensession token
keyIdkey identifier

◆ GetKeyPriceInfo()

PriceInfo keyservice.KeyService.GetKeyPriceInfo ( string  sessionToken,
int  membershipId,
int  computers,
KeyTimeUnit  timeUnit,
int  timeAmount,
KeyType  type 
)

Returns key pricing information for given key parameters.

SOAP example

Parameters
sessionTokensession token
membershipIdmembership id - the only supported id value is 3. See GetMembershipTypes to obtain detailed information
computersnumber of computers. Must be between 1 and 100.
timeUnitunit of the key duration - day or month - see KeyTimeUnit
timeAmountnumber of time units of the key duration. If time unit is month, the only valid amount values are 1, 2, 3, 6, 12
typetype of key - see KeyType
Exceptions
SoapExceptionif membership id is invalid
SoapExceptionif computers is outside the valid range
SoapExceptionif time unit is month and time amount is not one of 1, 2, 3, 6, 12
SoapExceptionif a KeyType.Subscription is requested and seller does noot have subscription keys enabled

◆ GetKeys()

KeyInfo [] keyservice.KeyService.GetKeys ( string  sessionToken,
int?  year,
int?  month,
KeyState state,
KeyOrder sortOrder,
OrderDir sortDir,
int  start,
int  perPage 
)

Returns the list of keys associated with the given seller's account filtered and ordered according to the given parameters.

In case of filtering by year and/or month, the date used for filtering depends on the value of the state parameter:

  • If state is null or is Inactive, the creation date is being used for filtering
  • if state is Active - the date of activation is used
  • if state is Used - the date of actual use by the customer is used

SOAP example

Parameters
sessionTokensession token
statefilter by given state of key
yearfilter by year
monthfilter by month
sortOrdersort order by attribute
sortDirsort direction
startoffset of the first record to retrieve
perPagenumber of keys to retrieve, or use 0 to return all keys

◆ GetKeysByDate()

KeyInfo [] keyservice.KeyService.GetKeysByDate ( string  sessionToken,
int?  year,
int?  month,
KeyState state,
KeyOrder sortOrder,
OrderDir sortDir,
DateTime  createdAfter,
int  start,
int  perPage 
)

Returns the list of keys associated with the given seller's account filtered and ordered according to the given parameters.

In case of filtering by year and/or month, the date used for filtering depends on the value of the state parameter:

  • If state is null or is Inactive, the creation date is being used for filtering
  • if state is Active - the date of activation is used
  • if state is Used - the date of actual use by the customer is used

SOAP example

Parameters
sessionTokensession token
statefilter by given state of key
yearfilter by year
monthfilter by month
sortOrdersort order by attribute
sortDirsort direction
createdAfterfilter only keys created after this date (UTC)
startoffset of the first record to retrieve
perPagenumber of keys to retrieve, or use 0 to return all keys

◆ GetKeysCount()

int keyservice.KeyService.GetKeysCount ( string  sessionToken,
int?  year,
int?  month,
KeyState state 
)

Returns number of keys associated with the given seller's account filtered according to the given parameters.

In case of filtering by year and/or month, the date used for filtering depends on the value of the state parameter:

  • If state is null or is Inactive, the creation date is being used for filtering
  • if state is Active - the date of activation is used
  • if state is Used - the date of actual use by the customer is used

SOAP example

Parameters
sessionTokensession token
yearfilter by year
monthfilter by month
statefilter by given state of key

◆ GetKeyUseInfo()

UseInfo [] keyservice.KeyService.GetKeyUseInfo ( string  sessionToken,
string  keyId,
int  start,
int  perPage 
)

Returns information about users who used given key.

SOAP example

Parameters
sessionTokensession token
keyIdkey identifier
startoffset of the first record to retrieve
perPagenumber of uses to retrieve, or use 0 to return all users

◆ GetKeyUseInfoCount()

int keyservice.KeyService.GetKeyUseInfoCount ( string  sessionToken,
string  keyId 
)

Returns number of users who used given key. This information is only relevant to master keys.

SOAP example

Parameters
sessionTokensession token
keyIdkey identifier

◆ GetMembershipTypes()

MembershipInfo [] keyservice.KeyService.GetMembershipTypes ( string  sessionToken,
bool  all 
)

Returns list of available membership types.

SOAP example

Parameters
sessionTokensession token
allif true - returns all defined memberships, otherwise returns only available memberships

◆ GetSellerInfo()

SellerInfo keyservice.KeyService.GetSellerInfo ( string  sessionToken)

Returns information about seller's account.

SOAP example

Parameters
sessionTokensession token

◆ Logout()

void keyservice.KeyService.Logout ( string  sessionToken)

Logout the seller and close API session.

SOAP example

Parameters
sessionTokensession token