Hi Robin. The question may seem specific, but it’s really quite generic, so I’ll try to provide you some answers in general terms.
First, there isn’t enough known by us to know how the API works. Generally speaking most web API’s are either in something known as SOAP or something know as REST or RESTful. I don’t know if anyone has successfully gotten a Corona app working with a SOAP based system. The authentication requires a lot of encryption and such that’s difficult to accomplish. That doesn’t mean it’s possible, I’m just unaware of any one. SOAP is one of the least used setups. Most people are doing REST based API’s these days.
Corona works great with REST unless there is some really unorthodox authentication schemes. You would use the Corona network.request() API to make a call to your API using HTTP GET, POST, PUT, etc. methods and provide a listener function that will watch for errors as well as the returned data.
REST api’s generally return data in either XML or JSON format. Without knowing the API, I can’t speculate, but frequently they can return either based on the HTTP request you make to the API. How you control this will vary greatly from REST api to another. If you have the option to work with JSON data that will be the best since it’s data format is very similar to Lua tables. You don’t need to know JSON to use JSON. We offer a json.decode() API that you can pass a string of JSON formatted table to and you get a Lua table back and then you get direct access to the data. If you’re limited to XML, you will have to search the Internet for a Lua XML parser. We have one included in our Business App sample (https://github.com/coronalabs-samples/business-app-sample) that you can use as well, though we don’t have formal support for it. With XML you end up with a table too, but it has weird formats. XML allows a key to have both key-value pairs as well as the data with the XML tag such as:
<person age=30, height=72, weight=180, address = “101 East North Street”>John Smith</person>
instead of JSON’s simple key = value pairs. So let’s hope you have JSON as an option, it will make your life easier.
You can study another Corona sample app: CoronaWeather (https://github.com/coronalabs-samples/CoronaWeather) which uses a simple HTTP GET request to fetch weather data.
See: https://docs.coronalabs.com/api/library/network/request.html for usage on network.request().
Beyond this, any one helping you will need to know a lot more about the API, how you authenticate to it (looks like Basic HTTP authentication to me)
Rob