<?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>topic How to pass an array of values to a webscript call in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-pass-an-array-of-values-to-a-webscript-call/m-p/29040#M12389</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling a webscript (action-execution) which requires me to pass a list of params in the body of the Post.&amp;nbsp; When I try to pass an array of strings I get the below error.&amp;nbsp; &amp;nbsp;Also see code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, what is the&amp;nbsp;correct way to pass an array of strings in the body of webscript call so that they are serialised into an array or List by the webscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: {"error":{"errorKey":"Could not read content from HTTP request body: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token\n at [Source: (BufferedReader); line: 1, column: 136] (through reference chain: java.lang.Object[0]-&amp;gt;org.alfresco.rest.api.model.Action[\"params\"]-&amp;gt;java.util.LinkedHashMap[\"email_list\"])","statusCode":400,"briefSummary":"05190018 Could not read content from HTTP request body: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token\n at [Source: (BufferedReader); line: 1, column: 136] (through reference chain: java.lang.Object[0]-&amp;gt;org.alfresco.rest.api.model.Action[\"params\"]-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calling code is as follows:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;let&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;actionBodyExec&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"actionDefinitionId"&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"action.mediamonitoring.moveToAccepted"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"targetId"&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;mediaItem&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;nodeRef&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;substring&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #b5cea8;"&gt;24&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"params"&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"email_list"&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; [&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"brian.oneillseedim.com.au"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"brian.oneill@seedim.com.au"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"template_name"&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;templateName&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;apiService&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;getInstance&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;webScript&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;executeWebScript&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'POST'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'action-executions'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;null&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'alfresco'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'api/-default-/public/alfresco/versions/1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #9cdcfe;"&gt;actionBodyExec&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;).&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #c586c0;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;....}, &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;error&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;error&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;error&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jun 2019 05:48:44 GMT</pubDate>
    <dc:creator>bgkoneill</dc:creator>
    <dc:date>2019-06-19T05:48:44Z</dc:date>
    <item>
      <title>How to pass an array of values to a webscript call</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-pass-an-array-of-values-to-a-webscript-call/m-p/29040#M12389</link>
      <description>Hi Guys,I am calling a webscript (action-execution) which requires me to pass a list of params in the body of the Post.&amp;nbsp; When I try to pass an array of strings I get the below error.&amp;nbsp; &amp;nbsp;Also see code below.Therefore, what is the&amp;nbsp;correct way to pass an array of strings in the body of webscript call so</description>
      <pubDate>Wed, 19 Jun 2019 05:48:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-pass-an-array-of-values-to-a-webscript-call/m-p/29040#M12389</guid>
      <dc:creator>bgkoneill</dc:creator>
      <dc:date>2019-06-19T05:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass an array of values to a webscript call</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-pass-an-array-of-values-to-a-webscript-call/m-p/29041#M12390</link>
      <description>&lt;P&gt;based on the error details, the server rejects your array. I suggest consulting the documentation to check if arrays are indeed supported there via REST api&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:01:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-pass-an-array-of-values-to-a-webscript-call/m-p/29041#M12390</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2019-10-08T14:01:08Z</dc:date>
    </item>
  </channel>
</rss>

