Sitehoover API

Sitehoover API is an interface making integration of outside applications with sitehoover.com service possible. Sitehoover API is based on JSON-RPC protocol.

API requests are directed to the following address:

http://api.sitehoover.com/api/



Sitehoover API Key

Sitehoover API Key is an authorization key required by each of Sitehoover API methods. The individual Sitehoover API Key is available to every registered user in Account Settings.



Request data format

Example:
{
	"id" : "1",
	"method" : "ping",
	"params" : [
		YOUR_SITEHOOVER_API_KEY, {
			"echo" : "my pong"
		}
	]
}
  • id – Request identifier.
  • method – Method name.
  • params – Parameters, first value of the array is Sitehoover API Key.


Response data format

Example:
{
	"result": "my pong",
	"error": null,
	"id": "1"
}
  • result – Response data.
  • error – Error code:
    • null – No error.
    • 400 – Bad request, example invalid request data format or lack of the required parameters.
    • 403 – Authorization error. Incorrect Sitehoover API Key.
    • 404 – Method does not exist.
    • 500 – Internal server error.
  • id – Request identifier.


Support for JSONP

Sitehoover API supports JSONP-type requests. In case of using JSONP interface, the data are transmitted as a serialized JSON object through query string in data field. Example (JavaScript):
var url = 'http://api.sitehoover.com/api/?data=' + escape(JSON.stringify(_request_json)) + '&jsoncallback=jsonp1268568693530';
gdzie:
  • _request_json – Obiekt JSON żądania.





Methods

Connection test

  • ping

    Connection test.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "ping",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"echo" : "my pong" [OPTIONAL]
    		}
    	]
    }
    JSON Response:
    {
    	"result": "my pong",
    	"error": null,
    	"id": "1"
    }

Hoovers

  • get_hoovers

    Return array of hoovers.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "get_hoovers",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY
    	]
    }
    JSON Response:
    {
    	"result": [
    		{
    			"oid" : 423,
    			"name" : "Example hoover 1",
    			"path" : "example-hoover-1",
    			"thumb" : "",
    			"tags" : "development, api, php, json",
    			"public" : 1,
    			"main" : 1
    		},
    		{
    			"oid" : 1123,
    			"name" : "Example hoover 2",
    			"path" : "example-hoover-2",
    			"thumb" : "",
    			"tags" : "",
    			"public" : 0
    			"main" : 0
    		}
    	],
    	"error" : null,
    	"id" : "1"
    }

Folders

  • get_folders

    Return array of folders from hoover.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "get_folders",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"hoover_oid" : 4
    		}
    	]
    }
    JSON Response:
    {
    	"result" : [
    		{
    			"oid" : 121,
    			"name" : "___main___",
    			"sortorder" : 0,
    			"main" : 1
    		},{
    			"oid" : 432,
    			"name" : "My folder name",
    			"sortorder" : 1,
    			"main" : 0
    		},{
    			"oid" : 1242,
    			"name" : "Second folder name",
    			"sortorder" : 2,
    			"main" : 0
    		}
    	],
    	"error" : null,
    	"id" : "1"
    }
  • add_folder

    Add folder to hoover.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "add_folder",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"hoover_oid" : 4,
    			"name" : "New folder",
    			"sortorder" : 0 [OPTIONAL]
    		}
    	]
    }
    JSON Response:
    {
    	"result" : 2355,
    	"error" : null,
    	"id" : "1"
    }
  • edit_folder

    Edit folder.

    JSON Request:
    {
    	"id' : "1",
    	"method" : "edit_folder",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"oid" : 10,
    			"name" : "new name",
    			"sortorder": 1 [OPTIONAL]
    		}
    	]
    }
    JSON Response:
    {
    	"result" : true,
    	"error" : null,
    	"id" : "1"
    }
  • delete_folder

    Delete folder.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "delete_folder",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"oid" : 7
    		}
    	]
    }
    JSON Response:
    {
    	"result" : true,
    	"error" : null,
    	"id" : "1"
    }

Pages

  • get_pages

    Return array of pages from folder.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "get_pages",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"folder_oid" : 9
    		}
    	]
    }
    JSON Response:
    {
    	"result": [
    		{
    			"oid" : "128",
    			"title" : "Another title of Yahoo!",
    			"url" : "http://www.yahoo.com/",
    			"thumb" : "http://thumbs.w3media.pl/thumbs/2f9704c729e7ed3b41647b7d0ad649fe,1,5.jpg",
    			"note" : "sample note",
    			"rss" : "http://sports.yahoo.com/olympics/rss.xml",
    			"sortorder" : "1"
    		},{
    			"oid" : "229",
    			"title" : "Simply google",
    			"url" : "http://www.google.com/",
    			"thumb" : "http://thumbs.w3media.pl/thumbs/3e4c44d9f192da3bcf0c1ece96717408,1,5.jpg",
    			"note" : "",
    			"rss" : "",
    			"sortorder" : "2"
    		}
    	],
    	"error":null,
    	"id":"1"
    }
  • add_page

    Add page to folder.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "add_page",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"folder_oid" : 9,
    			"url" : "http://www.web-album.org",
    			"title" : "My page title", [OPTIONAL]
    			"rss" : "http://www.web-album.org/pl/rss-last-photos/", [OPTIONAL]
    			"note" : "my note", [OPTIONAL]
    			"sortorder" : 1 [OPTIONAL]
    		}
        ]
    }
    JSON Response:
    {
    	"result" : 2134,
    	"error" : null,
    	"id" : "1"
    }
  • edit_page

    Edit page.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "edit_page",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"oid" : 2134,
    			"folder_oid" : 8, [OPTIONAL]
    			"title" : "My new page title", [OPTIONAL]
    			"rss" : "http://www.web-album.org/pl/rss-last-comments/", [OPTIONAL]
    			"note" : "my new note", [OPTIONAL]
    			"sortorder" : 1 [OPTIONAL]
    		}
        ]
    }
    JSON Response:
    {
    	"result" : true,
    	"error" : null,
    	"id" : "1"
    }
  • delete_page

    Delete page.

    JSON Request:
    {
    	"id" : "1",
    	"method" : "delete_page",
    	"params" : [
    		YOUR_SITEHOOVER_API_KEY, {
    			"oid" : 3
    		}
        ]
    }
    JSON Response:
    {
    	"result" : true,
    	"error" : null,
    	"id" : "1"
    }