Skip to content
Home » News » 2017 News » RESTful APIs article and demo

RESTful APIs article and demo

  • by

Mike Peat is an advocate of RESTful APIs and to help explain the main benefits and advantages of why you should consider creating RESTful APIs for your business applications he has recently written a RESTful APIs article and demo.

RESTful api article image
Demo client for the service

The article ‘Why you should be creating RESTful APIs today‘ discusses the benefits of creating RESTful APIs and the importance and resulting long term success of creating your own web service APIs to allow other developers to access your systems. Note, This article follows on from How to Create RESTful JSON Web Services in DataFlex.

To support the article , Mike has built a RESTful web service for the DF19.0 WebOrder application which incorporates OAuth 2.0 authentication and a demo client for the service, using his DataFlex OAuth2 component. In addition, he has created a developer portal where you can register to create your own applications to access the service.

Full information about the service and the demo are in the post Putting it all together OAuth2 Secured DataFlex RESTful Service, from which the opening paragraphs are shown below

Taking the stuff I have been doing with DataFlex RESTful web services to a logical conclusion, I have built a RESTful web service for the DF19.0 WebOrder application (not too tricky in itself), but have also built OAuth 2.0 authentication into it, so it can only be accessed by valid users (actually held in the WebOrder_19 WebAppUser table).

The service itself is hosted on www.unicorninterglobal.com, but obviously (obvious to some) you can’t just access it there; trying something like https://www.unicorninterglobal.com/W…/Customer/List from a browser will just get you an error: {“code”:-32094,”message”:”Invalid Authorization Token”,”data”:””}, because you will not have presented a valid OAuth 2.0 token with your request. (For those who care, those tokens are JWTs – JSON Web Tokens – secured with an SHA256 HMAC signature… you may have noticed me posting elsewhere about having finally worked out how to do that.) Read more