Forums

Forum Groups

 

GET /api/forums.ashx/forumgroups/

Response

Status: 200 OK
<ForumGroupList>
<ForumGroup>
... </ForumGroup>
...
</ForumGroupList>

GET /api/forums.ashx/forumgroups/{Id}

Response

Status: 200 OK
<ForumGroup>
...
</ForumGroup>

Create

POST /api/forums.ashx/forumgroups/

Request

<ForumGroup>
...
</ForumGroup>

Response

Status: 201 CREATED
<ForumGroup>
...
</ForumGroup>

Update

PUT /api/forums.ashx/forumgroups/{Id}

Request

<ForumGroup>
...
</ForumGroup>

Response

Status: 200 OK
<ForumGroup>
...
</ForumGroup>

Delete

DELETE /api/forums.ashx/forumgroups/{Id}

Response

Status: 200 OK

 

 

Forums

GET /api/forums.ashx/forums/

Response

Status: 200 OK
<ForumList PageSize="20" PageIndex="0" TotalCount="2"> <Forum> ... </Forum> ... </ForumList>

 

GET /api/forums.ashx/forumgroups/{Id}/forums/

Returns a list of Forums which are members of the specified forumgroup.

Response

Status: 200 OK
<ForumList PageSize="20" PageIndex="0" TotalCount="1"> <Forum> ... </Forum> ... </ForumList>

 

GET /api/forums.ashx/forums/{forum query parameters}

Returns a list of Forums which match the query parameters provided on the querystring.

Response

Status: 200 OK
<ForumList PageSize="20" PageIndex="0" TotalCount="2"> <Forum> ... </Forum> ... </ForumList>

 

GET /api/forums.ashx/forums/{Id}

Response

Status: 200 OK

<Forum> ... </Forum>

Create Forum

POST /api/forums.ashx/[forumgroups/{Id}/]forums/

Request

<Forum>
  ...
</Forum>

Note the ForumGroupInfo object can be omitted if you pass the desired Forum Group Id into the URI Context by posting to /api/forums.ashx/forumgroups/{GroupId}/forums

Minimum required fields (Name, Key, and ForumGroupInfo.Id)

Response

Status: 201 CREATED

<Forum> ... </Forum>

Update Forum

PUT /api/forums.ashx/forums/{Id}

Request

<Forum>
 ...
</Forum>

Response

Status: 200 OK
<Forum> ... </Forum>

Delete Forum

DELETE /api/forums.ashx/forums/{Id}

Response

Status: 200 OK

 

Threads

List

GET /api/forums.ashx/forums/{Id}/threads

Response

Status: 200 OK
<ThreadList PageSize="20" PageIndex="0" TotalCount="1"> <Thread> ...
</Thread> ... </ThreadList>

GET /api/forums.ashx/threads/{thread query parameters}

Returns a list of Threads which match the query parameters provided on the querystring.

Response

Status: 200 OK
<ThreadList PageSize="20" PageIndex="0" TotalCount="1"> <Thread> ...
</Thread> ... </ThreadList>

GET /api/forums.ashx/threads/{Id}

Response

Status: 200 OK
<Thread> ...
</Thread>

Create Thread

POST /api/forums.ashx/[forums/{ForumId}/]threads/

Response

<ForumPost>
   ...
</ForumPost>

Note the ForumInfo object can be omitted if you pass the desired Forum Id into the URI Context by posting to /api/forums.ashx/forum/{ForumId}/threads

Response

Status: 201 CREATED
<Thread> ...
</Thread>

Update Thread

PUT /api/forums.ashx/threads/{Id}

Request

<Thread>
   ...
</Thread>

Response

Status: 200 OK
<Thread> ...
</Thread>

Delete Thread

DELETE /api/forums.ashx/threads/{Id}

Response

Status: 200 OK

 

ForumPosts

GET /api/forums.ashx/threads/{Id}/posts

Response

Status: 200 OK
<ForumPostList PageSize="20" PageIndex="0" TotalCount="1"> <ForumPost> ...
</ForumPost> ... </ForumPostList>

 

GET /api/forums.ashx/posts/{post query parameters}

Returns a list of Posts which match the query parameters provided on the querystring.

Response

Status: 200 OK
<ForumPostList PageSize="20" PageIndex="0" TotalCount="1"> <ForumPost> ...
</ForumPost> ... </ForumPostList>

 

GET /api/forums.ashx/posts/{Id}/replies

Returns a list of ForumPosts which are direct replies of the of the specified post.

Response

Status: 200 OK
<ForumPostList PageSize="20" PageIndex="0" TotalCount="1"> <ForumPost> ...
</ForumPost> ... </ForumPostList>

GET /api/forums.ashx/posts/{Id}

