Silverbakk

Supported operations

The following operations are supported by the Silverbakk API.

access

Retrieve information about your available projects

Request

GET /api/xml/access.php?details=string
Host: silverbakk.com

Response

Example response when request parameter details is set to false:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<silverbakk version="1.3" name="access">
	<projects>
		<project>
			<projectid>6213</projectid>
			<name>Shoe makers</name>
			<description>Social Media Monitoring for three different shoe makers</description>
			<active>1</active>
			<accesscomment>Production environment</accesscomment>
		</project>
		<project>
			<projectid>5234</projectid>
			<name>Lightbulbs</name>
			<description>Bright ideas can be found anywhere</description>
			<active>1</active>
			<accesscomment>Production environment</accesscomment>
		</project>
	</projects>
</silverbakk>
Example response when request parameter details is set to true:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<silverbakk version="1.3" name="access">
	<projects>
		<project>
			<projectid>6213</projectid>
			<name>Shoe makers</name>
			<description>Social Media Monitoring for three different shoe makers</description>
			<active>1</active>
			<accesscomment>Production environment</accesscomment>
			<details>
				<keywords count="1">
					<keyword>
						<keywordid>14329</keywordid>
						<keywordname>nike</keywordname>
						<uppercasesensitive>0</uppercasesensitive>
						<includes>
							<statement>shoe, shoes</statement>
						</includes>
						<excludes>
							<statement>greek goddess</statement>
						</excludes>
					</keyword>				
				</keywords>	
				<languages count="2">
					<language>
						<languagecode>en</languagecode>
						<languagename>English</languagename>
					</language>
					<language>
						<languagecode>sv</languagecode>
						<languagename>Swedish</languagename>
					</language>
				</languages>
				<flags count="2">
					<flag>
						<flagid>12372</flagid>
						<flagtext>Publish</flagtext>
						<flagcolour>ff0000</flagcolour>
					</flag>
					<flag>
						<flagid>12373</flagid>
						<flagtext>Executive Report</flagtext>
						<flagcolour>0000ff</flagcolour>
					</flag>
				</flags>				
			</details>	
		</project>
	</projects>
</silverbakk>

posts

Retrieve posts from project in impfactor or time order.

Request

GET /api/xml/posts.php?project=integer&order=string&count=integer&search=string
Host: silverbakk.com

Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0"?>		
<silverbakk version="1.3" name="posts">
	<created>2010-05-12 04:10:24</created>
	<projectid>12832905</projectid>
	<projectname>Svenska partier</projectname>		
	<posts>
		<post>			
			<id>88442392</id>
			<keywords>folkpartiet,centerpartiet</keywords>			
			<mediatype>microblog</mediatype>			
			<impfactor>15</impfactor>
			<published>2010-03-09 09:55:08</published>
			<created>2010-03-09 08:59:30</created>
			<title>isobelsverkstad</title>
			<content>@EsterAnais  jamen självklart! folkpartiet vs. centerpartiet</content>
			<url>http://twitter.com/isobelsverkstad/statuses/10211483322</url>
			<languagecode>sv</languagecode>
			<imageurl></imageurl>
			<flags></flags>
		</post>
		<post>			
			<id>88443338</id>
			<keyword>centerpartiet</keyword>			
			<mediatype>microblog</mediatype>			
			<impfactor>15</impfactor>
			<published>2010-03-09 09:35:39</published>
			<created>2010-03-09 09:09:00</created>
			<title>Centerpartiet</title>
			<content>Till media: Inbjudan till förhandsvisning av Centerpartiets jubileumsfilm 11/3 15:00  http://shar.es/mHIbW</content>
			<url>http://twitter.com/Centerpartiet/statuses/10211032946</url>
			<languagecode>sv</languagecode>
			<imageurl></imageurl>
			<flags>
				<flag>
					<flagid>37282</flagid>
					<flagtext>Publish</flagtext>
					<flagcolour>ff0000</flagcolour>
				</flag>	
				<flag>
					<flagid>12358</flagid>
					<flagtext>Executive report</flagtext>
					<flagcolour>ff00ff</flagcolour>
				</flag>					
			</flags>	
		</post>
	</posts>
</silverbakk>

postcount

Retrieve the number of posts from project during a specified interval.

Request

GET /api/xml/postcount.php?project=integer&days=integer&interval=string
Host: silverbakk.com

Response

