Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Wed 7 Oct 2020

Custom Domino Extensions in a Modern AppDev World



Tue 22 Sep 2020

Exciton Boost - Barbarians are at the gate



Thu 17 Sep 2020

Exciton Boost - WYSI(hopefully)WYG


October, 2020
SMTWTFS
    01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Search the weblog





























Genii Weblog

REST Revisited

Tue 18 Aug 2020, 02:28 PM



by Ben Langhinrichs
 
Inline JPEG image
 
Last week in my post, Quick primer on JSON-RPC, I promised to post videos showing some features of our new Exciton Boost, due out this month. My tendency is to focus on the whiz-bang, but with APIs, some of the most important things are those that appear simple. With that in mind, my first video is on the REST API that is included with Exciton Boost. The REST API features a lot of power packed in a simple package. As you might expect from our products, high fidelity rendering and round-trip abilities stand out, but so do smaller, less showy aspects.
 
Since most of this happens under the covers, keep these in mind while you watch the video:
  • JSON parser allows single document (object) processing and discarding to minimize memory overhead. Not an issue with 25 small documents, but a huge issue with a thousand documents using extensive rich content.
  • Filtered items allow you to retrieve only the items you need from an API that provides too much.
  • Renamed items allow you to map item names in the JSON object to different Notes item names.
 
And remember, it's always Beer O'Clock somewhere...
 
 
 
Code I used in the demo
 
Sub Initialize
   DimAs New NotesSession
   Dim http As NotesHTTPRequest
   Dim json_val As String
   Dim ret As String 
 
   ' *** Retrieve the Beer data from public REST API
   Set http = s.CreateHTTPRequest()
   http.PreferStrings = True
   json_val = CStr(http.get("https://api.punkapi.com/v2/beers"))
 
   ' *** Post the Beer data to Domino db
   Call http.Setheaderfield("Authorization", AUTHSTRING)
   Call http.Setheaderfield("X-Items-List""Name,Id,Description,food_pairing=Pairing,brewers_tips=Tips,tagline")
   ret = http.post("http://localhost/BeerOClock.nsf/api/boost/documents", json_val)
   Print ret
End Sub
 

Copyright 2020 Genii Software Ltd.

What has been said:

No documents found

Have your say:

Name *:
E-mail:
e-mail addresses will not be displayed on this site
Comment *:


<HTML is not allowed>
Linking: Add links as {{http://xxx|title}}, and they will be activated once approved
Blocked? Unable to post a comment? Please read this for a possible explanation...