Announcing the New Documentation Site

Today we are announcing the new documentation site. We have been adding a lot of content lately to the documentation, and we have been complaining about how the structure wasn’t useful enough. The old design was just too cluttered and complicated.

The new design is clean and very well structured: New Document Site

With this new design we strived to improve the usability and structure to make it easier to navigate and read. The navigation was one of the most important improvements we added. Before it was just a simple Octopress menu, now it is a minimal but powerful side bar.

Navigation

The content is also less cluttered, now that it is divided into several pages, instead of having only one page for all. At the beginning, we thought having it all in one page would be easier for the user and for us to read and look for, but as it grew, it became too much. Multiple pages encapsulates the content better and it also helps you focus on what you are trying to learn.

Go check the documentation site yourself and let us know what you think.

iKnode Documentation

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.