Web-based APIs

Everything else that doesn't fall into one of the other PB categories.
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Web-based APIs

Post by Oso »

I was wondering if other members have used PureBasic to develop software for interacting with APIs, such as writing a client. The term API seems to have become so common recently that it feels like everything must have an API.

The requirement I'm thinking about is that part of our work is based in UK. The UK government has introduced "Making Tax Digital for VAT", which requires accounting systems to be able to submit VAT information. Many of the accounting systems in UK now support this but some of us run legacy systems which don't. There are also what's called "bridging software" tools, which in many cases are nothing more than an add-in for MS Excel. These are for users who don't run an accounting system, or run a legacy system that can't submit the data. With those, it's a case of entering the 7 figures into Excel and then telling the bridging software which Excel cells contain the relevant figures. The submission is then made to the government service, which I presume is the API.

An example of one of the better applications is here, but to be honest they all seem quite bad quality, especially the Excel add-ins...

https://easymtdvat.com/mtd-software-for-excel
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Web-based APIs

Post by mk-soft »

Much data is transferred via 'https' and with 'xml' or 'json'. However, implementing these protocols is usually very time-consuming and must be constantly adapted.

If the data is transmitted with 'REST Web-API', then this is done with HTTPRequest (see PB help).
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Web-based APIs

Post by Marc56us »

You will find all informations (API, Documentation, Sandbox) for HMRC in
https://developer.service.hmrc.gov.uk/api-documentation
:wink:
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Web-based APIs

Post by Oso »

Thanks @mk-soft @Marc56us for the replies and the links. In that case I guess we can do it through HTTPRequest as you say.

For the REST JSON data or XML, I presume we need to handle that in our code. I don't think it's difficult. When I developed a Xamarin Android application for a different project, there was a JSON plug-in for Visual Studio as I recall, but it isn't a big deal to write it.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Web-based APIs

Post by Marc56us »

As usual in PB, all you need is in the box:
JSON lib, XML lib, and even regular expressions (sometime more easy for extract return datas)
:wink:
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Web-based APIs

Post by Oso »

Marc56us wrote: Fri Aug 19, 2022 8:12 pm As usual in PB, all you need is in the box:
Nice one, thanks for those. I should have gone back to look at the home page instead of searching through HTTP :-)
Post Reply