ABSTRACT


creating authorization and establishing that the integration is connected.


TABLE OF CONTENTS 

1. Connection

   a) Authorization

   b) Get Connected

   c) Extra Error Handling


Connection


Authorization


Depending on your integration and your research depends on the steps in the next part which is ensuring the integration can allow a connection to happen.


For this example we will take a look at BigCommerce as an example.


First we will set up some variables in this case for authentication.


1: Go to Interface(Folder)-->MetaData.cs(File).


2: Go to the function named GetPresets().




This area will change depending on your integration but for the purpose or current use case these variables are required for authentication to make a basic API call to a system.


BigCommerce Example has requirements for Four variables (store URL path, Store Hash, Client ID, Token which could be used for authentication based on the user setup.


There is a similar function found in the file Settings.cs.



Settings.cs is not a function but more of a model for global variables that the end user is empowered to provide via the UI the needed information based on differences such as in the BigCommerce example with user store hashes. Useful for when information needed must come from each user rather than be a one-off variable for every API call. 


All variables placed in Settings.cs must be in the function GetPresets() in MetaData.cs.


So for our example in this Settings.cs and GetPresets() BigCommerce requires information that needs to be given from each user as it is unique to each of them.



With the appropriate variables in your Settings.cs file and/or in your GetPresets() function we should have enough information to create a connection.


NOTE:Settings.cs is for things that should appear in the IPaaS.com UI and is to empower the user to input the data themselves.


SUB-NOTE: this info can be input in your DevelopmentUtility in the appsettings.json in the collection named system_settings.


 

NOTE: GetPresets() is a part of MetaData.cs which is a sort of dossier of your integration in this case you are declaring the information needed to authenticate and establish a connection.


Get Connected


Go to Interface(Folder)-->CallWrapper.cs(File) as CallWrapper.cs must be changed to actually connect.


 

Inside of the file CallWrapper.cs is the function EstablishConnection().

 

 

This function has a couple of things to be worked with.

 

 

GREEN

This is a basic RestSharp Request to the 3rd party API via a light call (in this case it is server time) though for your 3rd party system another endpoint may need to be selected. The important part it that the endpoint must have some form of authentication.

 

RED

this space pertains to the error handling for if the RestSharp request does not go through to catch any errors.

 

BLUE

if all works well the "_connected" variable is set from its default and the connection is considered to be established. if not IPaaS.com will only show a connection error which is why the part in RED is created to give better error catching to provide more specific information.


 Extra Error Handling


Connection.cs and APICall.cs don't need to be touched or at least is recommended.

 

the only part present that could be of some use with the connection of the 3rd party API is present in APICall.cs.



 

In this function HandleResponse() while already with some error handling present in the established connection this can be of aid should any other special handling wish to be added to help diagnose the integration with responses from the connection.