Token Server Packages#
Introduction#
The Token Server Packages are designed to accelerate your integration process. This documentation details how these packages provide efficient access to our Token Server API, enabling quicker deployment of our product within your applications.
- Token Server can:
Authenticate access to the Global Express Entry service
Securely conceal a license string so it is not exposed on a public-facing web page
Prevent sensitive information from being passed in plain text over a network where it could be observed by a third party
Click here to learn more about the Token Server Cloud API.
Licensing#
The License Key is a software key required to use the Cloud API. You will receive your license key from your Melissa representative. If you don’t have a license key, contact the Melissa sales team at Sales@Melissa.com or 800-MELISSA ext. 3 (800-635-4772 ext. 3). Without a license key, Token Server will not function.
Initialization#
There are two different constructors that you can utilize when initializing Token Server.
Initialize the Cloud API object with a license key
TokenServer tokenServer = new TokenServer(MELISSA_LICENSE_KEY);
token_server = TokenServer(MELISSA_LICENSE_KEY)
TokenServer()
Initialize the Cloud API object, which will read the license key from the environment variable MD_LICENSE or configured using a set method
Click here to learn more about setting up the environment variable.
TokenServer tokenServer = new TokenServer()
token_server = TokenServer()
Configuration#
Token Server supports GET requests.
(GET) Using one of three ways to configure each respective parameter
Requests#
GET#
To send a GET request, there are three ways you can configure the parameters to make a request.
Method 1: Using the Set Value Method to specify the parameter and value you want to set it to
Method 2: Using direct property access to set parameter values
Method 3: Using specialized Set Methods to set parameter values
Method 1: Using Set Value Method#
This function allows you to specify input parameters and the values you went to set them to.
Format
tokenServer.SetValue("Package", PACKAGE);
tokenServer.SetValue("Ip", IP);
tokenServer.SetValue("TimeSpan", TIME_SPAN);
token_server.set_value("package", PACKAGE);
token_server.set_value("ip", IP);
token_server.set_value("time_span", TIME_SPAN);
Example
tokenServer.SetValue("Package", "GlobalExpressEntry");
tokenServer.SetValue("Ip", "");
tokenServer.SetValue("TimeSpan", "0015");
token_server.set_value("package", "GlobalExpressEntry")
token_server.set_value("ip", "")
token_server.set_value("time_span", "0015")
Method 2: Using Direct Property Access#
This allows you to set values directly using the Cloud API’s parameter names.
Format
tokenServer.Package = PACKAGE;
tokenServer.IP = IP;
tokenServer.TimeSpan = TIME_SPAN;
token_server.package = PACKAGE
token_server.ip = IP
token_server.time_span = TIME_SPAN
Example
tokenServer.Package = "GlobalExpressEntry";
tokenServer.IP = "";
tokenServer.TimeSpan = "0015";
token_server.package = "GlobalExpressEntry"
token_server.ip = ""
token_server.time_span = "0015"
Method 3: Using Specialized Methods#
These functions allow you to set the input parameters for the Cloud API.
See Set Methods for a list of available parameters.
Format
tokenServer.SetPackage(PACKAGE);
tokenServer.SetIP(IP);
tokenServer.SetTimeSpan(TIME_SPAN);
token_server.set_package(PACKAGE)
token_server.set_ip(IP)
token_server.set_time_span(TIME_SPAN)
Example
tokenServer.SetPackage("GlobalExpressEntry");
tokenServer.SetIP("");
tokenServer.SetTimeSpan("0015");
token_server.set_package("GlobalExpressEntry")
token_server.set_ip("")
token_server.set_time_span("0015")
Response#
When submitting a request, you have the option to either get the response as a string or encapsulate the response into the respective Cloud API response object.
As a String#
Submit a GET or POST request and get the response as a string.
string response = tokenServer.Get<string>();
response = token_server.get(str)
As a Response Object#
Submit a GET request and encapsulate the response into the Cloud API response object.
TokenServerResponse responseObject = tokenServer.Get<TokenServerResponse>();
response = token_server.get(TokenServerResponse)
Accessing Values#
When encapsulating the response into the Cloud API’s respective response object, there are three ways to access values. The response object structure matches the respective Cloud API’s response format.
Click here to learn more about the Token Server response format.
The record responses are typically stored in a list. In the examples below, record represents an individual record at an arbitrary position within this list.
1. Using the Get Value Method:
Pass the field name as a string to the Get Value Method, and it will return the corresponding field value.
record.GetValue("RecordID");
record.GetValue("Results");
record.get_value("RecordID")
record.get_value("Results")
2. Accessing Properties directly
Values can be accessed directly using the response object’s field names.
record.RecordID;
record.Results;
record.record_id
record.results
3. Use Specialized Methods
Use get methods corresponding to field name to get the field value.
record.GetRecordID();
record.GetResults();
record.get_record_id()
record.get_results()
Methods#
The methods listed below pertain to the Token Server Cloud API object.
For methods related to the respective Cloud API’s response object click here.
Constructors#
These methods initialize and configure instances of the Cloud API object. Use these methods to create a new object, optionally providing initial values such as a license string to customize the instance during its creation.
Method |
Description |
|---|---|
|
Constructor to initialize the Token Server object. |
|
Constructor to initialize the TokenServer object with a license string. |
Method |
Description |
|---|---|
|
Constructor to initialize the Token Server object. |
|
Constructor to initialize the Token Server object with a license string. |
Set Methods#
These methods configure or modify parameters at the record level for the Cloud API object. Use these methods to make adjustments to the parameters during the execution of the Cloud API, ensuring flexibility in customizing API requests.
Method |
Description |
|---|---|
|
Set the base URL. |
|
Set the license string. |
|
Set the endpoint. |
|
Set the format. |
|
Set the IP. |
|
Set the package. |
|
Set the time span. |
|
Set the input parameter to a specified value. |
Method |
Description |
|---|---|
|
Set the base URL. |
|
Set the license string. |
|
Set the endpoint. |
|
Set the format. |
|
Set the IP. |
|
Set the address line 1. |
|
Set the time span. |
|
Set the input parameter to a specified value. |
Get Methods#
These methods retrieve parameter values from the Cloud API object. Use these methods to access the parameters configured for the Cloud API at the record level, providing insight into the current state of the object’s settings.
Method |
Description |
|---|---|
|
Get the base URL. |
|
Get the license string. |
|
Get the endpoint. |
|
Get the format. |
|
Get the IP. |
|
Get the Package. |
|
Get the time span. |
|
Get the value of an input parameter. |
Method |
Description |
|---|---|
|
Get the base URL. |
|
Get the license string. |
|
Get the endpoint. |
|
Get the format. |
|
Get the ip. |
|
Get the package. |
|
Get the time span. |
|
Get the value of an input parameter. |
Class Methods#
These methods perform service-level operations, handling the core processing and interactions for the Cloud API object. Use these methods to execute primary functionalities such as assembling records, clearing records, and making API requests.
Method |
Description |
|---|---|
|
Makes the synchronous GET request to the CloudAPI and returns the response (string or deserialized response object). |
|
Makes the asynchronous GET request to the CloudAPI and returns the response (string or deserialized response object). |
|
Makes synchronous getversion request and returns parsed Cloud API version. |
|
Makes asynchronous getversion request and returns parsed Cloud API version. |
Method |
Description |
|---|---|
|
Makes the synchronous GET request to the CloudAPI and returns the response (string or deserialized response object). |
|
Makes synchronous getversion request and returns parsed Cloud API version. |