Improved Parameter Passing in Javascript SDK

We the recent upgrades in the API iwth version 3, we are now able to improve the SDK as well.

Before API v3, the parameters had to be passed to the SDK using a Dictionary-like structure like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
var helloWorldSvc = new iKnodeSdk.ApplicationClient({
    userId: USERID,
    apiKey: APIKEY,
    appName: "HelloWorld"
});

var response = helloWorldSvc.execute({
    methodName: "HelloYou",
    parameters: [{
        name: "yourName",
        value: "John Doe"
    }]
});

Now you can do this:

1
2
3
4
5
6
7
8
9
10
11
12
var helloWorldSvc = new iKnodeSdk.ApplicationClient({
    userId: USERID,
    apiKey: APIKEY,
    appName: "HelloWorld"
});

var response = helloWorldSvc.execute({
    methodName: "HelloYou",
    parameters: {
        yourName: "John Doe"
    }]
});

Instead of passing the parameters as a Key-Value pair, you just pass the parameter in a common JSON object format. It is way more javascript friendly, and API friendly as well. No need to format the parameters in weird ways, and no need for the parameter formatting used before.

The latest Javascript SDK is backward compatible, but in order for the SDK to work with Key-Value pair parameters, just add the following flag:

1
2
3
4
5
6
7
8
var response = helloWorldSvc.execute({
    methodName: "HelloYou",
    formatParameters: true,
    parameters: [{
        name: "yourName",
        value: "John Doe"
    }]
});

Let us know waht you think.

New and Improved API (Version 3)

We are please to invite you to try our new and improved API, which is now at version 3. Version 2 of the API is still available and will remain until the end of the year. This new version includes a number of enhancements, mostly on the resquest side.

Version 2 of the API worked perfectly fine, but it wasn’t as simple as it could be. The POST body needed to be wrapped in a JSON object which only contained one field: “parameters”. This made the API calls cumbersome for complex objects. Escaping had to be done, since the parameters field expected an escaped json formatted string.

For example, calling and application method “HelloYou” form the application “HelloWorld” requiring one parameter, would need to be called like this in version 2:

Using curl
1
2
3
4
5
6
curl -X POST \
-H "iKnode-UserId: [YOUR-USERID]" \
-H "iKnode-ApiKey: [YOUR-APIKEY]" \
-H "Content-Type: application/json" \
-d '{ "parameters" : "{ yourName: \"John Doe\" }" }' \
https://api.iknode.com/Applications/execute/HelloWorld/HelloYou

Notice how the parameters are wrapped and escaped in the POST body: ’{ “parameters” : “{ yourName: "John Doe" }” }’

With the new API, the POST body contains your JSON object exactly as you serialized. No need for escaping or encoding. Additionally, the User Identifier is now part of the URL, only the API Key needs to be added in the header.

Using curl
1
2
3
4
5
curl -X POST \
-H "iKnode-ApiKey: [YOUR-APIKEY]" \
-H "Content-Type: application/json" \
-d '{ "yourName": "John Doe" }' \
https://api.iknode.com/v3/[YOUR-USERID]/HelloWorld/HelloYou

Notice the parameters are no longer wrapped, and the JSON parameter is represented as is: { “yourName”: “John Doe” }

Needles to say, that if you are using the SDK, this change doesn’t change anything in your code. The newesst SDKs already support Version 3 of the API. Just upgrade to the latest version of the SDK and you are set to go. No need to change your code.

For more information check the documentation here.

To Infinity and Beyond

We started working on changing the Web in 2011 with the creation of iKnode. Our dreams filled our heart and our soul with the vision to make distributed systems via web services at every developers reach. We dreamed of recent graduates building their dreams on the web. Back then it was only me (Alex), Jorge and Joel. Fully funded by ourselves. Living the bootstrap dream.


We coded for days and nights to realize the vision. To create every single building block that made the iKnode cloud. Learning from our beta users, and our testing. We were 3 at the time. With Joel doing the Graphics and the fron-end, Jorge and me working on the engine.


We saw Backend as a Service providers pop up from everywhere. It seemed like the market started to get full of competitors, and that made us feel excited, empowered even. It validate our idea, but most importantly it validated our dream. We welcomed the competition enriching the market and make it more fun.


Around May 2012, we noticed more BaaS providers started to popup. A lot of them were companies that seemed to be cloning other BaaS providers features, and most of them didn’t bring anything new to the table. The competition started to get boring.


Nothing interesting was coming out, except for one company: Spire.io. We glanced through their site, and saw a spark of new, but something about them seemed very familiar. Their passion, it seems, was the same as ours: making developers life easier by creating a serverless world. The best way to make distributed computing easy, is to remove servers. We felt the competition was getting too close this time. For a moment we were afraid, but also happy. We were not alone.


We kept a close eye on them for the following months and then dozed back in to our own product and our own vision. We began to ramp up development to release at the DEMO conference in October. With Sophie’s help, and an amazing design by Joel, we invested in T-Shirts, Stickers and swag. We were proud to wear and iKnode T-Shirt, we still are.


October (2012) came and we launched iKnode at DEMO. We were a great success, attracting a big number of users into our dream cloud. Sophie joined to run the business, which was just starting. The following months after that we kept the feedback loop active learning and learning from our users.


By December 2012, I was able to get back to market analysis. Moving away a bit from our own user base to the information on the web. The first thing my list was to check on Spire.io. I was afraid to find them ahead of us. After all we were the only providers going after the web in the same way.


So I typed on my chrome instance: spire.io….. Nothing. The site was down. I thought. It seemed crazy that a Cloud provider would allow their site to go down. So I tried again. And again I got Nothing. I checked www.downforeveryoneorjustme.com, and validated. Their site was down. Completly down. What happenned ?


I began to tirelessly look for news around the web regarding Spire.io, to see if there were any press releases, blog post, etc. Checked Hacker News first, then Reddit, then Tech Crunch, and every other imaginable tech news site. Got Nothing. Nada.


I was perplexed. I was scared even. How can a company disappear over night? I began to be very scared. What happens if our dream is wrong ? What happens if what we are looking for is unattainable ? The team at Spire.io had the answer and I had to find out.


I first sent a tweet to the @spireio account:


The CEO responded:


He was very nice, but still I needed to know more, so I insisted.


To make the story short, he contacted me over email, and we were able to talk over the phone for an hour or so. Several interesting things happened during that phone call. Not only did we had the same dream to make a serverless world, but also he is from Mexico, just like us. And he lives in LA, which is pretty close to us; we are in Orange County. I thought that was amazing. And it seemed to me to be a cosmical connection.


After I hanged up, I felt relieved to know that our dream was still attainable. Additionally I made a friend, which shares our dream. I was a happy camper.


In the following months Diego, began helping more and more to pave the way for iKnode. For the iKnode team, Diego seemed part of it already, so we decided to officially invite him to be part of the iKnode family.


Today, we are proud to announce, Diego Prats joins the iKnode team as Chief Strategy Officer. His experience and expertise is first rate in the Backend as a Service industry. He will be mainly helping to build the dream on solid ground with a real solid business framework that will hold iKnode’s feet in the ground, but keep the heart flying in the serverless clouds.

And now with a complete team, in the words of Buzz Light Year:

“To inifity and Beyond!”