Response

Status: 200 OK
<ForumPost> ...
</ForumPost>

Create ForumPost

POST /api/forums.ashx/[threads/{ThreadId}/]posts

POST /api/forums.ashx/[posts/{PostId}/]replies

Request

<ForumPost>
   ...
</ForumPost>

Note the ThreadInfo object can be omitted if you pass the desired Thread Id into the URI Context by posting to /api/forums.ashx/threads/{ThreadId}/posts or by indicating the proper parent post by posting to /api/forums.ashx/posts/{PostId}/replies

Minimum required fields (Title, Body, and Date)

Response

Status: 201 CREATED
<ForumPost> ...
</ForumPost>

 

Update ForumPost

PUT /api/forums.ashx/posts/{Id}

Request

<ForumPost>
   ...
</ForumPost>

Response

Status: 200 OK
<ForumPost> ...
</ForumPost>

Delete ForumPost

DELETE /api/forums.ashx/posts/{Id}

Response

Status: 200 OK

 

Ratings

GET /api/forums.ashx/threads/{ThreadId}/ratings

Response

Status: 200 OK
<RatingList Sum="5" Average="5"> <Rating /> ... </RatingList>

GET /api/forums.ashx/threads/{ThreadId}/ratings/{UserId}

Response

Status: 200 OK
<Rating />

Create Rating

POST /api/forums.ashx/threads/{ThreadId}/ratings/

Request

<int>[value 0-5]</int>

Response

Status: 201 CREATED
<Rating />

 

Update Rating

PUT /api/forums.ashx/threads/{ThreadId}/ratings/{UserId}

Request

<int>[value 0-5]</int>

Response

Status: 200 OK

<Rating />

 

Attachments

GET /api/forums.ashx/[forums/{ForumId}/]posts/{PostId}/attachment

Response

Status: 302 http://localhost/cs/url/to/attachment

 

Create Attachment

This method is used to create an attachment for an existing post.

POST /api/forums.ashx/[forums/{ForumId}/]posts/{PostId}/attachment

Request

[raw file]

Response

Status: 201 http://localhost/cs/url/to/attachment

 

Update Attachment

This updates an existing attachment. The post must already have an existing attachment to use this method.

PUT /api/forums.ashx/[forums/{ForumId}/]posts/{PostId}/attachment

Request

[raw file]

Response

Status: 200 OK

 

DELETE /api/forums.ashx/[forums/{ForumId}/]posts/{PostId}/attachment

Response

Status: 200 OK

 

Permissions

GET /api/forums.ashx/permissions (Application Level)

Response

Status: 200 OK
<ForumPermissionList> <ForumPermission> ... </ForumPermission> ... </ForumPermissionList>

 

GET /api/forums.ashx/forums/{Id}/permissions (Forum Level)

Response

Status: 200 OK
<ForumPermissionList> <ForumPermission> ... </ForumPermission> ... </ForumPermissionList>

 

GET /api/forums.ashx/[forums/{Id}/]permissions/{role / permission name}

Response

Status: 200 OK
<ForumPermission> ... </ForumPermission>

 

Create Permission

This method is used to explicity define the permissions for a role on a forum, where the permissions were previously inerhited from the applicaiton default.

POST /api/forums.ashx/forums/{Id}/permissions/{role / permission name}

Request

<ForumPermission>
  ...
</ForumPermission>

Response

Status: 201 CREATED
<ForumPermission> ... </ForumPermission>

 

Update Permission

Roles must already exist to have permissions added or changed, see the membership roles section on adding or deleting roles.

PUT /api/forums.ashx/[forums/{Id}/]permissions/{role / permission name}

Request

<ForumPermission>
  ...
</ForumPermission>

Response

Status: 200 OK
<ForumPermission> ... </ForumPermission>

 

DELETE /api/forums.ashx/forums/{Id}/permissions/{role / permission name}

Response

Status: 200 OK

Note you can only delete explicity defined permissions (where Implied="false") not default ones which are inherited from the application level.

 

Settings

GET /api/forums.ashx/settings

Response

Status: 200 OK
<ForumSettings> ... </ForumSettings>

Update Settings

POST or PUT /api/forums.ashx/settings

Request

<ForumSettings>
  ...
</ForumSettings>

Response

Status: 200 OK
<ForumSettings> ... </ForumSettings>

 

Data Reference

 

FourmGroup

<ForumGroup Id="1" 
   Endpoint="http://localhost/cs/api/forums.ashx/forumgroups/1">
  <Name>Administrators</Name>
<Description/>
</ForumGroup>

Forum

