Request Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
GroupId | int? | Group Id | Required | ||
Name | string | Name | Required | ||
Description | string | Default is an empty string. | Optional | ||
AllowedThreadTypes | string | A comma separated list of thread types supported. If not specified the default is 'Discussion'. | Optional | ||
DefaultThreadType | string | The default thread type for the forum if both Q&A and Discussion threads are allowed. Default is 'Discussion'. | Optional | ||
Enabled | bool? | Default is true. | Optional | ||
IndexPosts | bool? | Default is true. | Optional | ||
Key | string | String identifier uniquely identifying a forum within its containing group. Used in the url. If unspecified, will be auto-generated based on the Name | Optional | ||
ModeratePosts | bool? | Default is false. | Optional | ||
EnablePostStatistics | bool? | Default is true. | Optional | ||
EnableQualityVoting | bool? | Default is false. | Optional | ||
EnablePostPoints | bool? | Obsolete in 10.0. This property is no longer used. | Optional | ||
EnableMailingList | bool? | Enable Mailing List | Optional | ||
MailingListName | string | Required if EnableMailingList is true | Optional | ||
MailingListAddress | string | Required if EnableMailingList is true | Optional | ||
EmailFooter | string | Email Footer | Optional | ||
EnablePassiveMode | bool? | Enable Passive Mode | Optional | ||
PassiveModeAddress | string | Required if EnablePassiveMode is true | Optional | ||
MappedGalleryId | int? | Only used when EnableMailingList is true, attachments via email can be created in this gallery. If not specified, attachments will be created on forum posts. | Optional | ||
SuggestedAnswerVoteThreshold | int? | Vote threshold at which a reply is marked as suggested | Optional | ||
VerifiedAnswerVoteThreshold | int? | Vote threshold at which a reply is marked as verified | Optional | ||
AutoLockingEnabled | bool? | Turns on auto locking of threads according to the configuration of the Forum Auto Locking plugin if it is enabled. | Optional | ||
AutoLockingDefaultInterval | int? | The number of days before a thread is automatically locked when the Forum Auto-Locking plugin is enabled. If not specified and auto-locking is enabled, the plugin's configuration value is used. | Optional | ||
ExtendedAttributes | RestExtendedAttributes | Extended Attributes | Optional |
Example Requests
C# REST SDK
This example uses the REST SDK to access the Community REST API within a .Net C# application. In the example, USER_NAME
is the user name of the effective user for the request and OAUTH_CLIENT_ID
and OAUTH_SECRET
are the OAuth client ID and secret, respectively, associated to this application as configured in Administration > Integration > OAuth Clients with the "Client Credentials" grant type enabled. See the documentation for the REST SDK for more details about installation, configuration, and usage options.
var host = new ClientCredentialsRestHost("USER_NAME", "https://mysite.com/", "OAUTH_CLIENT_ID", "OAUTH_SECRET"); var response = host.PostToDynamic(2, "forums.json", false, new RestPostOptions { PostParameters = new System.Collections.Specialized.NameValueCollection { { "GroupId", "6" }, { "Name", "name" } } });
Widget Javascript
This example uses the rest JavaScript API to access the Community REST API within the Community web UI. When accessing the REST API through the javascript API, the effective user is the current contextual user of the web interface.
jQuery.telligent.evolution.post({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/forums.json', data: { 'GroupId': '6', 'Name': 'name' }, success: function(response) { } });
cURL
This example uses the cURL command-line HTTP utility. ENCODED_TOKEN
in the example is the base64-encoded concatenation of the user's API key (created from the user's profile), a colon (:), and the user's user name. Learn more about using the REST API.
curl -H "Rest-User-Token: ENCODED_TOKEN" -d "GroupId=6&Name=name" -X POST https://mysite.com/api.ashx/v2/forums.xml
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Info> <Message>string</Message> <Message>string</Message> </Info> <Warnings> <Message>string</Message> <Message>string</Message> </Warnings> <Errors> <Message>string</Message> <Message>string</Message> </Errors> <Forum> <Id>61</Id> <Name>title</Name> <Url>url</Url> <Group> <Id>4</Id> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated>2012-01-04T00:00:00</DateCreated> <Description>description</Description> <Key>key</Key> <Name>name</Name> <ParentGroupId>6</ParentGroupId> <Url>url</Url> <TotalMembers>25</TotalMembers> <HasGroups>true</HasGroups> <GroupCount>8</GroupCount> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes> <key>value</key> <key>value</key> </ExtendedAttributes> <ContainerId>49fec544-6df7-4a82-872b-f8be586d5e9e</ContainerId> <Container> <ContainerId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContainerId> <ContainerTypeId>fe65240b-044c-4292-9946-f10e0361ecff</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Group> <DateCreated>2012-05-02T00:00:00</DateCreated> <LatestPostDate>2012-06-04T00:00:00</LatestPostDate> <Description>description</Description> <AllowedThreadTypes> <ThreadType>value</ThreadType> <ThreadType>value</ThreadType> </AllowedThreadTypes> <DefaultThreadType>defaultthreadtype</DefaultThreadType> <Enabled>true</Enabled> <IndexPosts>true</IndexPosts> <Key>key</Key> <ModeratePosts>true</ModeratePosts> <EnablePostStatistics>true</EnablePostStatistics> <EnableQualityVoting>true</EnableQualityVoting> <PostsToModerate>7</PostsToModerate> <ThreadCount>27</ThreadCount> <ReplyCount>32</ReplyCount> <EmailAddress>emailaddress</EmailAddress> <EnableAnonymousPosting>true</EnableAnonymousPosting> <DefaultThreadStatus>defaultthreadstatus</DefaultThreadStatus> <SearchUniqueId>searchuniqueid</SearchUniqueId> <SuggestedAnswerVoteThreshold>52</SuggestedAnswerVoteThreshold> <VerifiedAnswerVoteThreshold>19</VerifiedAnswerVoteThreshold> <AutoLockingEnabled>true</AutoLockingEnabled> <AutoLockingDefaultInterval>112</AutoLockingDefaultInterval> <Application> <ApplicationId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ApplicationId> <ApplicationTypeId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Container> <ContainerId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ContainerId> <ContainerTypeId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Application> <ExtendedAttributes> <key>value</key> <key>value</key> </ExtendedAttributes> </Forum> </Response>
JSON
{ "Forum": { "Name": "title", "Title": "title", "Url": "url", "Group": { "AvatarUrl": "avatarurl", "DateCreated": "2012-01-04T00:00:00", "Description": "description", "Key": "key", "Name": "name", "ParentGroupId": 6, "Url": "url", "TotalMembers": 25, "HasGroups": true, "GroupCount": 8, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [ { "Key": "key", "Value": "value" }, { "Key": "key", "Value": "value" } ], "ContainerId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": { "ContainerId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ContainerTypeId": "fe65240b-044c-4292-9946-f10e0361ecff", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" }, "Id": 4 }, "DateCreated": "2012-05-02T00:00:00", "LatestPostDate": "2012-06-04T00:00:00", "Description": "description", "AllowedThreadTypes": [ { "Value": "value" }, { "Value": "value" } ], "DefaultThreadType": "defaultthreadtype", "Enabled": true, "IndexPosts": true, "Key": "key", "ModeratePosts": true, "EnablePostStatistics": true, "EnableQualityVoting": true, "EnablePostPoints": true, "PostsToModerate": 7, "ThreadCount": 27, "ReplyCount": 32, "EmailAddress": "emailaddress", "EnableAnonymousPosting": true, "DefaultThreadStatus": "defaultthreadstatus", "SearchUniqueId": "searchuniqueid", "SuggestedAnswerVoteThreshold": 52, "VerifiedAnswerVoteThreshold": 19, "AutoLockingEnabled": true, "AutoLockingDefaultInterval": 112, "Application": { "ApplicationId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ApplicationTypeId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": { "ContainerId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ContainerTypeId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" } }, "ExtendedAttributes": [ { "Key": "key", "Value": "value" }, { "Key": "key", "Value": "value" } ], "Id": 61 }, "Info": [ "string", "string" ], "Warnings": [ "string", "string" ], "Errors": [ "string", "string" ] }