Assure DQ

 View Only
  • 1.  Assure Controls trigger via Rest API

    Posted 12-14-2020 22:57

    I have layout Type External Service - Json2 Plugin defined which is able to pick up data when I run it from Infogix example Sample Java Client and when i run through other REST API Clients(soap UI, Insomnia) format it doesn't work and gives HTTP/1.1 500 Internal Server Error.

    I'm trying to figure out why it works with one and with other it doesn't?

    This one works:

    example9.ControlEntity=SA_API_Capture_CE
    example9.ControlPoint=Claims_API_Source_CP
    example9.WaitForResponse=true
    example9.TextDataItem={"auditPointName": "KafkaSV3","correlationId": "IL1^1R199^PR1^999^C"}

     

    Doesn't work:

    REST API:

    {
    "controlEntityName": "SA_API_Capture_CE",
    "controlPointName": "Claims_API_Source_CP",
    "waitForResponse": "true",
    "textDataItem": {"auditPointName": "KafkaSV3","correlationId": "IL1^1R19^PR1^999^C"}
    }

     

    Thanks!



  • 2.  RE: Assure Controls trigger via Rest API

    Employee
    Posted 12-15-2020 09:09

    The field textDataItem is parsed as a string server-side, so it's throwing an HTTP 500 since it was set as an object. The value set as textDataItem will need to be enclosed in double quotes, along with escaping the nested double quotes.

    An example of the control execution and results are below. Note that API executions that contain API data won't write a catalog, so the catalogId returned is expected to be null, along with no execution listed under Results by Control Point. The results will still be written into the control's data table.

    {
    "controlEntityName": "basicjsonce",
    "controlPointName": "basicjsoncp",
    "sourceTimestamp": "2020-12-15T14:00:00.001-05:00",
    "waitForResponse": "true",
    "timeout": 60000,
    "textDataItem": "{\"field1\":\"value3\",\"field2\":\"value4\"}"
    }



  • 3.  RE: Assure Controls trigger via Rest API

    Posted 12-15-2020 14:52

    Thanks for the response, get this error when i try escaping double quotes, 

    "error": {"messages": ["#UCAS017: The API request captured zero instances of control data."]}
    }

    are you using Assure Layout type External Service - Json2 Plugin? and Data Access Method as API Data?

    is there any Assure layout type that can capture textDataItem without using escaping double quotes? 

    {
    "controlEntityName": "SA_API_Capture_CE",
    "controlPointName": "basicjsoncp",
    "sourceTimestamp": "2020-12-15T14:00:00.001-05:00",
    "waitForResponse": "true",
    "timeout": "60000",
    "textDataItem": "{\"field1\":\"value5\",\"field2\":\"value6\"}"
    }

     

     

     



  • 4.  RE: Assure Controls trigger via Rest API

    Employee
    Posted 12-15-2020 15:05

    The UCAS017 refers to either the layout didn't find any fields in the input data that matched the layout's definitions or that the control didn't capture any data from the layout that matched the control's definitions. It did get further in processing this time around since it accepted the API and payload syntax instead of the HTTP 500.

    What do you have defined as the "location" for your layout's fields? These "locations" refer to the key value of the JSON data within textDataItem. For the textDataItem in both of our examples, the locations are field1 and field2. Within my layout, I named my fields the same value, but the Name value could differ from the Location:

    If the layout has the correct Location set for the fields, are the condition(s) within the control's capture met? These could vary greatly. I didn't add a condition; I set mine to "true" to capture all records. 

    To answer your other questions, yes, I'm using the Json2 plugin with API Data set as the Data Access Method. Escaping the double quotes comes from a JSON requirement of nested double quotes rather than a requirement specific to an Assure layout. 

     

     



  • 5.  RE: Assure Controls trigger via Rest API

    Posted 12-21-2020 14:54

    Thanks Gerard, it did work by having a separate Control Entity and fields as keys. I was using an existing CE and CE fields for json layout as non ID fields.