<Forum Id="5" Endpoint="http://localhost/cs/api/forums.ashx/forums/5">
  <ForumGroupInfo Id="5" 
    Endpoint="http://localhost/cs/api/forums.ashx/forumgroups/5"/>
  <Name>Sample Forum</Name>
<Key>sample_forum</Key>
<Url>http://localhost/cs/forums/5.aspx</Url>
<DateCreated>2008-01-15T05:37:58.777</DateCreated>
<Description/> <Settings>
<DefaultThreadDateFilter>OneMonth</DefaultThreadDateFilter>
<PostsToModerate>0</PostsToModerate>
<EnablePostStatistics>true</EnablePostStatistics>
<EnablePostPoints>true</EnablePostPoints>
<EnableAnonymousPosting>false</EnableAnonymousPosting>
<SortOrder>1</SortOrder>
<IsActive>true</IsActive>
<IsVisible>false</IsVisible>
<IsCommunityAggregated>true</IsCommunityAggregated>
<IsSearchable>true</IsSearchable>
<IsModerated>false</IsModerated>
<IsPublic>false</IsPublic>
<HasIsPublic>false</HasIsPublic>
<DefaultLanguage>en</DefaultLanguage>
<EnableAnonymousPostingForUsers>false</EnableAnonymousPostingForUsers>
<EnableThreadStatus>false</EnableThreadStatus>
<CategorySortBy>Unspecified</CategorySortBy>
<CategorySortOrder>0</CategorySortOrder>
<BlockSpamFeedbackNotifications>false</BlockSpamFeedbackNotifications>
</Settings>
<ForumType>Normal</ForumType>
<Threads Endpoint="http://localhost/cs/api/forums.ashx/forums/5/threads/"/>
<Statistics Posts="4" Threads="4" DiskUsage="-1" PostsToModerate="0"/>
</Forum>

Thread

<Thread Id="13" 
  Endpoint="http://localhost/cs/api/forums.ashx/forums/5/threads/13">
  <Url>http://localhost/cs/forums/p/13/17.aspx#17</Url>
<Subject>Sample Forum Post</Subject>
<IsPopular>false</IsPopular>
<IsSticky>false</IsSticky>
<IsAnnouncement>false</IsAnnouncement>
<StickyDate>2008-01-15T06:47:06.593</StickyDate>
<Date>2008-01-15T06:47:06.593</Date>
<ForumInfo Id="5" Endpoint="http://localhost/cs/api/forums.ashx/forums/5"/>
<Status xsi:nil="true"/>
<PostInfo Id="17" Endpoint="http://localhost/cs/api/forums.ashx/forums/5/threads/13/posts/17"/> <Ratings Endpoint="http://localhost/cs/api/forums.ashx/forums/5/threads/3/ratings/"/> <IsLocked>false</IsLocked> </Thread>

Rating

<Rating ItemId="2" UserId="2100" 
  UserUrl="http://localhost/cs/api/membership.ashx/users/2100" 
  Value="5" OldValue="0"/>

ForumPost

<ForumPost Id="3" 
  Endpoint="http://localhost/cs/api/forums.ashx/forums/5/threads/3/posts/3">
  <PostTracking>
<HasRead>false</HasRead>
<IsTracked>false</IsTracked> </PostTracking> <Body><p>sample forum post content</p></Body>
<SiteUrl>http://localhost/cs/forums/p/3/3.aspx#3</SiteUrl>
<Subject>Sample Forum Post</Subject>
<Date>2008-01-15T05:37:58.793</Date> <Keywords>
<Keyword>Sample Forum Posts</Keyword>
</Keywords>
<RenderedBody> <br /><p>sample forum post content</p><br /> </RenderedBody>
<Excerpt/>
<Statistics Replies="0" ViewCount="0" Points="0" Trackbacks="0" Aggregatorviews="0"/> <Spam> <Score>0</Score>
<Status>Unknown</Status>
</Spam>
<ForumInfo Id="5" Endpoint="http://localhost/cs/api/forums.ashx/forums/5"/>
<IsPublished>true</IsPublished> <Settings>
<PostType>Text</PostType>
<Approved>true</Approved>
<PostMedia>Empty</PostMedia>
</Settings>
<AuthorInfo Id="2100"/>
<Thread Id="3" Index="0" Date="2008-01-15T05:37:58.793"/>
<EmoticonId>0</EmoticonId>
<PostLevel>1</PostLevel>
<SortOrder>1</SortOrder> </ForumPost>

Permission

<ForumPermission Id="3108c739-2bf5-4e15-b12a-09dc1a321694" Name="Everyone" 
  Implied="true" 
  Endpoint="http://localhost/cs/api/forums.ashx/permissions/everyone">
  <Read>false</Read>
