Service |
public string CreateToken( CreateTokenIn request )
Note |
---|
A token return string will live for about 2 hours once created. After that the token will expire and a new one will need to be created. This method is very lightweight and can be called before each request if needed to ensure a token is never stale, however it is recommend that you try to reuse the generated token in your work-flow if possible. |
Caution |
---|
It is recommend to always validate a token via the GetToken(GetTokenIn) method before sending a request. Sending in an invalid token will result in an error. |
Note |
---|
Using the GetToken(GetTokenIn) method with the RENEW action is much quicker than calling a CreateToken(CreateTokenIn) method request. If you work with a large pool of web service requests its better to use the CreateToken method once for the initial creation process and then use a series GetToken RENEW calls to get your token. |
//SOAP EXAMPLE CALL //Create generic token wrapper method public string CreateToken() { string tokenKey; SoapService.CreateToken createToken = new SoapService.CreateToken { CustomerAlias = "MyCustomerAlias", UserName = "MyUserName", UserPass = "MyUserPass", SharedKey = "MyBrandSharedKey" }; SoapService.CreateTokenRequest request = new SoapService.CreateTokenRequest(createToken); using (SoapService.ServiceRouterClient client = new SoapService.ServiceRouterClient()) { SoapService.CreateTokenResponse response = client.CreateToken(request); tokenKey = response.CreateTokenResult; } return tokenKey; } var AuthToken = MyClass.CreateToken();