Klout Example

Example 1

In this example we are going to make two separate calls with an end goal of getting Klout Score of a Twitter User:

  1. First get the Kloud ID of a Twitter Account
    GET http://api-multi-request.demos.mikestowe.com/klout/api/v2/identity.json/twitter?screenName=mikegstowe
  2. Now call the score resource with that ID
    GET http://api-multi-request.demos.mikestowe.com/klout/api/v2/user.json/45598950992084523/score

To use the chain, we would simply make one call via POST, as such:


http://api-multi-request.demos.mikestowe.com/klout/api/v2/multirequest

[
  {
    "doOn": "always",
    "href": "/identity.json/twitter?screenName=mikegstowe",
    "method": "get",
    "data": {},
    "return": ["id"]
  },
  {
    "doOn": "200",
    "href": "/user.json/${body.id}/score",
    "method": "get",
    "data": {},
    "return": ["score"]
  }
]

While required to make two calls, we have now successfully obtained both the Klout ID to store for later, and the Klout score.