<Write>false</Write>
<Reply>false</Reply>
<Video>false</Video>
<LocalAttachment>false</LocalAttachment>
<RemoteAttachment>false</RemoteAttachment>
</ForumPermission>

Settings

<ForumSettings Endpoint="http://localhost/cs/api/forums.ashx/settings">
  <AllowedAttachmentTypes>
    zip;cab;jpg;gif;png;mpg;mpeg;avi;wmv;wma;mp3;ra;rar;rm;sql;txt
</AllowedAttachmentTypes>
<DaysPostMarkedAsRead>7</DaysPostMarkedAsRead>
<DisplayEditNotesInPost>false</DisplayEditNotesInPost>
<DuplicatePostIntervalInMinutes>15</DuplicatePostIntervalInMinutes>
<EnableAnonymousReporting>true</EnableAnonymousReporting>
<EnableAttachments>true</EnableAttachments>
<EnableDuplicatePosts>false</EnableDuplicatePosts>
<EnableFloodIntervalChecking>false</EnableFloodIntervalChecking>
<EnableForumsRss>true</EnableForumsRss>
<EnableInlineImages>false</EnableInlineImages>
<EnablePostPreviewPopup>false</EnablePostPreviewPopup>
<EnablePostReporting>true</EnablePostReporting>
<EnableTagging>true</EnableTagging>
<EnableThreadStatus>false</EnableThreadStatus>
<EnableUserPostingAsAnonymous>false</EnableUserPostingAsAnonymous>
<InlineImageDimensions width="550" height="-1"/>
<IsAggregatePublicOnly>false</IsAggregatePublicOnly>
<MaximumAttachmentSize>64</MaximumAttachmentSize>
<MinimumTimeBetweenPosts>15</MinimumTimeBetweenPosts>
<PopularPostLevelDays>3</PopularPostLevelDays>
<PopularPostLevelPosts>15</PopularPostLevelPosts>
<PopularPostLevelViews>200</PopularPostLevelViews>
<PostDeleteAgeInMinutes>5</PostDeleteAgeInMinutes>
<PostEditBodyAgeInMinutes>0</PostEditBodyAgeInMinutes>
<PostEditTitleAgeInMinutes>5</PostEditTitleAgeInMinutes>
<PostInterval>15</PostInterval>
<PostsPerPage>15</PostsPerPage>
<RequireEditNotes>false</RequireEditNotes>
<RssCacheWindowInSeconds>90</RssCacheWindowInSeconds>
<RssDefaultThreadsPerFeed>25</RssDefaultThreadsPerFeed>
<RssMaximumThreadsPerFeed>50</RssMaximumThreadsPerFeed>
<SupportedInlineImageTypes> jpg;gif;bmp;pcx;png;pic </SupportedInlineImageTypes>
<ThreadsPerPage>20</ThreadsPerPage> </ForumSettings>

 

Query Reference

Query properties are key value pairs separated by a semicolon. Arrays should be formatted as comma separated strings.

Forum Query

Property Type Description
Ids int[] The Forum Ids you wish to include in your search
GroupIds int[] The ForumGroup Ids you wish to include in your search
AccessLevel string The Forum Components.Permission you wish to use to filter your search (defaults to View)
IsActive bool Include only Active Forums
IsModerated bool Include only Moderated Forums
PageSize int (defaults to 20)
PageIndex int (defaults to 0)

 

Forum Thread Query

Property Type Description
Ids int[] The Forum Thread Ids you wish to include in your search
GroupIds int[] The Forum Group Ids you wish to include in your search
ForumIds int[] The Forum Ids you wish to include in your search
Date string Threads with posts after this date will be returned
Corresponds to the date of the last post in the thread
PageSize int Number of threads to include per page (defaults to 20)
PageIndex int The page number to retrieve, first page is 0 (defaults to 0)
Order string Ascending / Decending
SortBy string lastpost, threadauthor, totalreplies, totalviews, totalratings, firstpost
(defaults to lastpost)
Keywords string[] A collection of tags/keywords to search by
ActiveOnly bool Threads that are considered "Active Topics" based on the number of replies/views
UnansweredOnly bool Returns only threads that have not been marked as being answered
UnreadOnly bool Returns only threads that have not been read by the user
UserFilterMode string all, showtopicsnotparticipatedin, showtopicsparticipatedin, hidetopicsbyanonymoususers, hidetopicsbynonanonymoususers
(defaults to all)

 

Forum Post Query

Property Type Description
ThreadId int Finds all posts with the matching ThreadId (this field is required)
SortBy string type of ForumPostSortBy
PostDate, UserId (Defaults to PostDate)
PageSize int Number of posts to include per page (defaults to 20)
PageIndex int The page number to retrieve, first page is 0 (defaults to 0)
SortOrder string Ascending / Descending