<?xml version="1.0"?>
<silverbakk version="1.0" name="postcount">
	<created>2010-05-12 07:01:52</created>
	<projectid>12832905</projectid>
	<projectname>Svenska partier</projectname>		
	<summary>
		<posts>
			<count datetime="2010-05-12 00:00:00">2</count>
			<count datetime="2010-05-12 01:00:00">2</count>
			<count datetime="2010-05-12 02:00:00">0</count>
			<count datetime="2010-05-12 03:00:00">0</count>
			<count datetime="2010-05-12 04:00:00">0</count>
			<count datetime="2010-05-12 05:00:00">1</count>
			<count datetime="2010-05-12 06:00:00">2</count>
			<count datetime="2010-05-12 07:00:00">4</count>
			<count datetime="2010-05-12 08:00:00">0</count>
			<count datetime="2010-05-12 09:00:00">0</count>
			<count datetime="2010-05-12 10:00:00">0</count>
			<count datetime="2010-05-12 11:00:00">0</count>
			<count datetime="2010-05-12 12:00:00">0</count>
			<count datetime="2010-05-12 13:00:00">0</count>
			<count datetime="2010-05-12 14:00:00">0</count>
			<count datetime="2010-05-12 15:00:00">0</count>
			<count datetime="2010-05-12 16:00:00">0</count>
			<count datetime="2010-05-12 17:00:00">0</count>
			<count datetime="2010-05-12 18:00:00">0</count>
			<count datetime="2010-05-12 19:00:00">0</count>
			<count datetime="2010-05-12 20:00:00">0</count>
			<count datetime="2010-05-12 21:00:00">0</count>
			<count datetime="2010-05-12 22:00:00">0</count>
			<count datetime="2010-05-12 23:00:00">0</count>
		</posts>
	</summary>
	<keywords>	
		<keyword>
			<keywordname>centerpartiet</keywordname>
			<posts>
				<count datetime="2010-05-12 00:00:00">1</count>
				<count datetime="2010-05-12 01:00:00">1</count>
				<count datetime="2010-05-12 02:00:00">0</count>
				<count datetime="2010-05-12 03:00:00">0</count>
				<count datetime="2010-05-12 04:00:00">0</count>
				<count datetime="2010-05-12 05:00:00">1</count>
				<count datetime="2010-05-12 06:00:00">2</count>
				<count datetime="2010-05-12 07:00:00">0</count>
				<count datetime="2010-05-12 08:00:00">0</count>
				<count datetime="2010-05-12 09:00:00">0</count>
				<count datetime="2010-05-12 10:00:00">0</count>
				<count datetime="2010-05-12 11:00:00">0</count>
				<count datetime="2010-05-12 12:00:00">0</count>
				<count datetime="2010-05-12 13:00:00">0</count>
				<count datetime="2010-05-12 14:00:00">0</count>
				<count datetime="2010-05-12 15:00:00">0</count>
				<count datetime="2010-05-12 16:00:00">0</count>
				<count datetime="2010-05-12 17:00:00">0</count>
				<count datetime="2010-05-12 18:00:00">0</count>
				<count datetime="2010-05-12 19:00:00">0</count>
				<count datetime="2010-05-12 20:00:00">0</count>
				<count datetime="2010-05-12 21:00:00">0</count>
				<count datetime="2010-05-12 22:00:00">0</count>
				<count datetime="2010-05-12 23:00:00">0</count>
			</posts>
		</keyword>
		<keyword>
			<keywordname>folkpartiet</keywordname>
			<posts>
				<count datetime="2010-05-12 00:00:00">1</count>
				<count datetime="2010-05-12 01:00:00">1</count>
				<count datetime="2010-05-12 02:00:00">0</count>
				<count datetime="2010-05-12 03:00:00">0</count>
				<count datetime="2010-05-12 04:00:00">0</count>
				<count datetime="2010-05-12 05:00:00">0</count>
				<count datetime="2010-05-12 06:00:00">0</count>
				<count datetime="2010-05-12 07:00:00">4</count>
				<count datetime="2010-05-12 08:00:00">0</count>
				<count datetime="2010-05-12 09:00:00">0</count>
				<count datetime="2010-05-12 10:00:00">0</count>
				<count datetime="2010-05-12 11:00:00">0</count>
				<count datetime="2010-05-12 12:00:00">0</count>
				<count datetime="2010-05-12 13:00:00">0</count>
				<count datetime="2010-05-12 14:00:00">0</count>
				<count datetime="2010-05-12 15:00:00">0</count>
				<count datetime="2010-05-12 16:00:00">0</count>
				<count datetime="2010-05-12 17:00:00">0</count>
				<count datetime="2010-05-12 18:00:00">0</count>
				<count datetime="2010-05-12 19:00:00">0</count>
				<count datetime="2010-05-12 20:00:00">0</count>
				<count datetime="2010-05-12 21:00:00">0</count>
				<count datetime="2010-05-12 22:00:00">0</count>
				<count datetime="2010-05-12 23:00:00">0</count>
			</posts>
		</keyword>
	</keywords>
</silverbakk>

Error messages

Errors may occur if the supplied input parameters are incorrect or if there is an error while retrieving the information. Any error will result in an error message. The client are responsible for handling such errors.

Response

Bad Request

If the input parameters in the request are not within limits or contains illegal values, a 400 Bad Request will be returned. The error message contains information of the cause of the error.
HTTP/1.1 400 Bad Request
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0"?>
<silverbakk version="1.0" name="posts">
	<error>
		<code>471</code>
		<title>Bad request values</title>
		<description>The request value for parameter order must be either impfactor or recent.</description>
	</error>	
</silverbakk>

Internal errors

An internal error may occur if the information requested could not be retrieved or if the request resulted in no records. Please note that such error will not produce the 400 Bad Request HTTP header, it will be a normal 200 OK.
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0"?>
<silverbakk version="1.0" name="posts">
	<error>
		<code>570</code>
		<title>No result found</title>
		<description>No result could be produced with the specified parameters.</description>
	</error>	
</silverbakk>