No RESTful API for Cloud Service?

Questions about the WURFL Cloud service.
fitzgeraldsteele
Posts: 1
Joined: Thu Sep 15, 2011 12:54 pm

No RESTful API for Cloud Service?

Postby fitzgeraldsteele » Thu Sep 15, 2011 3:08 pm

Out of curiosity, why did you make the choice to only release language-specific clients for your cloud service?

I think Google, Facebook, Twitter, et al have trained me to expect a RESTful style api, where a simple GET request might return a JSON representation of the capabilities for a particular user agent. That type of interface also makes it easer to integrate with javascript-powered apps, Python or Ruby based apps, or mobile apps.

Any plans/timeline to do a REST interface?

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: No RESTful API for Cloud Service?

Postby kamermans » Thu Sep 15, 2011 4:09 pm

NOTE: THIS INFORMATION IS ABOUT WURFL CLOUD BETA AND IS NO LONGER ACCURATE

The service is an authenticated RESTful API. We will provide documentation for using the API around launch time. The service uses a simple GET and returns JSON or XML data depending on what's specified in the URL. For example, the URL for requesting device data might look like http://api.wurflcloud.com/v1/json/searc ... rand_name) The API is modeled after LinkedIn's second generation API. The difference is that you must include the Basic Auth and User-Agent HTTP headers. The basic auth username is the part of your WURFL Cloud API Key before the colon, the basic auth password is the MD5 hash of the request path, in this case "/v1/json/search:(is_wireless_device,model_name,brand_name)" plus the HTTP user agent plus the WURFL Cloud password, which is the portion of the API Key after the colon. For example, in PHP it would look like this:

Code: Select all

$username = substr($api_key, 0, strpos(':', $api_key));
$password = md5($request_path . $user_agent . substr($api_key, strpos(':', $api_key) + 1));
With that information you will receive a JSON response with the detection results. The complexity for the Basic Auth is to prevent people from stealing your API credentials without requiring a handshake like SSL or OAuth. This keeps latency very low since it's a single request. It also prevents proxies from messing with your responses. You are more than welcome to try it out for yourself and post back with your questions.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

bertcatsburg
Posts: 2
Joined: Mon May 07, 2012 8:41 am

Re: No RESTful API for Cloud Service?

Postby bertcatsburg » Mon May 07, 2012 8:42 am

Is there any better documentation on the Restful API yet?
I am hoping to include Wurfl Cloud in my project and even get a paid license. But we do need better docs and example before we do this.

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: No RESTful API for Cloud Service?

Postby kamermans » Mon May 07, 2012 9:54 am

Thank you for your interest. We have decided not to allow direct access to our cloud service via the RESTful API at this time, but rather, we encourage you to use our WURFL Cloud Clients. Is there a particular reason that you don't want to use the official client? We have a Python and Ruby client in the works - I'd be happy to send you a beta release if the programming language is the problem.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

bertcatsburg
Posts: 2
Joined: Mon May 07, 2012 8:41 am

Re: No RESTful API for Cloud Service?

Postby bertcatsburg » Tue May 08, 2012 10:31 am

Hello Steve,

Thanks for the reply.
No, the language will be PHP. But I find your Cloud Client too cumbersome and not according
to the modern Internet Development Standards.
The same as fitzgeraldsteele said, why don't you create a simple Restful API?

I have decided to seek other solutions for Device Detection.

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: No RESTful API for Cloud Service?

Postby kamermans » Tue May 08, 2012 11:46 am

I'm sorry you find the client cumbersome. The PHP Cloud Client was written to conform to the Zend and Facebook PHP coding standards. The reason we don't allow direct access to the RESTful API is that we have an SLA in place, and in order to adhere to that level of service, we have decided to enforce the usage of our Cloud Clients. Device detection is not as simple as you're suggesting. Even if we had a RESTful API, you would have 10+ lines of code just setting up the required variables ('HTTP_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA', 'HTTP_ACCEPT', etc...), and another 15+ lines setting up fsock or cURL, then even more code for parsing the JSON response into usable PHP data. We feel that our Cloud Client is very well written and easy to use with only 5 lines of code:

Code: Select all

require_once dirname(__FILE__).'/../Client/Client.php';
$config = new WurflCloud_Client_Config();
$config->api_key = 'xxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$client = new WurflCloud_Client_Client($config);
$client->detectDevice();
Good luck with your search.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 9 guests