<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: CPI: Json body With POST method in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755899#M4788136</link>
    <description>&lt;P&gt;till now it is not not resolved.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212537-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212538-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212539-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212540-image.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2023 16:01:46 GMT</pubDate>
    <dc:creator>Akash</dc:creator>
    <dc:date>2023-09-08T16:01:46Z</dc:date>
    <item>
      <title>CPI: Json body With POST method</title>
      <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaq-p/12755896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;how to pass json body in cpi. consuming a rest API and adding json body with the url with post method. it is taking null value. but i pass this value . how i resolve this kind of issue&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212497-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212515-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212516-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaq-p/12755896</guid>
      <dc:creator>Akash</dc:creator>
      <dc:date>2023-09-07T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: CPI: Json body With POST method</title>
      <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755897#M4788134</link>
      <description>&lt;P&gt;Following! Interested with this topic. I would also like to know the answer to the question asked.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 09:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755897#M4788134</guid>
      <dc:creator>rrayosdelsol</dc:creator>
      <dc:date>2023-09-08T09:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: CPI: Json body With POST method</title>
      <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755898#M4788135</link>
      <description>&lt;P&gt;It does not look like you are passing correct input to this code. try and check your code here&lt;/P&gt;&lt;P&gt;&lt;A href="https://groovyide.com/cpi" target="test_blank"&gt;https://groovyide.com/cpi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://groovyide.com/cpi/share/v1/dVLbioMwEP2VbF5ql5IP6LIvpQ-lULpsX4Ul1alN0UzIxSLiv-9oIvVhV9BJ5py5HafnSpvg-bbnVyw7vuU9y7mWDeR8S6cj3jXbI93YwPiG30GWYN3Ix7o8TDcKOkBd4xsfNtxYNGC9gpEzkMMVVpmpQIElEFc1Bq1nBTbCSSMq6eEpO6GMKNCCKILz2JTQiuBVLU7gnKzgI9cp7iFbGaGDdPeTNC-osohtJx4OtTjSZxdUTf39TzgHT8P_jb-TO9cl3FhqgdFoBR330sts9jXRrlmfa0bP96QIs9F8zriowO9I3yzi60gek4-1LnWwZqJreLLjy5MtiDj1SpxFhDDSOsjsK-n4juxrHH2RMokRU85w6pqx1fjLf1pZr1IhMe0AocNEmedwaY6UQHj8suB9d_FW6Spbp4ZZNAQFq-dgEnSgFboFXXiFmlZhoSgfhl8" target="test_blank"&gt;https://groovyide.com/cpi/share/v1/dVLbioMwEP2VbF5ql5IP6LIvpQ-lULpsX4Ul1alN0UzIxSLiv-9oIvVhV9BJ5py5HafnSpvg-bbnVyw7vuU9y7mWDeR8S6cj3jXbI93YwPiG30GWYN3Ix7o8TDcKOkBd4xsfNtxYNGC9gpEzkMMVVpmpQIElEFc1Bq1nBTbCSSMq6eEpO6GMKNCCKILz2JTQiuBVLU7gnKzgI9cp7iFbGaGDdPeTNC-osohtJx4OtTjSZxdUTf39TzgHT8P_jb-TO9cl3FhqgdFoBR330sts9jXRrlmfa0bP96QIs9F8zriowO9I3yzi60gek4-1LnWwZqJreLLjy5MtiDj1SpxFhDDSOsjsK-n4juxrHH2RMokRU85w6pqx1fjLf1pZr1IhMe0AocNEmedwaY6UQHj8suB9d_FW6Spbp4ZZNAQFq-dgEnSgFboFXXiFmlZhoSgfhl8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 13:47:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755898#M4788135</guid>
      <dc:creator>Muniyappan</dc:creator>
      <dc:date>2023-09-08T13:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: CPI: Json body With POST method</title>
      <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755899#M4788136</link>
      <description>&lt;P&gt;till now it is not not resolved.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212537-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212538-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212539-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212540-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 16:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755899#M4788136</guid>
      <dc:creator>Akash</dc:creator>
      <dc:date>2023-09-08T16:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: CPI: Json body With POST method</title>
      <link>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755900#M4788137</link>
      <description>&lt;P&gt;Maybe not the most elegant solution but this works for me with incoming Json payload { "company": "abc123" }&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;def Message processData(Message message) {
    //Body
/*To set the body, you can use the following method. Refer SCRIPT APIs document for more detail*/
    def messageLog = messageLogFactory.getMessageLog(message);
    def pMap = message.getProperties();
    def body = message.getBody(java.lang.String) as String;
    
   def jsonSlurper = new JsonSlurper()
    input = jsonSlurper.parseText(body)

    def builder = new JsonBuilder();
    builder {
        'CompanyNew'    input.company
        
    }
    
    messageLog.setStringProperty("ResponsePayload", "Printing Payload As Attachment")
    messageLog.addAttachmentAsString("final" , builder.toPrettyString(), "text/plain");

    
    message.setBody(builder.toPrettyString());
    return message;
}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marty&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cpi-json-body-with-post-method/qaa-p/12755900#M4788137</guid>
      <dc:creator>MartyMcCormick</dc:creator>
      <dc:date>2023-09-08T19:19:05Z</dc:date>
    </item>
  </channel>
</rss>

