It appears that CurrencyCloud is using some kind of a ‘home-brewn’ OAuth scheme (e.g. one that does not follow the RFC6749) and this means we can’t use built-in Easymorph OAuth tools and have to construct some workaround to manage tokens manually. This would be somewhat inconvinient, but it can be done nevertheless.
The first way to do this, one that’s more suitable for server-side unsupervised execution, is to make separate ‘get token using credentials’ action and use this action output to set X-Auth-Token header in all subsequent CurrencyCloud calls. The downside of this approach is that you are getting a new token for each run, and CurrencyCloud appears to have strict rate limits for issuing new tokens.
Create Web Location data connector and set CurrcencyCloud base url
Add Web Request action to your project and select newly created Web Location connector, POST request method, input endpoint path (authenticate/api) and enter your login and key in Body section (don’t forget to select Form encoding):
You should get the resulting table with one column that contains a token you obtained as an authentication result. Now we need to pass this token to API actions, and to do this we create a module (in my example named Query_CurrnecyCloud) and create auth-token and endpoint parameters to be specified during module invocation.
In Query_CurrnecyCloud module, create similar Web request action with our Web Location connector, select endpoint parameter to be used as a Path and add new X-Auth-Token item in Headers section, and select auth-token module parameter to be used as this header value. Also, check Return response as action result in Response tab of Web Request action.
And, finally, we have our module ready to use. To call this module with parameters supplied by table values, append Iterate action in the main module right after our authentication actions, set up it to use our Query_CurrnecyCloud module and specify that auth-token parameter value should be taken from auth_token column, and endpoint parameter should be specified manually - that’s a name of CurrencyCloud API endpoint you want to call, in my example I set it to accounts/current to look at our authorized account properties.
The second way to do this, without iterations etcetera is to call authenticate/api manually, copy response auth_token value and save it to Web Location connector directly - to the headers section. And this should be done manually each time a token expires.
Finally, please, don’t post your credentials to the public I understand that this is only a sandbox account now, but just to be sure.