You are not logged in.
In order to send JSON to an API that looks as follows (NOTICE the spaced in the element names):
{
"myFirstArrayElement": [
{
"json": {
"Problem Ticket Number": "INC00012345",
"Reference Person ID": "cr:000123"
}
}
]
}
You need to use both XLayer Configuration and XSLT
The XSLT must look as follows:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<root class="object">
<myFirstArrayElement class="array">
<blank class="object">
<json type="string"><xsl:value-of select="//*[local-name() = 'mBuildBody']"></xsl:value-of></json>
</blank>
</workItems>
</root>
</xsl:template>
</xsl:stylesheet>
then in your XLayer configuration you need a datadefinition with the following:
<sxi:DataDefinition name="callRPABotAPI">
<sxi:Fields>
...
<sxi:Field name="na_3">
<sxi:Rules>
<sxi:Concatenation>
<sxi:Delimiter></sxi:Delimiter>
<sxi:Fields>
<sxi:Field staticValue="yes">{"Problem Ticket Number": "</sxi:Field>
<sxi:Field>mRef_num</sxi:Field>
<sxi:Field staticValue="yes">","Reference Person ID": "</sxi:Field>
<sxi:Field>mPersid</sxi:Field>
<sxi:Field staticValue="yes">"}</sxi:Field>
</sxi:Fields>
</sxi:Concatenation>
</sxi:Rules>
<sxi:OutputField>mBuildBody</sxi:OutputField>
</sxi:Field>
...
</sxi:Fields>
</sxi:DataDefinition>
where the fields mRef_num contains the value "INC00012345" and mPersid contains the value "cr:000123"
Refer to Correct JSON format from XML Stylesheet for RESTConnector for additional information on how to convert XML to JSON
Offline