URLs
POST api.ashx/v2/calendars.xml (or .json)
POST api.ashx/v2/groups/{groupid}/calendars.xml (or .json)
Request Parameters
Name | Type | Description | Location | Required | Default | Options |
---|---|---|---|---|---|---|
GroupId | int | Which group to create the calendar in | Request Body | Required | ||
Name | string | Name of the Calendar | Request Body | Required | ||
Description | string | Description of the calendar | Request Body | Required | ||
CreatorId | int | Which user created the calendar | Request Body | Required | ||
ExtendedAttributes | string | Additional information about the event that may be used by third party plugins | Request Body | 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, "calendars.json", false, new RestPostOptions { PostParameters = new System.Collections.Specialized.NameValueCollection { { "GroupId", "6" }, { "Name", "name" }, { "Description", "description" }, { "CreatorId", "6" } } });
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/calendars.json', data: { 'GroupId': '6', 'Name': 'name', 'Description': 'description', 'CreatorId': '6' }, 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&Description=description&CreatorId=6" -X POST https://mysite.com/api.ashx/v2/calendars.xml
Example Responses
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Event> <Id>4</Id> <User> <Id>112</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>44df201a-07e6-42eb-96c7-8ce7ce35aab6</Id> <Author> <Id>25</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>9ba1ec43-dc34-4e27-a579-4a0855144e2f</Id> <Author> <Id /> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> </Author> <Body>body</Body> <CreatedDate>2012-01-04T00:00:00</CreatedDate> <ReplyCount>6</ReplyCount> <Group> <Id /> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated /> <Description>description</Description> <Key>key</Key> <Name>name</Name> <Url>url</Url> <TotalMembers /> <HasGroups>true</HasGroups> <GroupCount /> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes /> <ContainerId>49fec544-6df7-4a82-872b-f8be586d5e9e</ContainerId> </Group> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> <Content> <ContentId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ContentId> <ContentTypeId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ContentTypeId> <CreatedDate>2012-05-02T00:00:00</CreatedDate> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Content> </CurrentStatus> </Author> <Body>body</Body> <CreatedDate>2012-06-04T00:00:00</CreatedDate> <ReplyCount>8</ReplyCount> <Group> <Id>32</Id> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated>2011-05-28T00:00:00</DateCreated> <Description>description</Description> <Key>key</Key> <Name>name</Name> <ParentGroupId>4</ParentGroupId> <Url>url</Url> <TotalMembers>7</TotalMembers> <HasGroups>true</HasGroups> <GroupCount>27</GroupCount> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes> <key>value</key> <key>value</key> </ExtendedAttributes> <ContainerId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContainerId> <Container> <ContainerId>6cdcf200-3bad-476d-af45-97b52545c337</ContainerId> <ContainerTypeId>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Group> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>44df201a-07e6-42eb-96c7-8ce7ce35aab6</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> <Content> <CreatedByUser> <Id>19</Id> <AvatarUrl>avatarurl</AvatarUrl> <DisplayName>displayname</DisplayName> <ProfileUrl>profileurl</ProfileUrl> <Username>username</Username> <CurrentStatus> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <Body>body</Body> <CreatedDate /> <ReplyCount>52</ReplyCount> <AttachedUrl>attachedurl</AttachedUrl> <ContentId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContentId> <ContentType>56f1a3ec-14bb-45c6-949f-ee7776d68c78</ContentType> <Url>url</Url> <IsPublished>true</IsPublished> </CurrentStatus> </CreatedByUser> <ContentId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ContentId> <ContentTypeId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ContentTypeId> <CreatedDate>2011-12-09T00:00:00</CreatedDate> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Application> <ApplicationId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ApplicationId> <ApplicationTypeId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Container> <ContainerId>6cdcf200-3bad-476d-af45-97b52545c337</ContainerId> <ContainerTypeId>b04540ec-eb38-4fa1-b7bb-e3fde05401b4</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Application> </Content> </CurrentStatus> </User> <CalendarContext>NotSet</CalendarContext> <CalendarCreateDate>2012-03-29T00:00:00</CalendarCreateDate> <NodeId>49fec544-6df7-4a82-872b-f8be586d5e9e</NodeId> <CalendarReferenceId>61</CalendarReferenceId> <CreatorId>18</CreatorId> <ExtendedAttributes> <key>value</key> <key>value</key> </ExtendedAttributes> <Group> <Id>8</Id> <AvatarUrl>avatarurl</AvatarUrl> <DateCreated>2012-04-19T00:00:00</DateCreated> <Description>description</Description> <Key>key</Key> <Name>name</Name> <ParentGroupId>76</ParentGroupId> <Url>url</Url> <TotalMembers>6</TotalMembers> <HasGroups>true</HasGroups> <GroupCount>25</GroupCount> <GroupType>grouptype</GroupType> <EnableGroupMessages>true</EnableGroupMessages> <EnableContact>true</EnableContact> <SearchUniqueId>searchuniqueid</SearchUniqueId> <ExtendedAttributes> <key>value</key> <key>value</key> </ExtendedAttributes> <ContainerId>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</ContainerId> <Container> <ContainerId>fe65240b-044c-4292-9946-f10e0361ecff</ContainerId> <ContainerTypeId>2d525bad-c4df-470d-a193-a1c6d66e5c3e</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Group> <Application> <ApplicationId>bd519379-b61f-4e2f-b0f9-c0f28c5cceb1</ApplicationId> <ApplicationTypeId>9ba1ec43-dc34-4e27-a579-4a0855144e2f</ApplicationTypeId> <HtmlName>htmlname</HtmlName> <HtmlDescription>htmldescription</HtmlDescription> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> <Container> <ContainerId>e3715662-2528-4ba1-84a7-bfcd9d548f80</ContainerId> <ContainerTypeId>6cdcf200-3bad-476d-af45-97b52545c337</ContainerTypeId> <HtmlName>htmlname</HtmlName> <Url>url</Url> <AvatarUrl>avatarurl</AvatarUrl> </Container> </Application> <CalendarDataToken>calendardatatoken</CalendarDataToken> <Description>description</Description> <Name>name</Name> <Url>url</Url> </Event> <Errors> <Message>string</Message> <Message>string</Message> </Errors> </Response>
JSON
{ "Event": { "User": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": null, "Id": null }, "Body": "body", "CreatedDate": "2012-01-04T00:00:00", "ReplyCount": 6, "Group": { "AvatarUrl": "avatarurl", "DateCreated": null, "Description": "description", "Key": "key", "Name": "name", "Url": "url", "TotalMembers": null, "HasGroups": true, "GroupCount": null, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [], "ContainerId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": null, "Id": null }, "AttachedUrl": "attachedurl", "HasReplies": true, "ContentId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": { "CreatedByUser": null, "ContentId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ContentTypeId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "CreatedDate": "2012-05-02T00:00:00", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Application": null }, "Id": "9ba1ec43-dc34-4e27-a579-4a0855144e2f" }, "Id": 25 }, "Body": "body", "CreatedDate": "2012-06-04T00:00:00", "ReplyCount": 8, "Group": { "AvatarUrl": "avatarurl", "DateCreated": "2011-05-28T00:00:00", "Description": "description", "Key": "key", "Name": "name", "ParentGroupId": 4, "Url": "url", "TotalMembers": 7, "HasGroups": true, "GroupCount": 27, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [ { "Key": "key", "Value": "value" }, { "Key": "key", "Value": "value" } ], "ContainerId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": { "ContainerId": "6cdcf200-3bad-476d-af45-97b52545c337", "ContainerTypeId": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" }, "Id": 32 }, "AttachedUrl": "attachedurl", "HasReplies": true, "ContentId": "44df201a-07e6-42eb-96c7-8ce7ce35aab6", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": { "CreatedByUser": { "AvatarUrl": "avatarurl", "DisplayName": "displayname", "ProfileUrl": "profileurl", "Username": "username", "CurrentStatus": { "Author": null, "Body": "body", "CreatedDate": null, "ReplyCount": 52, "Group": null, "AttachedUrl": "attachedurl", "HasReplies": null, "ContentId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ContentType": "56f1a3ec-14bb-45c6-949f-ee7776d68c78", "Url": "url", "IsPublished": true, "Content": null, "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46" }, "Id": 19 }, "ContentId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "ContentTypeId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "CreatedDate": "2011-12-09T00:00:00", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Application": { "ApplicationId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "ApplicationTypeId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": { "ContainerId": "6cdcf200-3bad-476d-af45-97b52545c337", "ContainerTypeId": "b04540ec-eb38-4fa1-b7bb-e3fde05401b4", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" } } }, "Id": "44df201a-07e6-42eb-96c7-8ce7ce35aab6" }, "Id": 112 }, "CalendarContext": 0, "CalendarCreateDate": "2012-03-29T00:00:00", "NodeId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "CalendarReferenceId": 61, "CreatorId": 18, "ExtendedAttributes": [ { "Key": "key", "Value": "value" }, { "Key": "key", "Value": "value" } ], "Group": { "AvatarUrl": "avatarurl", "DateCreated": "2012-04-19T00:00:00", "Description": "description", "Key": "key", "Name": "name", "ParentGroupId": 76, "Url": "url", "TotalMembers": 6, "HasGroups": true, "GroupCount": 25, "GroupType": "grouptype", "EnableGroupMessages": true, "EnableContact": true, "SearchUniqueId": "searchuniqueid", "IsEnabled": true, "ExtendedAttributes": [ { "Key": "key", "Value": "value" }, { "Key": "key", "Value": "value" } ], "ContainerId": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "ContainerTypeId": "23b05a61-c3e5-4451-90d9-bfa00453bce4", "Container": { "ContainerId": "fe65240b-044c-4292-9946-f10e0361ecff", "ContainerTypeId": "2d525bad-c4df-470d-a193-a1c6d66e5c3e", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" }, "Id": 8 }, "Application": { "ApplicationId": "bd519379-b61f-4e2f-b0f9-c0f28c5cceb1", "ApplicationTypeId": "9ba1ec43-dc34-4e27-a579-4a0855144e2f", "HtmlName": "htmlname", "HtmlDescription": "htmldescription", "Url": "url", "AvatarUrl": "avatarurl", "Container": { "ContainerId": "e3715662-2528-4ba1-84a7-bfcd9d548f80", "ContainerTypeId": "6cdcf200-3bad-476d-af45-97b52545c337", "HtmlName": "htmlname", "Url": "url", "AvatarUrl": "avatarurl" } }, "CalendarDataToken": "calendardatatoken", "Description": "description", "Name": "name", "Url": "url", "Id": 4 }, "Errors": [ "string", "string" ] }