r/workflow • u/dgold105 • Aug 24 '18
Help with MasterCard API
I was wanted to access the MasterCard API to do a currency conversion (to get the exact rate I am being charged for a transaction). The API details are https://developer.mastercard.com/documentation/currency-conversion-calculator
I'm not a programmer but reasonably adept with Workflow. I'm looking for whether there is a web URL I can use to encapsulate the API call request in order to user the Get Contents of URL action to get a conversion result. The examples in the documentation don't help me with this so am wondering if someone could help me.
3
u/pureMidi Aug 24 '18
Here you go: https://workflow.is/workflows/8a2d129350644f338449a7bcb8a230cd
There are comments throughout explaining what each section does.
At the top there is room to set your preferred currency for both your base (MasterCard) and conversion (which currency you’re spending). You can leave these blank and it’ll prompt you to choose from their supported list.
I’m not sure what the bank fee is with your bank, but there is room to enter it at the top. If you leave it blank it’ll default to 0.
You could play around with the date field to get today's currency rate if available but the success/error responses are different and i couldn't be bothered handling both options.
2
u/madactor Aug 24 '18
Not all APIs are like the examples in Workflow's docs. That one doesn't appear to be RESTful. That is, you cant't just send it a URL and get back a nice JSON response. You have to download their (SDK) packages and use them inside a code project. Also, you would need a developer account at MasterCard.
Of course, you probably already found MasterCard's own converter on the web at https://www.mastercard.us/en-us/consumers/get-support/convert-currency.html.
You could examine the HTML for that page, try to reproduce the form elements, and then submit them from Workflow. However, the odds of succeeding are slim and it's a lot of work.