当前位置:网站首页>Call rest port to implement nailing notification

Call rest port to implement nailing notification

2022-06-23 02:22:00 Knowledge and action software EDI

Nailing has become a necessary communication software for the daily work of many enterprises , Zhixing software has also made some efforts in nailing notification , Using the bridge of knowledge and action REST Port call nail robot API So as to realize the function of nail notification , So when the customer is EDI After receiving data on the system , The nailing group will also send a notification message , Customers can process information in a timely manner , Increase of efficiency .

One Create a nail robot

The nailing group has a custom robot function , This function can be used to create a nailing robot with message notification , Implement nailing notification .

1、 Open group settings , Click Add robot .

2、 Choose a custom robot

3、 Set robot name

You can customize it here, for example :【 Notice of news 】. Select the group that needs to receive the notification message , Add security settings . As shown in the figure below , Here is one out of three , Generally, you can select user-defined keywords , Note that this keyword needs to be in REST Port transmission json It's used in the file . For example, add a custom keyword :“ received ”, The message sent by this robot , Must contain “ received ” The word , To send successfully .

4、 After setting, the robot will start working

It should be noted that , The setting interface of the robot will have a access_token Of url, Copy and save , You need to use this with access_token Of url.

Two call API

At the bridge of knowledge and action REST Port settings are provided with access_token Of url, Method is :POST The head is Content_Type:application/json Another thing to note : launch POST When asked , The character set encoding must be set to UTF-8.

Configure these , The next step is to generate a copy at the end of the actual business transformation json file , This json The file needs to include the following parameters .

To implement nailing notifications , To be transmitted json The format of the file is as follows .

{
    "at": {
        "atMobiles": [
            "180xxxxxx"
        ],
        "atUserIds": [
            "user123"
        ],
        "isAtAll": false
    },
    "text": {
        "content": " received 850 Receipt @180xxxxxx "
    },
    "msgtype": "text"
}

3、 ... and Realize message transmission

1、 Nail notification - Order notification

As shown in the figure , Workflow can be built in the bridge of knowledge and action , What we want to accomplish is : For one Excel The scheme adds the nailing notification of the receiving direction demo. On normal reception X12 message , And will X12 The message is converted to XML And then through the Demo_Copy Copy a converted port xml file , Get two identical xml file . A copy continues through the normal process Excel Port and then send it to the customer's mailbox through the mailbox port , The other is for nailing notice .

But before the nail notification , You need to go through a Schedule The port is delayed for several minutes , To ensure that the real data completely enters the customer's mailbox , And then the notice of nailing . complete Schedule After the port delay, it passes Script port , Extract message name and primary key information , It can be read by the nail robot json file , And then pass by REST Port send to nail group , The function of nailing notification can be realized . The following is the interface display of several nailing notifications .

Aite's nail notice to the specific person

The nail notice of AIT's owner

Do not make any text message notification of Aite

2、 Error warning -AS2 Automatic port patrol

EDI External connection ports sometimes have problems due to various situations , For example, modify http by https after , The set... Appears SSL Certificate problem , This will lead to EDI Environment hangs up , Therefore, the nail notification function can be used for automatic patrol inspection , When something goes wrong with the environment , Users can know and handle it in time . As shown in the figure above , We are on the bridge of knowledge and action EDI Create a... On the system Script Port and AS2 port , utilize Script Port to achieve when AS2 When there is a problem with the port , Timely nail notification , It is convenient for the operation and maintenance personnel to check and correct in time . Script The specific port code is as follows :

<rsb:set attr="check.sslcert" value="*"/>
<rsb:set attr="check.url" value="AS2URL"/>
<rsb:call op="httpGet" in="check">
  <rsb:catch code="*">
    <rsb:set attr="notify.url" value="【 Nail custom robot url】"/>
    <rsb:setm item="notify">
      url =  nail 【 Nail custom robot url】
      postdata = {"at": {"atMobiles":\["【 By @ Man's cell phone number 】"\],"isAtAll": yes 【 no @ All the people , Is for true, No is false】},"text": {"content":" Business alerts :AS2 Port not accessible , Please check immediately ![_message | def]"},"msgtype":"text"}
      contenttype = application/json
    </rsb:setm>
    <rsb:call op="httpPost" in="notify" />
  </rsb:catch>
</rsb:call>

<rsb:set attr="o.FileName" value="[_|now]" />
<rsb:push item="o"/>

among ,postdata The content in is to call the nail robot json The contents of the document . Examples of alarms :

such , adopt REST The function of port calling nail notification can be realized , Users pass the bridge of knowledge and action EDI When the system sends and receives data , You can receive notification messages in the nailing group in time , Ensure that information is processed in a timely manner , Improve response efficiency .

原网站

版权声明
本文为[Knowledge and action software EDI]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202081439110165.html