Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Praveen P Prabhu
    Rest Connector API
    Topic posted May 14, 2018 by Praveen P PrabhuGreen Ribbon: 100+ Points, tagged API 
    251 Views, 1 Comment
    Title:
    Rest Connector API
    Summary:
    Rest Connector API
    Content:

    Hello,

     

    I need to pass url parameter to my rest connector, how can i pass the same.

    Currently i am using the below custom code

     

    let sdk = req.oracleMobile;

    sdk.connectors.ReceivePickSlip.post('', payload, {inType: 'json'}, {params:{'pickSlipNumber': pickSlipNumber}})

     

    it's a post request, its not the best design but OIC provided the URl which accepts pickSlipNumber as url param.

     

    Thanks

    Comment

     

    • Martin Jarvis

      Hi Praveen,

      Check out the documentation for this API here :
      https://docs.oracle.com/en/cloud/paas/mobile-suite/develop/calling-apis-custom-code.html#GUID-ECF6139B-67F6-4D8A-80AD-8877F82E5FEA

      The full function signature looks this and you will see that the API is based on the standard nodejs request:

      req.oracleMobile.<service>.<method>(required arguments, options, httpOptions)
      

      The httpOptions argument is like the Node.js http.request(options) argument. You use this argument to pass properties not covered by required arguments and options. For example, if you need to pass the timeout property to specify the number of milliseconds to wait for a request to respond before terminating the request, then you would pass it in httpOptions. Another example of when you use httpOptions is to pass query parameters to a connector. To learn more about http.request(options), go to the API documentation at https://github.com/mikeal/request and scroll down to the section entitled "request(options, callback)".

      I hope this helps, 

      Martin

      Oracle Mobile & Bots Product Managament