PureConnect

 View Only

Discussion Thread View
  • 1.  Help configuring REST API

    Posted 05-21-2019 08:21
    I'm very new to RESTful APIs and I'm struggling to get the configuration correct in our Pureconnect environment.    I have exposed a very simple REST API in our development Outsystems environment.   The API has one input and one output, and the input is optional.

    In my handler if I do not pass the input I am successfully connecting and getting the default response back in the response body... but if I attempt to send the input in the URL the REST connection fails on the connection attempt.

    In my API I can change the input to be in header or URL... since the URL was failing I switched it to header, but I'm not entirely sure how to configure the handler to actually send the value in the header?   Obviously this is an extremely simple use case... what I really want is to end up creating a POST API and send a number of elements (I assume in the body) but I haven't even begun to figure out that part.... If anyone can point me toward a tutorial on how to configure this properly I would greatly appreciate it.   (or if I'm missing something obvious here that would be great too)


    #Handlers

    ------------------------------
    Josh Herron
    ------------------------------


  • 2.  RE: Help configuring REST API

    Posted 05-21-2019 09:38
    Are you using the other REST tools to create a JSON object from three lists (name, value, type) to then attach as the raw request body in your REST request?

    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 3.  RE: Help configuring REST API

    Posted 05-21-2019 09:53
    No, because for this initial test GET API there is no body.   The input parameters are only allowed to be in the URL or the Header.  Outsystems APIs only allow BODY parameters for POST methods.

    ------------------------------
    Josh Herron
    ------------------------------



  • 4.  RE: Help configuring REST API

    Posted 05-22-2019 03:31
    Edited by Avraham (Avi) Rozen 05-22-2019 03:39
    Hi

    we've been working successfuly with POST method using REST tool you've mentioned

    In POST request you have to fill up the "Raw request body"

    Never used it with GET .

    I advise you to use SOAPUI tool or other simulation tool outside the Genesys platform -to see how excately the request supposed to be like in order to work correctely. Once you have it working by outside tool -it will be easier to adjust Designer REST tool parameters

    By the way..your "Additional header" paramter is empty..(?)..if you need to define headers-this is the place..like ""Content-Type: text/xml;charset=UTF-8\r""

    ------------------------------
    Avraham (Avi) Rozen
    Harel
    ------------------------------



  • 5.  RE: Help configuring REST API

    Posted 05-22-2019 09:34
    I'd suspect a formatting issue.  If you turn the IP log up to notes on your IC server, you should see the full request URL which will help if you are just building the URL for your GET request.

    Along with what the other commenter has said, I'd recommend using the postman extension for chrome to test your API.  It's very easy to build queries in multiple formats for quick testing.  It can also save queries which can be helpful for quickly testing changes to your API.

    Lastly, if your URL looks good, you'll need to start looking at error logging/debugging on your API itself to see why it isn't handling the request.


    ------------------------------
    Aaron Lael
    State of Utah
    ------------------------------



  • 6.  RE: Help configuring REST API

    Posted 05-22-2019 09:41
    My employer has our laptops locked down pretty tightly... so I'm trying to get SOAPUI installed so I have a tool to test the web services with.   (that's on our approved list)   I will ask about Postman to see if it's white listed as well.

    Once I have that I will take another crack at it and see what's going on.

    ------------------------------
    Josh Herron
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources