<?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 Hi in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064290#M55522</link>
    <description>&lt;P&gt;-&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2016 02:27:00 GMT</pubDate>
    <dc:creator>Sam_Suresh</dc:creator>
    <dc:date>2016-07-19T02:27:00Z</dc:date>
    <item>
      <title>Example of custom Webservice API</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064286#M55518</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I want to use App Designer to create custom webservice data binding and make use of listview to create a searchable database.&lt;/P&gt;

&lt;P&gt;I understand there is 3 files need to create. However I couldn't find any tutorial example to create those 3 files precisely. I can use other webservices API such as Rotten Tomatoes. Trying to build something similar using my data for a business app.&lt;/P&gt;

&lt;P&gt;I have created a PHP file which read and encode data to JSON format. How I can create a webservice so can be used in App Designer?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 09:19:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064286#M55518</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-07-18T09:19:19Z</dc:date>
    </item>
    <item>
      <title>Hi Sam,</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064287#M55519</link>
      <description>&lt;P&gt;Hi Sam,&lt;/P&gt;

&lt;P&gt;On this page :&amp;nbsp;https://software.intel.com/en-us/xdk/docs/using-web-services#service_createown, if you go to the "Integrating Your Own Services" section and follow the steps, there are some details on what should go in those 3 files. The "Special Parameters" section would be useful as well.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;This video also explains how to write those files :&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;A href="https://software.intel.com/en-us/videos/integrating-a-new-service" target="_blank"&gt;https://software.intel.com/en-us/videos/integrating-a-new-service&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;The files loosely follow the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;&lt;A href="https://github.com/mashery/iodocs#api-level-config-details" target="_blank"&gt;https://github.com/mashery/iodocs#api-level-config-details&lt;/A&gt; standard.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;If you still need some help...When you create a data binding, a file is generated : &amp;lt;your project root&amp;gt;www/xdk/services/service-method.js. This file has the merged code of all .js file of every service. You can also use that as a guide to figure out how to write the .js file for your service.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;These sources would help you kick start writing those files.If you have any finer detail questions, fire away here.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 18:16:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064287#M55519</guid>
      <dc:creator>Anjali_G_Intel</dc:creator>
      <dc:date>2016-07-18T18:16:00Z</dc:date>
    </item>
    <item>
      <title>Hi Anjali</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064288#M55520</link>
      <description>&lt;P&gt;Hi Anjali&lt;/P&gt;

&lt;P&gt;Thanks for your reply.&lt;/P&gt;

&lt;P&gt;I have viewed these 2 before creating this topic. These refers to other 3rd party services.&lt;/P&gt;

&lt;P&gt;In my case, I have a JSON data obtained from a URL. How I can use this data as a data binding in App designer?&lt;BR /&gt;
	I know I can list those data with Javascript. But I'm trying to create as webservice so that I can make use of App Designer features to easily create different views.&lt;/P&gt;

&lt;P&gt;This is the data I'm getting from my JSON URL.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="data.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8978i113B2B45E0DB2AC3/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="data.png" alt="data.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 00:11:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064288#M55520</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-07-19T00:11:35Z</dc:date>
    </item>
    <item>
      <title>This is a webservice I tried</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064289#M55521</link>
      <description>&lt;P&gt;This is a webservice I tried to create which didn't work;&lt;BR /&gt;
	&lt;STRONG&gt;apiconfig.json&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;{
  "$PHP": {
    "name": "PHP API",
    "description": "A great API",
    "dashboardUrl": "http://developer.mu.my"
  }
}&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;$PHP.js&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;(function () {
  var exports = {};
  
  exports.default = function(params) {
    var url = 'http://localhost/databasexdk.php/';
    return $.ajax({url: url, type: 'GET'});
  };
  
  return exports;
})&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;$PHP.json&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;{
"endpoints": [
  {
    "name": "title",
    "dashboardUrl": "http://localhost/databasexdk.php/",
    "methods": [
      {
        "MethodName": "methodA1",
        "Synopsis": "Grabs information from the A1 data set"
      },
      { [
          {
            "Name": "path",
            "Required": "Y",
            "Default": "",
            "Type": "string",
            "Description": "Description of the first parameter."
          },
          {
            "Name": "title",
            "Required": "Y",
            "Default": "",
            "Type": "string",
            "Description": "The userId parameter that is in the URI."
          }
        ]
      },
      

    ]
  }
]
}&lt;/PRE&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 00:48:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064289#M55521</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-07-19T00:48:28Z</dc:date>
    </item>
    <item>
      <title>Hi</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064290#M55522</link>
      <description>&lt;P&gt;-&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 02:27:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064290#M55522</guid>
      <dc:creator>Sam_Suresh</dc:creator>
      <dc:date>2016-07-19T02:27:00Z</dc:date>
    </item>
    <item>
      <title>Hi Sam,</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064291#M55523</link>
      <description>&lt;P&gt;Hi Sam,&lt;/P&gt;

&lt;P&gt;I am taking a look at this in detail but by glancing at this, I can spot one issue,&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;that is also discussed here :&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;A href="https://software.intel.com/en-us/forums/intel-xdk/topic/633302" target="_blank"&gt;https://software.intel.com/en-us/forums/intel-xdk/topic/633302&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;It will be fixed in our next release. I will make sure is documented on the web page link I provided. To workaround, update your apiconfig.json to be :&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;{
  "PHP": {
    "name": "PHP API",
    "description": "A great API",
    "dashboardUrl": "http://developer.mu.my",
    "compatibleProjectTypes":[
          "com.intel.xdk.projecttype.jsapp",
          "com.intel.xdk.projecttype.webapp",    
          "com.intel.xdk.projecttype.iotapp"
      ]
  }
}&lt;/PRE&gt;

&lt;P&gt;I am still looking into this..&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 18:58:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064291#M55523</guid>
      <dc:creator>Anjali_G_Intel</dc:creator>
      <dc:date>2016-07-19T18:58:20Z</dc:date>
    </item>
    <item>
      <title>Another error is in the .json</title>
      <link>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064292#M55524</link>
      <description>&lt;P&gt;Another error is in the .json file. If you want the path and title to be parameteres for your method method1, then it should be :&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;{
"endpoints": [
  {
    "name": "title",
    "dashboardUrl": "http://localhost/databasexdk.php/",
    "methods": [
      {
        "MethodName": "methodA1",
        "Synopsis": "Grabs information from the A1 data set",
        "parameters": [
          {
            "Name": "path",
            "Required": "Y",
            "Default": "",
            "Type": "string",
            "Description": "Description of the first parameter."
          },
          {
            "Name": "title",
            "Required": "Y",
            "Default": "",
            "Type": "string",
            "Description": "The userId parameter that is in the URI."
          }
        ]
      }
      

    ]
  }
]
}&lt;/PRE&gt;

&lt;P&gt;If you don't want the parameters , then it will be :&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;{
"endpoints": [
  {
    "name": "title",
    "dashboardUrl": "http://localhost/databasexdk.php/"
  }
]  
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 21:45:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Example-of-custom-Webservice-API/m-p/1064292#M55524</guid>
      <dc:creator>Anjali_G_Intel</dc:creator>
      <dc:date>2016-07-19T21:45:55Z</dc:date>
    </item>
  </channel>
</rss>

