Jump to content
  • Meter Data Service API Mock for TIBCO Cloud? Integration

    Deepesh Tiwari

    Table of Contents


    Meter Data Service API Mock creation to get quickly a validation Service. This Service will be used by the Customer On-Boarding TIBCO Cloud? Live Apps Sample to validate Meter Data.

    API Spec

    The full Swagger is stored on Git Hub, and available for Import into your TIBCO Cloud? Account: https://github.com/JGrotex/TCIAPIspecSamples/blob/master/MeterService_1498804832664.json

    REST Service Request

    Allows to request a single Meter by Serial Number {sn}


    REST Service Response

    Returns a single Meter with Serial Number and Type (just an example, feel free to add more Details), in case the Meter is not found there is a specific Response (204) with no Data defined.


    Mock App creation

    To create the Mock App from the API Spec, just click in the List of API's on "..." (Table right) and the Context Menu allows you to Create the Mock App ...


    Advanced Response Definition

    Switch to Advanced Mock, to not always just get the same response from the Service Mock. 


    Script to copy, any maybe you like to extend it with some more different responses ...

     if(req.params.sn=="123") {      res.status = 204;   } else {     res.status = 200;      res.body = {sn:req.params.sn, type:"Energy"};   }    return res; 



    As a next step the Advanced Mock App can be tested using the Endpoint - View API URL



    Finally there are some Metrics and Logs available for the Mock App, but they are les important for testing.



    User Feedback

    Recommended Comments

    There are no comments to display.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Create New...