BPM, Workflow, and Case

 View Only

Integration using BPMRestRequest

  • 1.  Integration using BPMRestRequest

    Posted Wed March 22, 2023 11:27 AM

    So let's say you want to integrate with ODM or really any other service but you need to use the JSAPI of BPMRESTREQUEST but it's just not working. 

    The first thing to make sure (especially in dev) is to set your server with PUBLICINTERNETSSLSETTINGS. This preconfigured ruleset will make your life easier and should allow most integrations to go through without headache from a server communication perspective.

    Then when you try sending your payload, something's not quite working . Is it request.parameters, request.<YOUROBJECT>, request.body. Kind of a combination of those. HTTP Requests generally expect the payload in the body attribute, but our JS Object of the BPMRestRequest needs the parameter in request.parameter.

    // Prepare REST request
    var request = new BPMRESTRequest()
    request.externalServiceName = "helloWorld_API_new"
    request.operationName = "callhelloWorldDecisionServiceOperation"
    // Request Headers
    request.httpHeaders = {
      "Content-Type": "application/json",
      "Authorization": "ZenApiKey <APIKEY>"
    }
    var bodyParams = {'name':"Zach"}
    request.parameters = {"body":bodyParams};
    // Make Request
    var bpmRes = tw.system.invokeREST(request)
    tw.local.res = JSON.stringify(bpmRes);


    ------------------------------
    ZACHARY SILVERSTEIN
    ------------------------------