- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I need to create a simple custom web service, but I'm a newbie with XDK and I need some help.
I need to call
https://assistenza.octaviangaming.com/renting/api?mobile_num=12345678
I create 3 files :
apiconfig.json
{
	  "renting_api": {
	    "name": "OctavianGaming",
	    "description": "Octy renting REST API",
	    "dashboardUrl": "https://assistenza.octaviangaming.com/renting/api"
	  }
	}
renting_api.js
(function (params) {
	  var exports = {};
	 
	  /* Data Feed Function */
	  exports.default = function (program) {
	   
	    var url = 'https://assistenza.octaviangaming.com/renting/api/?mobile_num='+ params.mobile_num;
	    return $.ajax({url: url});
	  };
renting_api.json
{
	"endpoints": [
	  {
	    "name": "EnabledMobileNum",
	    "dashboardUrl": "https://assistenza.octaviangaming.com/",
	    "methods": [
	      {
	        "MethodName": "default",
	        "Synopsis": "Grabs information from the A1 data set",
	        "parameters": [
	          {
	            "Name": "mobile_num",
	            "Required": "Y",
	            "Default": "",
	            "Type": "string",
	            "Description": "Mobile Number to check if is enabled"
	          }
	        ]
	      }
	    ]
	  }
	]
	}
  return exports;
	})
I want to call it from a js, what I have to include in .js file?
Thanks In Advance
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can refer to below provided video
software.intel.com/en-us/html5/videos/integrating-a-new-service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below the solution:
{
	  "renting_api": {
	    "name": "OctavianGaming",
	    "description": "Renting Rest API",
	    "dashboardUrl": "https://assistenza.octaviangaming.com"
	  }
	}
(function (credentials, helpers) {
	  var exports = {};
	   
	  exports.CheckMobileEnabling = function(params) {
	    var url = 'https://assistenza.octaviangaming.com/renting/api/?mobile_num=' + params.mobile_num;
	    //if (params) url = url + '?' + $.param(params);
	    return $.ajax({url: url, type: 'GET'});
	  };
	 
	  return exports;
	})
{
	"endpoints": [
	  {
	    "name": "RentingApi",
	    "dashboardUrl": "https://assistenza.octaviangaming.com",
	    "methods": [
	      {
	        "MethodName": "CheckMobileEnabling",
	        "Synopsis": "CheckMobileEnabling",
	        "parameters": [
	          {
	            "Name": "mobile_num",
	            "Required": "Y",
	            "Default": "",
	            "Type": "string",
	            "Description": "Mobile Number parameter."
	          }
	        ]
	      }
	    ]
	  }
	]
	}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Amrita,
the Intel XDK is a amazing tools, but, the documentation is quite poor. Follow a video is quite heavy, better a simple and clear Examples.
Like this :
http://qnimate.com/post-series/intel-xdk-complete-training/
In the official Intel support pages, in my opinon, there are too written words.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am glad it is working now. Thank You for your feedback, I will definitely pass it to the development team.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am looking for something similar to above . I would like to create a web service to connect to a MySQL external database / with authentication and store authentication in local mobile device . All the samples of the videos show existing Web Services . I would like to create my own . Do you have a sample video of how to create your own web service. on Intel XDK ?
Note this video sample uses an existing web service . software.intel.com/en-us/html5/videos/integrating-a-new-service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John -- try this webinar > https://software.intel.com/en-us/videos/ajax-requests-rest-based-web-services-in-the-intel-xdk-part-2 from this page > https://software.intel.com/en-us/xdk/docs/webinars-videos-links
 
					
				
				
			
		
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page