4 Replies Latest reply on Jul 10, 2017 10:11 AM by iherreros RSS
    iherreros Newbie

    How can I put a JSON result from an API in a widget?

    Hi there,

     

    I am playing with Netbiter extension and I am trying to display the result in a widget. What I want to do is to display the data from a device connected to another cloud (Argos, Netbiter) either by pressing a button that calls the service and displays the data in a widget, or just program something that does that job if possible(and get the data out without pressing any button).

     

    This extension has already programmed the services so I tested them and what I get is a JSON code which is not suitable for widgets. So now I am trying to create a service that consumes the result from the other service and create an infotable with the data. I have read the articles https://community.thingworx.com/external-link.jspa?url=https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS179012… and https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS238970 and other discussions where you take a JSON file from a url, but I don't need to create the JSON text nor go to an url as I get the JSON result from a service.

     

    So is there any way to create a service that calls another service and converts the data from JSON to infotable so that I can put it in a widget?

     

    This is what I get when using the service getAllProjects, for example:

     

    This is what I get in the mashup just calling the netbiter extension service directly:

    I don't know whether I am following the right steps to reach my goal and I don't know much about JSON, so every help is very much appreciated.

     

    Many thanks in advance.