Accessing data from outside via API?

Viewing 1 reply thread
  • Author
    Posts
  • April 5, 2019 at 8:41 AM #34295

    Grischa Dallmer
    Participant

    Greetings,

    this is an advanced question.

    I have a complex database with events which I manually export in certain formats to publish them on three different websites.

    As I know JavaScript, I would like to somehow retrieve my data as JSON, so I can build web views and display the data according to my needs.

    My database is synced with IBM Cloudant.

    I saw in the Tap Forms documentation that there is a util called postJsonToUrl but I haven’t found any further documentation.

    Do I have to deal with the API of cloudant and complicated SQL requests to retrieve my data or can I use the TapForms API, create a JSON and access it from outside?

    Thanks in advance,

    Grischa

    April 5, 2019 at 11:07 AM #34299

    Brendan
    Keymaster

    Hi Grischa,

    You can do queries against the data stored at IBM Cloudant. They have a whole REST API for that. The nice thing about that is you don’t need Tap Forms running to do that.

    I do have AppleScript support in Tap Forms which would let you execute a Form Script from an AppleScript. But in testing it I just realized I broke it when I added Siri Shortcuts support on iOS. In order to provide Siri Shortcuts support I had to split my model objects into their own framework and there was a dependency that I commented out which I forgot to add back in which broke AppleScript support. I’ve just fixed it now actually.

    One option you might consider is using the Export Tap Forms Archive command if you need JSON output. That generates a .tfarc file which has all the data in it stored in a data.json file within the .tfarc file. That’s just a zip file with a renamed file extension. So you can rename it to .zip and then unzip it and you’ll see the data.json file within it. Now it would be up to you to get the data out of it that you need. Might not be easy though.

    Or if you write some JavaScript code to fetch records data, you can then format that as JSON within JavaScript and then use the Utils.postJsonToUrl(json_string, url); function. There’s not much to it. You just create a JSON string, provide it a URL, then call that function. It will return a dictionary of results. So your web service should return a dictionary for it to use. If you had your own web service you could use this to send it data from Tap Forms. I’m not sure what web application facilities you have available to you though, so I don’t know if this is feasible or not.

    Thanks,

    Brendan

Viewing 1 reply thread

You must be logged in to reply to this topic.