EdiFabric Serial Key

Article author
  • Updated

How to get and configure the serial key?

To use EDI Tools for .NET, you need a valid serial key. Once you order a plan from EdiFabric, follow the instructions in this article to create an account and get your serial key.

The serial key is used to access the Authentication API to acquire a token. It's up to the consumer to implement exception handling and retry logic.

The serial key is applied programmatically using the following code:

{ EdiFabric.SerialKey.Set("Valid Serial Key"); } catch(Exception ex) { // implement retry logic }

If you can't find your serial key or don't know how to apply it, contact us for assistance.

The token is valid for a couple of weeks, and a distributed cache can be implemented to save the token to a file, Redis, SQL Server, or any other store of your choice. To achieve that, two methods are available in EdiFabric.SerialKey - GetToken and SetToken. Internally, EdiFabric.SerialKey.Set does the following:

  if (EdiFabric.SerialKey.DaysToExpiration < 3)

An example implementation of a distributed file cache is available on GitHub.

The trial comes with a provisional serial key that is valid for 14 days: c417cb9dd9d54297a55c032a74c87996


How does the serial key work?

The same key can be used across all products with every EdiFabric plan - as the API key when accessing EdiNation or EdiNation InHouse and as the serial key when using EdiFabric EDI Tools.

When EdiFabric.SerialKey.Set is invoked, EdiFabric EDI Tools initiates an HTTP request to the authentication API to acquire a token. The serial key is used to authenticate the caller with the authentication API.

A call to the authentication API is made only when there is no token or the token has expired. No calls are initiated when EdiFabric.SerialKey.Set is invoked, and a valid token exists in memory.

The token is valid for several weeks, so if your application is constantly running, there will be no additional external calls until the token is valid. Alternatively, you can implement a distributed cache and only refresh the token several days before it is due to expire to avoid hard expiration.

Use the DaysToExpiration static property of EdiFabric.SerialKey to monitor when a token is due to expire.



What to do if there is no access to the Authentication API?

Ensure that external calls to the Authentication API are not blocked from your environment.

If setting firewall rules, the details of the Authentication API are:



We have prepared multiple servers for the authentication API shared between Microsoft Azure and Amazon AWS, so the servers going down altogether is highly unlikely. EdiFabric EDI Tools first calls the authentication API in Azure when acquiring a new token. If there is no response after the configured timeout/retries, the backup authentication API in AWS is called.

Implement a distributed cache for tokens and try to refresh them ahead of their expiration date. All EdiFabric.SerialKey methods require sufficient exception handling, and it's a good practice to implement a retry or compensation logic when acquiring a token from the Authentication API.

However, in the event that the authentication API is down across the primary and the backup instances or no token can be acquired at all, you need to contact us here or at, and we'll provide you with a temporary token that can be installed on your server(s) either as an environment variable or as a parameter to EdiFabric.SerialKey.SetToken.  This way EdiFabric will work in full offline mode until connectivity to the authentication API is restored.

We will also publish the temporary token on our Twitter, so contacting us there is also recommended.

Share this:

Was this article helpful?



Please sign in to leave a comment.