Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Jul 2021 01:58 PM by  Steve L
Product Action Make JSON webrequest to external site
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:1
New Member


--
28 Jun 2021 05:26 PM
    I'm in ssearch of help to format the Action Rule of a product.  The requirements are it needs to make a POST to an external site via JSON and pass a few paramters.  For example Sale Order Number, Name, Phone email.  I'm thinking I need to usae the Post Web Request Template, but do not know who to format it and what syntax to use.  Many thanks.
    0


    Veteran Member


    Posts:2956
    Veteran Member


    --
    02 Jul 2021 01:58 PM

    Did you try something like this (note: I replaced the XML angled brackets with square brackets so that I can post to this Forum)

    [xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"]
      [xsl:template match="/"]
        [out]
          [webRequest]
            [url]http://domain.com/trigger...=value[/url]
            [username][/username]
            [password][/password]
            [domain][/domain]
            [method]POST[/method]
            [postString]{ "SalesOrderNumber": "100", "Name": "John", "Phone": "111-111-1111" }[/postString]
            [timeout]30000[/timeout]
          [/webRequest]
        [/out]
      [/xsl:template]
    [/xsl:transform]

    0
    You are not authorized to post a reply.