Purpose
This document outlines the API methods available, the parameters they receive and the results returned. The objective is to give an overall view of the possibilities available for integration with the Answerbase System.
Authentication
All API methods require that the clients API key is passed as a url parameter (methodname.aspx?apikey=xxxxxxx).
API Structure: Rest
The API attempts to conform to the design principles of Representational State Transfer (REST). All methods are invoked via an HTTP Request and returns a result as either XML or JSON.
Http Status Codes
The API attempts to return appropriate HTTP status codes for every request:
- 200 OK -- This status code will be returned when a successful request has been made.
- 400 Bad Request -- This status code will be returned if there is an issue with the submitted data. An error message will also be included in the response.
- 401 Not Authorized -- This status code will be returned if the API service is not enabled for the Answerbase site or if the incorrect credentials are submitted.
- 500 Internal Server Error -- This status code will be returned if there is an error with the API.
Parameters
Encoding
All data should be UTF-8 encoded.
Dates
All dates are passed and returned in the following format:
m/d/y h:M:s
ex: 9/27/2008 9:35:47
Format
You can have the result returned as either XML or JSON by passing the parameter "format" with the request.
For example:
http://clientanswerssite.com/api/getquestionslist.aspx?format=xml
or
http://clientanswerssite.com/api/getquestionslist.aspx?format=json
General Notes
Categories and Tags
In the administration site of your Answerbase Q&A site you have the feature preference option to choose whether you want to use “categories” or “tags” in your site. There are a range of methods that accept both "categories" and "tags" as parameters, but depending on your preference setting, only one of these will be relevant for your site. Likewise many methods can return both <categories> and <tags> and while for consistency both of those xml nodes are always returned, only the relevant one for your site is populated with data.
SSO UserId
Previously all methods requiring a user as parameter only accepted “username” as the identifier, but we have now (from v.3.8) expanded those methods to also accept “userid” and “sso_userid” as parameters to identify a user. “Userid” refers to our internal Answerbase unique id (which is available in the API and also in the administration site) and “sso_userid” refers to sites that have Single Sign On integration and need to pass their own unique id to identify users in the Answerbase site.
Data Objects
The following are common data objects and their xml structure that the API methods return. In the methods described further below, these common objects are just referenced by their name, i.e. [Short Question].
User
Example:
<user username="david" id="”4”" sso_userid=”xy878” displayName="goliath" firstname=”David” lastname=”Martinez” points="60" totalRank="5" questionsAnswered="0" staffexpert="true" expert=”false” imageUrl="http://xxx" profileUrl="http://xxx" topCategories=”Legal, Startups” topTags="" >
JSON:
Short Question
Example:
<question id="”2”" answersCount="3" url="http://xxx" publicationTime="11/27/2008 9:35:47 AM" latestAnswerTime="2/2/2009 11:25:38 AM" status="closed" type="public" …>
JSON:
{
Standard Api Methods
Get Questions List
Returns a list of questions based on a range of parameters.
URL: http://clientanswerssite.com/api/getquestionslist.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- keyword (optional): can be a single keyword or a group of keywords. The keywords will be searched for within the question title and description.
- closed (optional): “true”, “false”
- type (optional): “public”, “private” ("public" is default if nothing is specified)
- withanswers (optional): “true”, “false”
- withstaffanswers (optional): “true”, “false”
- productsku (optional): SKU of the related product
- contentUrl (optional): identify the related content URL to pull questions associated with that specific URL through the “Related Content” features.
- username or sso_userid or userid or useremail (optional): Filters by the author of the questions. Username, userid and useremail are the Answerbase values, sso_userid is the clients own userid
- questionIds (optional): one or more question IDs, separated by a comma
- orderby (optional):
- “newest”: sorts with the newest published questions first.
- “toprated”: sorts the questions based on the amount of votes the answers have received. The highest amount of votes is first.
- “closetime”: sorts with the most recently closed questions first.
- “mostpopular”: sorts by number of views all time with the highest first.
- “recentlypopular”: sorts by number of views within the last 30 days with the highest first.
- “recentlyactive”: sorts with the most recently active questions first (where active means having comments or answers published).
- “recentlyanswered”: sorts with the most recently answered questions first.
- startindex (optional): the starting element to be returned (useful for paging). 0 = the first element
- maxresults (optional): the maximum amount of results returned. 0 = all results.
- fullquestiondetails (optional): if "true", returns full details of each question including the question as well as all answers, comments and attachments ("false" is default if nothing is specified)
- includeUnpublishedAnswers (optional): "false" is default
- includeUnpublishedComments (optional): "false" is default
- categoryoperator (optional): "AND"/"OR", defines if multiple categories/tags have to be associated with the questions with ALL or ANY category/tag. ("AND" is default)
- includeSubCategories (optional): if "false" only questions associated directly with the category will be returned. Per default "true" and all questions associated with the category and it's subcategories will be returned.
Example:
Returns:
A list of questions and for each question the best answer if any exists and the related expert. Also a collection of the categories that were used as criteria is returned along with their respective url’s. If the Full Questions Details parameter is specified and its value is "true", the ShortQuestion structure will be extended to include comments, answers, attachments, and related contents (the topAnswer element will not be present).
Example:
Search Questions
Returns a list of questions that matches the parameters passed. Contrary to the GetQuestionsList method, this method uses the search index, not the database directly, and takes into account similarities, typing errors, keyword proximity etc.
URL: http://clientanswerssite.com/api/searchquestions.aspx
Method: GET
Parameters:
- keywords (required): can be a single keyword or a group of keywords. The keywords will be searched for within the question title and description.
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- closed (optional): “true”, “false”
- staffanswersfirst (optional): “true”, “false” - sort the results with the questions with staff answers first
- searchanswers (optional): “true”, “false” - include the answers as base of the similarity score
- mostrecentfirst (optional): “true”, “false” - sort the results with the most recent questions first. If "staffanswersfirst" is set, that has precedence.
- startindex (optional): the starting element to be returned (useful for paging). 0 = the first element
- maxresults (optional): the maximum amount of results returned. If set to 0, 500 results are returned.
Example:
Returns:
A list of questions and for each question the best answer if any exists and the related expert.
Example:
Get Similar Questions
Returns a list of questions similar to the keywords passed, based on a range of parameters. This method uses the search index, not the database directly, and takes into account similarities, typing errors, keyword proximity etc.
URL: http://clientanswerssite.com/api/getsimilarquestions.aspx
Method: GET
Parameters:
- keywords (required): can be a single keyword or a group of keywords. The keywords will be searched for within the question title and description.
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- closed (optional): “true”, “false”
- withanswers (optional): “true”, “false”
- staffanswersfirst (optional): “true”, “false” - sort the results with the questions with staff answers first
- searchanswers (optional): “true”, “false” - include the answers as base of the similarity score
- maxresults (optional): the maximum amount of results returned. If set to 0, 50 results will be returned.
Example:
Returns:
A list of questions and for each question the best answer if any exists and the related expert.
Example:
Get Question
Returns the question details for the questionid provided.
URL: http://clientanswerssite.com/api/getquestion.aspx
Method: GET
Parameters:
- questionid: the id of the question.
- includeUnpublishedAnswers (optional): “true”, “false” - include unpublished answers ("false" is default if nothing is specified).
Returns:
question with all the answers associated.
Get Featured Question
Returns a random featured question associated with one or more of the categories. If no categories are specified, the random question will be picked from the entire pool of featured questions.
URL: http://clientanswerssite.com/api/getfeaturedquestion.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
Returns:
A question with the top answer (if any) and the related expert.
Get Featured Questions
Returns all the featured questions related to the specified categories/tags, product, and/or content URL. If no categories, product or content URL are passed, all featured questions in the database will be returned.
URL: http://clientanswerssite.com/api/getfeaturedquestions.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- productsku (optional): SKU of the related product
- contentUrl (optional): the URL of a related content.
- orderby (optional):
- “random”: the result should be random from all featured questions, the default is by the questions publication date in reverse chronological order.
- “mostpopular”: sorts by number of views all time with the highest first.
- “recentlypopular”: sorts by number of views within the last 30 days with the highest first.
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions and for each question the best answer if any exists and the related expert. Also a collection of the categories that were used as criteria is returned along with their respective url’s.
Get Updated Questions
Returns all the questions that have been changed since the “asOfDate”. A list of deleted questions can be included. This method can be used when the client wants to maintain a search index of all the questions.
URL: http://clientanswerssite.com/api/getupdatedquestions.aspx
Method: GET
Parameters:
- productsku (optional): SKU of the related product
- asofdate (optional): the date since which the questions have been updated.
- showdeleted (optional): “true”, “false”. If not specified it defaults to “no”. Deleted questions will only include the question id and the “<deleted>true</deleted>” node. The parameter “asofdate” is required if “showdeleted” is used.
- username or sso_userid or userid (optional): This parameter allows you to narrow the questions that have been changed since the “asOfDate” to those asked by a user you specify here. The username and userid are the Answerbase values, sso_userid is the clients own userid. This does not control the list of deleted questions which will return all questions deleted since the asofdate.
Example:
Returns:
A list of questions and for each question the best answer if any exists and the related expert. The question data are only returned if the question has not been deleted.
Get Recently Viewed Questions By User
Returns a list of questions that the specific user has visited recently. Only the questions viewed when the user is logged in are registered.
URL: http://clientanswerssite.com/api/getquestionsviewedbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions
Get Questions Asked By User
Returns all the questions asked by the user sorted by publication time (most recent first).
URL: http://clientanswerssite.com/api/getquestionsaskedbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
- open (optional): “true”, “false”
- type (optional): “public”, “private” ("public" is default if nothing is specified)
Example:
Returns:
A list of questions
Get Questions Answered By User
Returns all the questions answered by the user, with the most recently answered questions first.
URL: http://clientanswerssite.com/api/getquestionsansweredbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions
Get Questions with Highest Rated Answers By User
Sorts all the answers by the user by the ratings they have received, highest first, and returns a list of questions the answers were posted for.
URL: http://clientanswerssite.com/api/getquestionswithhighestratedanswersbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions
Get Questions Followed By User
Returns the questions the user is currently following.
URL: http://clientanswerssite.com/api/getquestionswatchedbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
Example:
Returns:
A list of questions
Get Questions Commented By User
Returns all the questions commented by the user or questions where answers have been commented by the user.
URL: http://clientanswerssite.com/api/getquestionscommentedbyuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions
Get Questions Asked Directly to User
Returns all the questions asked directly to the user.
URL: http://clientanswerssite.com/api/getquestionsaskeddirectlytouser.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- maxresults (optional): the maximum amount of results returned. 0 = all results.
Example:
Returns:
A list of questions
Get Answer
Returns a specific answer.
URL: http://clientanswerssite.com/api/getanswer.aspx
Method: GET
Parameters:
- answerid – the Answerbase internal id
Example:
Returns:
An answer with the related question and the expert that posted the answer.
Example:
Get Comment
Returns a specific comment.
URL: http://clientanswerssite.com/api/getcomment.aspx
Method: GET
Parameters:
- commentid – the Answerbase internal id
Example:
Returns:
A comment with the related question or answer and the member that posted the comment.
Example:
Get Top Experts
Returns the experts that earned most points within the specified parameters. If no parameters are specified, the overall top experts are returned. The experts are sorted by highest points first.
URL: http://clientanswerssite.com/api/gettopexperts.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- fromdate (optional)
- todate (optional)
- featured (optional)
- startindex (optional): the starting element to be returned (useful for paging). 0 = the first element
- maxresults (optional)
Example:
Returns:
A list of users
Example:
Get Staff Experts
Returns a list of users with the Staff Expert role associated.
URL: http://clientanswerssite.com/api/getstaffexperts.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- maxresults (optional)
Example:
Returns:
A list of users
Get User
Returns a user with the specified username, id or sso id.
URL: http://clientanswerssite.com/api/getuser.aspx
Method: GET
Parameters:
- username or sso_userid or userid or useremail (required): username, userid and useremail are the Answerbase values, sso_userid is the clients own userid
Example:
Returns:
A user with a list of categories he/she earned points in.
Example:
Get User Point Summary
Returns the point details for a user with the specified username.
URL: http://clientanswerssite.com/api/getuserpoints.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
Example:
Returns:
A user with the different points he/she has earned.
Example:
Get User Subscriptions
Returns the list of categories or tags that the user is subscribed to.
URL: http://clientanswerssite.com/api/getusersubscriptions.aspx
Method: GET
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
Example:
Returns:
A user with a list of categories or tags he/she is subscribed to.
Example:
Get Users
Searches for users matching the criteria passed. The result is ordered by the users total points earned descending.
URL: http://clientanswerssite.com/api/getusers.aspx
Method: GET
Parameters:
- keywords (optional): matches username, id, firstname or lastname
- startindex (optional): the starting element to be returned (useful for paging). 0 = the first element
- maxresults (optional)
Example:
Returns:
A list of users
Example:
Get Featured Expert
Returns a random featured expert related to at least one of the categories passed. If no categories are specified, then the expert will be chosen from the entire pool of featured experts.
URL: http://clientanswerssite.com/api/getfeaturedexpert.aspx
Method: GET
Parameters:
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
Example:
Returns:
A user with a list of categories he/she earned points in.
Get Categories
Returns a list of categories.
URL: http://clientanswerssite.com/api/getcategories.aspx
Method: GET
Parameters:
- restrictToFirstLevel (optional): if set to "true" returns only one level of categories, without the child categories associated
- orderby (optional): "adminorder" - orders by the order set by the administrators. "questionscount" - orders by the amount of questions associated to each category.
- maxresults (optional)
Example:
Returns:
A collection of categories and childcategories (if they exist).
Get Category
Returns the requested category.
URL: http://clientanswerssite.com/api/getcategory.aspx
Method: GET
Parameters:
-
Use one of these (mandatory):
- categoryid: the answerbase category id
- categoryExternalId: the clients own category id
Example:
Returns:
A category.
Get Tags
Returns a list of tags.
URL: http://clientanswerssite.com/api/gettags.aspx
Method: GET/POST
Parameters:
- orderby (optional): "adminorder" - orders by the order set by the administrators. "questionscount" - orders by the amount of questions associated to each tags.
- maxresults (optional)
Example:
Returns:
A collection of tags.
Get Tag
Returns the requested category.
URL: http://clientanswerssite.com/api/gettag.aspx
Method: GET/POST
Parameters:
-
Use one of these (mandatory):
- tagid: the answerbase tag id
- tagExternalId: the clients own tag id
Example:
Returns:
A tag.
Search Tags
Returns a list of tags.
URL: http://clientanswerssite.com/api/searchtags.aspx
Method: GET
Parameters:
- keywords (optional): can be a single keyword or a group of keywords.
- maxresults (optional)
Example:
Returns:
A collection of tags.
Advanced API Methods
Ask Question
Allows a question to be submitted to the application.
URL: http://clientanswerssite.com/api/askquestion.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- question (required): the question title text (max. 150 characters)
- details (optional) – the question body text
- type (optional) – public/private
- expertAskedUsername (optional) – the expert’s username in Answerbase
- questionexternalurl (optional) – for sites using Answerbase via API only, this can be set so that notifications going out, lead the users to the correct question url.
- publishDateTime (optional) – the specific time the question was posted. Format: YYYY-MM-DD hh:mm
- attachments (optional) – files related to the question. These are read from the “Request.Files” collection.
- productsku (optional) - SKU of the related product (max. 100 characters length)
Returns:
The question id of the created question
Register User
Allows a user to be registered in the application.
URL: http://clientanswerssite.com/api/registeruser.aspx
Method: POST
Parameters:
- username (required): the username for the user (recommended max. 30 characters length)
- password (required): the password for the user
- email (required): the email for the user
- firstName (optional): the first name of the user
- lastName (optional): the last name of the user
- displayName (optional): the display name of the user
- aboutMe (optional): the profile for the user
- title (optional): the title of the user
- organization (optional): the organization or company for the user
- address (optional): the address of the user
- city (optional): the city of the user
- region (optional): the region of the user
- country (optional): the country of the user
- website (optional): the website for the user
- askDirectlyAllowed (optional): whether the user can be asked questions directly - “true”, “false”
- profileEmail (optional): the profile email for the user - publicly available
- homeNumber (optional): the home telephone number for the user
- officeNumber (optional): the office telephone number for the user
- mobileNumber (optional): the mobile telephone number for the user
- faxNumber (optional): the fax number for the user
- facebookUrl (optional): the Facebook URL for the user
- twitterUrl (optional): the Twitter URL for the user
- linkedInUrl (optional): the LinkedIn URL for the user
- googleUrl (optional): the Google URL for the user
- customField[FIELD-ID] (optional): the value for the custom profile field whose ID is [FIELD-ID] (parameter name example: "customField54"). You can find the appropriate Field ID in the General Settings of your admin site, by hovering over the custom field name.
- sso_userId (optional): the client SSO unique user id
- externalProfileImageUrl (optional): A url linking to the users profile image (if not managed on Answerbase)
Returns:
The user id of the created user
Remove Followed Question
Allows a followed question to be deleted from a specified users list.
URL: http://clientanswerssite.com/api/removewatchedquestion.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- questionId (required): the Id of the question.
Returns:
Nothing is returned from this method.
Add User Subscriptions
Adds category or tag subscriptions for a user.
URL: http://clientanswerssite.com/api/addusersubscriptions.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
-
for products, use one of these (optional):
- products: one or more product names, separated by commas
- productIds: one or more product IDs, separated by commas.
- productExternalIds: one or more product external IDs, separated by commas.
- productskus: one or more product SKUs, separated by commas.
Returns:
Nothing is returned from this method.
Remove User Subscriptions
Removes a user’s specified category or tag subscriptions.
URL: http://clientanswerssite.com/api/removeuserubscriptions.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
-
for categories, use one of these (optional):
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these (optional):
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
-
for products, use one of these (optional):
- products: one or more product names, separated by commas
- productIds: one or more product IDs, separated by commas.
- productExternalIds: one or more product external IDs, separated by commas.
- productskus: one or more product SKUs, separated by commas.
Returns:
Nothing is returned from this method.
Report Question
Allows a question to be flagged for review.
URL: http://clientanswerssite.com/api/reportquestion.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- questionId (required): the Id of the question.
Returns:
Nothing is returned from this method.
Report Answer
Allows an answer to be flagged for review.
URL: http://clientanswerssite.com/api/reportanswer.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- answerId (required): the Id of the answer.
Returns:
Nothing is returned from this method.
Report Comment
Allows a comment to be flagged for review.
URL: http://clientanswerssite.com/api/reportcomment.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- commentId (required): the Id of the comment.
Returns:
Nothing is returned from this method.
Post Answer
Allows an answer to be submitted to the application.
URL: http://clientanswerssite.com/api/postanswer.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- questionId (required): the Id of the question
- answer (required): the answer text
- source (optional): the answer source text
- staffAnswer (optional): “true”, “false”
- attachments (optional): files related to the answer. These are read from the “Request.Files” collection.
- publishDateTime (optional) – the specific time the answer was posted. Format: YYYY-MM-DD hh:mm
Returns:
The answer id of the posted answer
Post Comment
Allows a comment to be submitted to the application.
URL: http://clientanswerssite.com/api/postcomment.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- postId (required): the Id of the question or answer that the comment is related to.
- comment (required): the comment text
- published (optional): “true”, “false” ("true" is default if nothing is specified)
- publishDateTime (optional) – the specific time the comment was posted. Format: YYYY-MM-DD hh:mm
Returns:
The comment id of the posted comment
Post Related Content
Allows you to associate “related content” to specific questions.
URL: http://clientanswerssite.com/api/postrelatedcontent.aspx
Method: POST
Parameters:
- postId (required): the Id of the question that the content is related to.
- contentTitle (required): the title to be used for the “related content” link
- contentUrl (required): the destination URL to be used for the “related content” link
Returns:
The id of the posted content
Post Image
Allows you to post an image to be used in new questions or answers.
URL: http://clientanswerssite.com/api/postimage.aspx
Method: POST
Parameters:
- image (required): image file. It will be read from the “Request.Files” collection.
- imageWidth (optional): if specified, the image will be resized based on given width.
- imageHeight (optional): if specified, the image will be resized based on given height
Returns:
The url of the posted image
Vote Answer
Allows a user to vote for an answer.
URL: http://clientanswerssite.com/api/voteanswer.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- answerId (required): the Id of the answer
- rating (required): the rating assigned to the answer – “1”, “-1”
Returns:
The result of the vote, whether it was successful or not.
Vote Comment
Allows a user to vote for a comment. Only positive votes (likes) are allowed.
URL: http://clientanswerssite.com/api/votecomment.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- commentId (required): the Id of the comment
- rating (required): the rating assigned to the comment – “1”
Returns:
The result of the vote, whether it was successful or not.
Update Question
Allows a question to be updated.
Note that the categories/tags passed replace the existing associated categories/tags, so they need to be passed even if they aren't updated as otherwise they will be removed from the question.
URL: http://clientanswerssite.com/api/updatequestion.aspx
Method: POST
Parameters:
- questionid: the id of the question.
-
for categories, use one of these:
- categories: one or more category names, separated by commas.
- categoryIds: one or more category IDs, separated by commas.
- categoryExternalIds: one or more category external IDs, separated by commas.
-
for tags, use one of these:
- tags: one or more tag names, separated by commas
- tagIds: one or more tag IDs, separated by commas.
- tagExternalIds: one or more tag external IDs, separated by commas.
- question (optional): the question title text
- details (optional) – the question body text
- type (optional) – public/private
- questionexternalurl (optional) – for sites using Answerbase via API only, this can be set so that notifications going out, lead the users to the correct question url.
- productsku (optional) - SKU of the related product
- closed (optional): “true”, “false” - change the open/close status of the question
- publishDateTime (optional) – the specific time the question was posted. Format: YYYY-MM-DD hh:mm
Returns:
Nothing is returned from this method.
Update Answer
Allows an answer to be updated.
URL: http://clientanswerssite.com/api/updateanswer.aspx
Method: POST
Parameters:
- answerid: the id of the answer.
- answer (optional): the answer text
- source (optional): the answer source text
- staffAnswer (optional): “true”, “false”
- published (optional): “true”, “false”
- selectAsBest (optional): “true”, this can not be undone
- publishDateTime (optional) – the specific time the answer was posted. Format: YYYY-MM-DD hh:mm
Returns:
Nothing is returned from this method.
Update Comment
Allows a comment to be updated.
URL: http://clientanswerssite.com/api/updatecomment.aspx
Method: POST
Parameters:
- commentid (required): the Answer internal id
- comment (optional): the comment text
- published (optional): “true”, “false”
- publishDateTime (optional) – the specific time the comment was posted. Format: YYYY-MM-DD hh:mm
Returns:
Nothing is returned from this method.
Update User Data
Allows a user’s data to be updated.
URL: http://clientanswerssite.com/api/updateuserdata.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- email (optional): the email for the user
- password (optional): the users password
- firstName (optional): the first name of the user
- lastName (optional): the last name of the user
- displayName (optional): the display name of the user
- aboutMe (optional): the profile for the user
- title (optional): the title of the user
- organization (optional): the organization or company for the user
- address (optional): the address of the user
- city (optional): the city of the user
- region (optional): the region of the user
- country (optional): the country of the user
- website (optional): the website for the user
- askDirectlyAllowed (optional): whether the user can be asked questions directly - “true”, “false”
- profileEmail (optional): the profile email for the user - publicly available
- homeNumber (optional): the home telephone number for the user
- officeNumber (optional): the office telephone number for the user
- mobileNumber (optional): the mobile telephone number for the user
- faxNumber (optional): the fax number for the user
- facebookUrl (optional): the Facebook URL for the user
- twitterUrl (optional): the Twitter URL for the user
- linkedInUrl (optional): the LinkedIn URL for the user
- googleUrl (optional): the Google URL for the user
- customField[FIELD-ID] (optional): the value for the custom profile field whose ID is [FIELD-ID] (parameter name example: "customField54"). You can find the appropriate Field ID in the General Settings of your admin site, by hovering over the custom field name.
- externalProfileImageUrl (optional): A url linking to the users profile image (if not managed on Answerbase)
Returns:
Nothing is returned from this method.
Update User Permissions
Allows a user’s permissions to be updated.
URL: http://clientanswerssite.com/api/updateuserpermissions.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- grantedAccess (optional): sets the access permission for the user
- postQuestionsAllowed (optional): allows the user to post questions
- postAnswersAllowed (optional): allows the user to post answers
- allowLinks (optional): allows the user to submit content with external links
- allowLinksFollow (optional): allow the links that the user submits within content to be followed by search engines
- featured (optional): features the user
- visibleOnLists (optional): allows the user to be shown on the leaderboards and lists
- allowPublicProfile (optional): allows the user to have a public profile page
- isTrusted (optional): identify this user as a trusted member for anti-spam purposes
- allowDirectQuestions (optional): allows the user to receive direct questions by other users on the system
Returns:
Nothing is returned from this method.
Update Email Settings
Allows you to update the email notification settings for each user.
URL: http://clientanswerssite.com/api/updateuseremailsettings.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- answerNewAnswersNotification (optional): Indicates whether the user will receive an email notification if an new answer is submitted to a question which has been answered by the user - “true”, “false”
- questionNewAnswersNotification (optional): Indicates whether the user will receive an email notification if an new answer is submitted to a question that has been asked by the user - “true”, “false”
- answerAcceptedNotification (optional): Indicates whether the user will receive an email notification if an answer submitted by the user is selected as the “best” answer - “true”, “false”
- watchedQuestionsNotification (optional): Indicates whether the user will receive an email notification if a question they are following receives a new answer - “true”, “false”
- questionCommentsAfterNotification (optional): Indicates whether the user will receive an email notification if a comment is submitted to a question the user has commented on - “true”, “false”
- questionNewCommentsNotification (optional): Indicates whether the user will receive an email notification if the users question receives a comment - “true”, “false”
- answerCommentsAfterNotification (optional): Indicates whether the user will receive an email notification if a comment is submitted to an answer the user has commented on - “true”, “false”
- answerNewCommentsNotification (optional): Indicates whether the user will receive an email notification if an answer by the user receives a new comment - “true”, “false”
- watchedQuestionsNewCommentsNotification (optional): Indicates whether the user will receive an email notification if a question they are following receives a new comment - “true”, “false”
- questionNewAnswerCommentsNotification (optional): Indicates whether the user will receive an email notification if a comment is submitted to an answer of a question the user has asked - “true”, “false”
Returns:
Nothing is returned from this method.
Follow Question
Allows a user to follow the specified question.
URL: http://clientanswerssite.com/api/watchquestion.aspx
Method: POST
Parameters:
- username or sso_userid or userid (required): username and userid are the Answerbase values, sso_userid is the clients own userid
- questionId (required): the Id of the question
Returns:
Nothing is returned from this method.
Log Pageview
Logs a pageview for the specified question.
URL: http://clientanswerssite.com/api/logpageview.aspx
Method: POST
Parameters:
- questionId (required): the Id of the question
- username or sso_userid or userid (optional): username and userid are the Answerbase values, sso_userid is the clients own userid
- pagename (optional): the name or url of the page
- querystring (optional)
- referrer (optional)
- ipaddress (optional)
- useragent (optional)
Returns:
Nothing is returned from this method.
Log Pageview
Logs a pageview for the specified question.
URL: http://clientanswerssite.com/api/logpageview.aspx
Method: POST
Parameters:
- questionId (required): the Id of the question
- username or sso_userid or userid (optional): username and userid are the Answerbase values, sso_userid is the clients own userid
- pagename (optional): the name or url of the page
- querystring (optional)
- referrer (optional)
- ipaddress (optional)
- useragent (optional)
Returns:
Nothing is returned from this method.
Log Pageview
Logs a pageview for the specified question.
URL: http://clientanswerssite.com/api/logpageview.aspx
Method: POST
Parameters:
- questionId (required): the Id of the question
- username or sso_userid or userid (optional): username and userid are the Answerbase values, sso_userid is the clients own userid
- pagename (optional): the name or url of the page
- querystring (optional)
- referrer (optional)
- ipaddress (optional)
- useragent (optional)
Returns:
Nothing is returned from this method.
Update Category
Allows a category to be updated.
URL: http://clientanswerssite.com/api/updatecomment.aspx
Method: POST
Parameters:
- commentid (required): the Answer internal id
- comment (optional): the comment text
- published (optional): “true”, “false”
- publishDateTime (optional) – the specific time the comment was posted. Format: YYYY-MM-DD hh:mm
Returns:
Nothing is returned from this method.
Change Log
Version 6.3 (No breaking changes)
- Update the methods Ask Question, Post Comment, Post Answer, Update Question, Update Answer and Update Comment to allow passing a past publish date/time.
Version 6.2 (No breaking changes)
- Update the methods Register User and Update User Data to allow passing an external image profile url.
Version 6.1 (No breaking changes)
- Update the method Register User to return the user id after succesfull creation.
- Fixed a bug where the Get User method would not return the user if it wasn't granted access.
Version 6.0 (Breaking changes)
- Added the method Update User Permissions to manage the users personal settings.
- Added the methods Get Tag, Get Tags
- Method Get Answer was updated adding the properties "isBestAnswer" and "id" to the result.
- Method Get Answer and Get Question and Get Questions List was updated allowing the parameter "includeUnpublishedComments"
- Method Get Questions List was updated allowing the parameter "includeUnpublishedAnswers"
- Fixed bug with Update Answer method where Source could not be reset
- The methods Search Questions and Get Similar Questions now allow passing categories and tags as parameters.
- Added DisplayName as parameter for the Register User and Update User Data methods.
- Added user as parameter for the Get Questions List in order to filter by question author.
- The methods Get Question and "Get Featured Question" now returns the categories and tags associated with the question.
- Returns the result of a vote submitted for an answer or a comment
- Fixed bug with timestamps where they weren't taking the timezone into account: Badge-date, Answer/Comment-publicationtime, question-publicationtime/latestanswertime
- Unified the user data returned in these methods: Get Staff Experts, Get Top Experts, Get Users. Now displayName, TotalRank and askQuestionUrl is returned for all as well.
- Fixed bug where the questions count on the Search Questions method was not correct all the time.
- Fixed a bug in the method Update Question where if a category parameter is not passed, it would delete the existing categories associated.
- [Short Question] now returns the parameters displayName and sso_userid as well.
- The methods Get Top Experts, Get Staff Experts and Get Users all return a TopTags property of the user, apart from the TopCategories that already existed.
- The method Get User now return the tags the user has earned points also.
- Renamed "Add User Category Subscriptions" to Add User Subscriptions since both categories and tags can be passed simultaneously now.
- Renamed "Get User Category Subscriptions" to Get User Subscriptions and the method is now returning categoreis and tags separately.
- The method Get Featured Expert now returns the points earned for tags, seperately from the categories.
- The data object [EXPERT] was replaced with [USER] adding a range of extra properties and unifying the user data throughout the methods.
- The method Get Question now returns the [USER] data object instead of the "author" providing more properties for the user that created the question.
Version 5.7 (No breaking changes)
- Added method Post Image
- Added "published" property to results of methods returning comments
- Added "published" parameter to method Post Comment
- Added method Update Comment
- Added "followers" property to Short Question data structure
- Added options "recentlyactive" and "recentlyanswered" to parameter "orderby" of method Get Questions List
- Added parameters "organization", "address", "city", "facebookUrl", "twitterUrl", "linkedInUrl", "googleUrl", and "customField[FIELD-ID]" to methods Register User and Update User Data
- Added properties "organization", "address", "city", "facebookUrl", "twitterUrl", "linkedInUrl", "googleUrl", and "customFields" to results of methods Get User, Get Users, Get Top Experts, Get Staff Experts, and Get Featured Expert
Version 5.6 (No breaking changes)
- Added "source" property to answers
Version 5.5 (No breaking changes)
- Added method Update Answer
- Added "published" property to results of methods returning answers
- Added "includeUnpublishedAnswers" parameter to method Get Question
- Added "username or sso_userid or userid" parameter to method Get Updated Questions
- Added "closed" parameter to method Update Question
- Added "product" parameter to methods Add User Category Subscriptions and Remove User Category Subscriptions
- Added "questionIds" parameter to method Get Questions List
Version 5.4 (No breaking changes)
- Added method Update Question
Version 5.3 (No breaking changes)
- Added category "externalId" property to all methods returning categories
Version 5.2 (No breaking changes)
- Added Full Question Details parameter to the method Get Questions List
- Added isBestAnswer property to results of method Get Question and method Get Questions List
Version 5.1 (No breaking changes)
- Added the methods Get Category, Get Categories and Search Tags
- Added Question Type parameter (public/private) for all relevant methods
- Added the parameter ExternalQuestionUrl to the Ask Question method
Version 5 (No breaking changes)
- Added paging to the methods: "GetQuestionsList", "GetTopExperts" and "GetUsers"
- All methods accepting category names as parameters now accept also category IDs and category external IDs
- Added the Get Similar Questions method
- Added the methods Add User Category Subscriptions and Remove User Category Subscriptions and removed the "Update User Category Subscriptions" (still works for backwards compatibility).
- Added the method Search Questions
- Changed boolean values from "yes"/"no" to "true"/"false" (the old values are still accepted for backwards compatibility)
Version 4.1 (No breaking changes)
- Added “contents” to method Get Question
- Added “contentUrl” parameter to “Get Questions List” method
- Added “contentUrl” parameter to “Get Featured Questions” method
- Added “Post Related Content” method
Version 4.0 (No breaking changes)
- Added “sso_userid” and "categories" to method Get Question
- Added “badges” to method Get User
Version 3.9 (No breaking changes)
- Added “id” and “sso_userid” to all methods returning users
- Added “details”, “categories”, “followerCount” and “author” to all methods returning a list of questions
- Changed terminology of Watch Question to Follow Question
Version 3.8 (No breaking changes)
- Adjust to accept tags as parameters
- Add sso_userid and userid as parameters to all methods accepting username
- Make question details on Post Question optional
- Fix bug when posting a question that required tags to already exist