Supported operations
The following operations are supported by the Silverbakk API.
- access - Retrieve information about your available projects
- posts - Retrieve posts from project in impfactor or time order
- postcount - Retrieve the number of posts from project during a specified interval.
access
Retrieve information about your available projects
Request
- details - Optional, String, If set to true, additional information is returned. Defaults to false.
GET /api/xml/access.php?details=string
Host: silverbakk.com
Response
- /silverbakk/projects/project/projectid - Integer, The internal ID of the project
- /silverbakk/projects/project/name - String, The name of the project
- /silverbakk/projects/project/description - String, The description of the project
- /silverbakk/projects/project/active - Integer, 1 if project is active, 0 if project is closed
- /silverbakk/projects/project/accesscomment - String, A comment about this entry
- /silverbakk/projects/project/details - Element, this element and its children is only supplied if request parameter details is set to true.
- /silverbakk/projects/project/details/keywords/keyword/keywordid - Integer, the ID of this keyword
- /silverbakk/projects/project/details/keywords/keyword/keywordname - String, the actual keyword
- /silverbakk/projects/project/details/keywords/keyword/uppercasesensitive - Integer, 1 if search is upper case sensitive, 0 otherwise
- /silverbakk/projects/project/details/keywords/keyword/includes/statement - String, The include statement.
- /silverbakk/projects/project/details/keywords/keyword/excludes/statement - String, The exclude statement.
- /silverbakk/projects/project/details/languages/language/languagecode - String, the ISO-639-1 language code.
- /silverbakk/projects/project/details/languages/language/languagename - String, the name of the language.
- /silverbakk/projects/project/details/flags/flag/flagid - Integer, the ID of the flag.
- /silverbakk/projects/project/details/flags/flag/flagtext - String, the name of the flag.
- /silverbakk/projects/project/details/flags/flag/flagcolour - String, the colour used for this flag in the GUI. Represented by hexadecimal triplet.
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
- project - Integer, the ID of the project
- order - String, the sort order. May be impfactor or recent. Other values will cause an error.
- count - Integer, the number of posts to retrieve. May be a value between 1 and 100. Other values will cause an error.
- search - Optional, String, string to search for.
- days - Optional, Integer, The number of days in the result. Minimum 1, Maximum 365, default to 14 if days is not supplied. Illegal values will result in an error.
- from - Optional, String, The date for the first result. Only used if days is not supplied. Format YYYY-MM-dd hh:mm:ss or YYYY-MM-dd. Must be specified if to is specified.
- to - Optional, String, The date for the last result. Only used if days is not supplied. Format YYYY-MM-dd hh:mm:ss or YYYY-MM-dd. Must be specified if from is specified.
- mediatype - Optional, String, The media of the posts. May be blog, microblog, image, video, forum, facebook, news or all. Defaults to all.
- languagecode - Optional, String, The language of the posts. Must be a valid ISO-639-1 code if supplied.
- keywordid - Optional, Integer, Only retrieve posts for the specified keywordid. Parameter project may be left out when this parameter is used.
GET /api/xml/posts.php?project=integer&order=string&count=integer&search=string
Host: silverbakk.com
Response
- /silverbakk/created - String, The date and time this file was created
- /silverbakk/projectid - Integer, The ID of this project
- /silverbakk/projectname - String, The name of the project
- /silverbakk/posts/post/id - Integer, The internal ID of the post
- /silverbakk/posts/post/keywords - String, The keyword (or keywords) that triggered this post
- /silverbakk/posts/post/mediatype - String, The media of the post. May be blog, microblog, image, video, forum, facebook or news.
- /silverbakk/posts/post/impfactor - Integer, The impfactor of the post, may be a value between 1 and 100.
- /silverbakk/posts/post/published - String, The date and time this post was published.
- /silverbakk/posts/post/created - String, The date and time this post was created in the system.
- /silverbakk/posts/post/title - String, The title of the post. For microblogs the title contains the user name.
- /silverbakk/posts/post/content - String, The content of the post. May not always be the full content.
- /silverbakk/posts/post/url - String, The external URL to the post.
- /silverbakk/posts/post/languagecode - String, The two letter ISO-639-1 language code.
- /silverbakk/posts/post/imageurl - String, A URL to a related image, if any.
- /silverbakk/posts/post/flags/flagid - Integer, The ID of the flag, if any
- /silverbakk/posts/post/flags/flagtext - String, The name of the flag, if any
- /silverbakk/posts/post/flags/flagcolour - String, The colour of the flag, if any
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
- project - Integer, the ID of the project
- interval - String, specifies whether result should be grouped by day or hour. Allowed values are day and hour. Illegal values will result in an error.
- days - Semioptional, Integer, The number of days in the result. Maximum 61 when interval is day or 7 when interval is hour. Illegal values will result in an error.
- from - Semioptional, String, The date for the first result. Only used if days is not supplied.
- to - Semioptional, String, The date for the last result. Only used if days is not supplied.
- languagecode - Optional, The language of the posts. Must be a valid ISO-639-1 code if supplied.
GET /api/xml/postcount.php?project=integer&days=integer&interval=string
Host: silverbakk.com
Response
- /silverbakk/created - String, The date and time this file was created
- /silverbakk/projectid - Integer, The ID of this project
- /silverbakk/projectname - String, The name of the project
- /silverbakk/summary/posts/count - Integer, the summed number of posts during the interval.
- /silverbakk/summary/posts/count@datetime - String, The datetime for the count. YYYY-MM-DD when interval is day. YYYY-MM-DD hh:mm:ss when interval is hour.
- /silverbakk/keywords/keyword/keywordname - String, The keyword for which the count is made.
- /silverbakk/keywords/keyword/posts/count - Integer, the number of posts during the interval.
- /silverbakk/keywords/keyword/posts/count@datetime - String, The datetime for the count. YYYY-MM-DD when interval is day. YYYY-MM-DD hh:mm:ss when interval is hour.
<?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
- /silverbakk/error/code - Integer, The error code
- /silverbakk/error/title - String, The title of the error.
- /silverbakk/error/description - String, The detailed description of the error and information on how to correct it.
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>