<?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 Re: Webscript with json request parameter in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109238#M30624</link>
    <description>&lt;P&gt;&lt;U&gt;To call a repository webscript you can do something similar to the below example:&lt;/U&gt;&lt;/P&gt;

&lt;PRE&gt;   //JSON Payload
	var searchPayload = {
	   "offerName":"test",
	   "offerPrice":"$100"
	}
	
    Alfresco.util.Ajax.request({
	        //e.g.: http://localhost:8080/alfresco/service/searchOffers
    	        url : Alfresco.constants.PROXY_URI + "/searchOffers",
    	        requestContentType:Alfresco.util.Ajax.JSON,
		responseContentType:Alfresco.util.Ajax.JSON,
		dataObj:searchPayload,
		method:Alfresco.util.Ajax.POST,&lt;BR /&gt;                timeout:180000,&lt;BR /&gt;		successCallback : {
			fn : function (response) {
				//TODO:: do something with response
			},
			scope : this
		}, 
		failureCallback : {
			fn : function (response) {
				//TODO:: do something in case of failure response
			},
			scope : this
		}
    });&lt;/PRE&gt;
&lt;P&gt;You can refer to this post as well, its quite old but may be helpful:&amp;nbsp;&lt;A href="https://blog.arvixe.com/webscript-call-in-client-side-javascript-of-alfresco/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://blog.arvixe.com/webscript-call-in-client-side-javascript-of-alfresco/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 21:40:29 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2020-05-13T21:40:29Z</dc:date>
    <item>
      <title>Webscript with json request parameter</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109236#M30622</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have one custom search webscript with me which I am able to call from POSTMAN, in which I need to send 5 different values in json format and I get the related document in response. Now I want to call this webscript from custom share surf page. I have created one surf page and added 5 textbox and 1 button in that page now how can I call webscript with json request parameter to get the same response I'm getting from POSTMAN.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dhrumil&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 05:23:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109236#M30622</guid>
      <dc:creator>dhrumilgosaliya</dc:creator>
      <dc:date>2020-05-13T05:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Webscript with json request parameter</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109237#M30623</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please follow below tutorial.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.1/tasks/ws-request-process.html" target="_self" rel="nofollow noopener noreferrer"&gt;Webscript&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 06:54:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109237#M30623</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-13T06:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Webscript with json request parameter</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109238#M30624</link>
      <description>&lt;P&gt;&lt;U&gt;To call a repository webscript you can do something similar to the below example:&lt;/U&gt;&lt;/P&gt;

&lt;PRE&gt;   //JSON Payload
	var searchPayload = {
	   "offerName":"test",
	   "offerPrice":"$100"
	}
	
    Alfresco.util.Ajax.request({
	        //e.g.: http://localhost:8080/alfresco/service/searchOffers
    	        url : Alfresco.constants.PROXY_URI + "/searchOffers",
    	        requestContentType:Alfresco.util.Ajax.JSON,
		responseContentType:Alfresco.util.Ajax.JSON,
		dataObj:searchPayload,
		method:Alfresco.util.Ajax.POST,&lt;BR /&gt;                timeout:180000,&lt;BR /&gt;		successCallback : {
			fn : function (response) {
				//TODO:: do something with response
			},
			scope : this
		}, 
		failureCallback : {
			fn : function (response) {
				//TODO:: do something in case of failure response
			},
			scope : this
		}
    });&lt;/PRE&gt;
&lt;P&gt;You can refer to this post as well, its quite old but may be helpful:&amp;nbsp;&lt;A href="https://blog.arvixe.com/webscript-call-in-client-side-javascript-of-alfresco/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://blog.arvixe.com/webscript-call-in-client-side-javascript-of-alfresco/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 21:40:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/webscript-with-json-request-parameter/m-p/109238#M30624</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-05-13T21:40:29Z</dc:date>
    </item>
  </channel>
</rss>

