Cloverleaf API – SMATDB

Homepage Clovertech Forums Cloverleaf Cloverleaf API – SMATDB

  • Creator
    Topic
  • #118243
    Jonathan Souders
    Participant

    Anyone familiar with how this works? I’m trying to use the message search API call, but I have no idea what parameters I need to use for passing in the JSON – after I bit of finagling I was able to figure out the message API using the message ID, but this is not ideal for what I am tying to accomplish.

Viewing 2 reply threads
  • Author
    Replies
    • #118244
      Rob Abbott
      Keymaster

      Hey Jonathan, great you are exploring the API!

      Have you checked out the swagger pages?  They might help point you in the right direction.

       

      From your browser:

      https://localhost:15037/clapi/swagger-ui.html

      https://localhost:15037/clapi/swagger-ui.html#/smat-db-controller

      https://localhost:15037/clapi/swagger-ui.html#!/smat-db-controller/searchMessagesUsingPOST_1

       

      (replace localhost with your server’s hostname if you’re not right on it, and port number will vary with version)

       

      Rob Abbott
      Director, Product Management - Infor Cloverleaf

      • #118247
        Jonathan Souders
        Participant

        Yes – but unfortunately I can’t decipher what parameters I need to supply to the following JSON object for the call to be successful, even from the Swagger UI.

        Any way you can clarify what the needed string values are for the criteria, encodes, Files, etc. keys?

        {
        “criteria”: [
        {
        “itemName”: “string”,
        “operator”: “string”,
        “required”: true,
        “val1”: “string”,
        “val2”: “string”
        }
        ],
        “encodes”: {},
        “filePasswordMap”: {},
        “files”: [
        “string”
        ],
        “msgNumPerPage”: 0,
        “pageNum”: 0,
        “sort”: {
        “ascending”: true,
        “metaName”: “string”
        },
        “visiableMetaNames”: [
        “string”
        ]
        }

      • #118248
        Jonathan Souders
        Participant

        Update:

        I figured out most of the keys and can get response data now… but I still don’t know what string values to pass to the Criteria object. Any assistance is appreciated.

      • #118263
        Jonathan Souders
        Participant

        I opened a support ticket for this which has now been escalated to R&D as a defect. I’ll document the results here if/when I determine the solution.

      • #118268
        Rob Abbott
        Keymaster

        Hi Jonathan sorry I didn’t follow up here.  You did the right thing reaching out to support – we’ll also improve our documentation with anything that comes out of this case.

        Rob Abbott
        Director, Product Management - Infor Cloverleaf

      • #118275
        Jonathan Souders
        Participant

        Thanks Rob. Posting the results in a separate comment.

    • #118301
      Jonathan Souders
      Participant

      Finally ended up getting this working with the below syntax (I asked Infor to update their documentation because part of this criteria I needed to use is not mentioned anywhere in Swagger or in the Java classes I decompiled while troubleshooting).

       

      For message search (content of message):

      {
      “files”:
      [
      “$HCIROOT/<site_name>/exec/processes/<process_name>/<file_name>”
      ],
      “criteria”:
      [
      {“type”:”plain”,”itemName”:”MESSAGECONTENT”,”operator”:”regular expression”,”val1″:<search_text_or_regex_query>}
      ],
      “sort”:{“ascending”:”true”},
      “pageNum”:1,
      “msgNumPerPage”:10
      }

      For message search (metadata example):

      {
      “files”:
      [
      “$HCIROOT/<site_name>/exec/processes/<process_name>/<file_name>”
      ],
      “criteria”:
      [
      {“type”:”plain”,”itemName”:”MID”,”operator”:”==”,”val1″:<cloverleaf_mid_value>}
      ],
      “sort”:{“ascending”:”true”},
      “pageNum”:1,
      “msgNumPerPage”:10
      }

       

      For message resend (example of outbound thread message resend – most values can be pulled from the other CLAPI requests for SMAT):

      {
      “defaultEncoding”: “UTF-8”,
      “encoding”: “UTF-8”,
      “includeMeta”: “true”,
      “messageType”: “DATA”,
      “passwords”: {},
      “priority”: 5120,
      “resend_type”: “DATA”,
      “criteria”: [
      {
      “type”: “plain”,
      “itemName”: “MID”,
      “operator”: “==”,
      “val1”: <cloverleaf_mid_value>
      }
      ],
      “srcThreadName”: “<thread_name>”,
      “destThread”: “<thread_name>”,
      “metatdataDestThreads”: “<thread_name>”,
      “filename”: “<file_name>”,
      “files”: [
      “$HCIROOT/<site_name>/exec/processes/<process_name/<file_name>”
      ],
      “modifiedmessages”: [
      {
      “cloverMsgprofile”: {
      “mid”: “0.0.10648074”,
      “sendingTime”: 1608657356535,
      “fileRelativePath”: “/exec/processes/<process_name/<file_name>”,
      “marked”: false,
      “indexRecordOffset”: 0,
      “indexRecordLength”: 0,
      “modified”: false,
      “rowId”: “67”,
      “smatInfoVersion”: 258,
      “dispTimeFmtVersion”: 258,
      “offsetMap”: {},
      “filePath”: “$HCIROOT/<site_name>/exec/processes/<process_name/<thread_name>.smatdb”,
      “fileName”: “<file_name>”
      },
      “metadata”: {
      “TIMEXLT”: “1608657356534”,
      “STATE”: “14”,
      “PRIORITY”: “5120”,
      “SKIPXLT”: “0”,
      “TIMEIN”: “1608657356534”,
      “USERECOVERDB”: “3”,
      “SAVECONTEXT”: “outbound”,
      “DATAFMT”: “{RESEND_DEST <thread_name>} {RESEND_DEST <thread_name>}”,
      “SEPCHARS”: “”,
      “FLAGS”: “33286”,
      “TIMEQCUR”: “0”,
      “TYPE”: “DATA”,
      “SRCMID”: “<cloverleaf_mid_value>”,
      “RETRIES”: “0”,
      “DESTCONN”: “<thread_name>”,
      “ORIGDESTCONN”: “<thread_name>”,
      “GROUPID”: “0”,
      “TIMESTOR”: “0”,
      “XLTTHREAD”: “”,
      “TIMEQTOT”: “0”,
      “DBTABLE”: “”,
      “SOURCECONN”: “<thread_name>”,
      “ORIGSOURCECONN”: “<thread_name>”,
      “TIMEREC”: “1608657356534”,
      “TIMEOUT”: “1608657356534”,
      “DRIVERCTL”: “{CONNID 0} {IPVERSION 4} {CLIENTIP <client_ip_address>} {CLIENTPORT 54568} {_TRXID_ ORM_O01}”,
      “GROUPMID”: “”,
      “USERDATA”: “”,
      “TIMEARC”: “0”
      },
      “contentBase64String”: “<base64_message>”
      }
      ],
      “processName”: “<process_name”,
      “threadContext”: “ob_post_tps”
      }

    • #121233
      Shivam Gohel
      Participant

      Hi @Jonathan,

      Thank you for posting the dummy load. It’s impossible to figure this out from the documentation/SWAGGER UI. Though I was able to make the SMAT search work, I am still having a hard time figuring out the resend API.

      I want to resend a single message through resend API. Would I be able to do that?

      Here are the steps I am doing:
      1. Getting list of messages (base64 encoded strings) from retrieve API.

      2. Copying and pasting one of the messages metadata to resend.

      Note that I don’t want to resend complete SMAT. I just want to send a single message which I am passing through base64 encoded string parameter.

      Please help me with this.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.

Forum Statistics

Registered Users
5,078
Forums
28
Topics
9,261
Replies
34,296
Topic Tags
278