Media Galleries
MediaGalleryGroups
List
GET /api/mediagalleries.ashx/mediagallerygroups/
Response
Status: 200 OK
<MediaGalleryGroupList>
<MediaGalleryGroup>
... </MediaGalleryGroup>
...
</MediaGalleryGroupList>
GET /api/mediagalleries.ashx/gallerygroups/{Id}
Resoponse
Status: 200 OK
<MediaGalleryGroup>
... </MediaGalleryGroup>
Create MediaGalleryGroup
POST /api/mediagalleries.ashx/mediagallerygroups/
Request
<MediaGalleryGroup>
... </MediaGalleryGroup>
Resoponse
Status: 201 CREATED
<MediaGalleryGroup>
... </MediaGalleryGroup>
Update MediaGalleryGroup
PUT /api/mediagalleries.ashx/mediagallerygroups/{Id}
Request
<MediaGalleryGroup>
... </MediaGalleryGroup>
Resoponse
Status: 200 OK
<MediaGalleryGroup>
... </MediaGalleryGroup>
Delete MediaGalleryGroup
DELETE /api/mediagalleries.ashx/mediagallerygroups/{Id}
Resoponse
Status: 200 OK
MediaGalleries
List
GET /api/mediagalleries.ashx/mediagalleries/
Resoponse
Status: 200 OK
<MediaGalleryList PageSize="20" PageIndex="0" TotalCount="1">
<MediaGallery>
... </MediaGallery>
...
</MediaGalleryList>
GET /api/mediagalleries.ashx/mediagalleries/{mediagallery query parameters}
Returns a list of MediaGalleries which match the query parameters provided on the querystring.
Resoponse
Status: 200 OK
<MediaGalleryList PageSize="20" PageIndex="0" TotalCount="1">
<MediaGallery>
... </MediaGallery>
...
</MediaGalleryList>
GET /api/mediagalleries.ashx/mediagalleries/{Id|Key}
Resoponse
Status: 200 OK
<MediaGallery>
... </MediaGallery>
Create MediaGallery
POST /api/mediagalleries.ashx/mediagalleries/
Request
<MediaGallery>
... </MediaGallery>
Resoponse
Status: 201 CREATED
<MediaGallery>
... </MediaGallery>
Update MediaGallery
PUT /api/mediagalleries.ashx/mediagalleries/{Id|Key}
Request
<MediaGallery>
... </MediaGallery>
Resoponse
Status: 200 OK
<MediaGallery>
... </MediaGallery>
Delete MediaGallery
DELETE /api/mediagalleries.ashx/mediagalleries/{Id}
Resoponse
Status: 200 OK
MediaGalleryPosts
List
GET /api/mediagalleries.ashx/mediagalleries/{Id|Key}/posts/
Resoponse
Status: 200 OK
<MediaGalleryPostList PageSize="20" PageIndex="0" TotalCount="1">
<MediaGalleryPost>
... </MediaGalleryPost>
...
</MediaGalleryPostList>
GET /api/mediagalleries.ashx/posts/{mediagallery post query parameters}
Returns a list of MediaGallery Posts which match the query parameters provided on the querystring.
Resoponse
Status: 200 OK
<MediaGalleryPostList PageSize="20" PageIndex="0" TotalCount="1">
<MediaGalleryPost>
... </MediaGalleryPost>
...
</MediaGalleryPostList>
GET /api/mediagalleries.ashx/posts/{Id}
Resoponse
Status: 200 OK
<MediaGalleryPost>
... </MediaGalleryPost>
Create MediaGalleryPost
POST /api/mediagalleries.ashx/posts/
Request
<MediaGalleryPost>
... </MediaGalleryPost>
Resoponse
Status: 201 CREATED
<MediaGalleryPost>
... </MediaGalleryPost>
Update MediaGalleryPost
PUT /api/mediagalleries.ashx/posts/{Id}
Request
<MediaGalleryPost>
... </MediaGalleryPost>
Resoponse
Status: 200 OK
<MediaGalleryPost>
... </MediaGalleryPost>
Delete MediaGalleryPost
DELETE /api/mediagalleries.ashx/posts/{Id}
Resoponse
Status: 200 OK
Comments
List
GET /api/mediagalleries.ashx/posts/{PostId}/comments
Lists the Comments relative to the specified MediaGallery Post.
Resoponse
Status: 200 OK
<CommentList PageSize="20" PageIndex="0" TotalCount="1">
<Comment>
... </Comment>
...
</CommentList>
GET /api/mediagalleries.ashx/posts/{mediagallery comment query parameters}
Returns a list of MediaGallery Comments which match the query parameters provided on the querystring.
Resoponse
Status: 200 OK
<CommentList PageSize="20" PageIndex="0" TotalCount="1">
<Comment>
... </Comment>
...
</CommentList>
GET /api/mediagalleries.ashx/comments/{Id}
Resoponse
Status: 200 OK
<Comment>
... </Comment>
Create Comment
POST /api/mediagalleries.ashx/comments/
Request
<Comment>
... </Comment>
Resoponse
Status: 201 CREATED
<Comment>
... </Comment>
Update Comment
PUT /api/mediagalleries.ashx/comments/{Id}
Request
<Comment>
... </Comment>
Resoponse
Status: 200 OK
<Comment>
... </Comment>
Delete Comment
DELETE /api/mediagalleries.ashx/comments/{Id}
Resoponse
Status: 200 OK
Ratings
List
GET /api/mediagalleries.ashx/posts/{Id}/ratings
Resoponse
Status: 200 OK
<RatingList Sum="5" Average="5"> <Rating /> ... </RatingList>
GET /api/mediagalleries.ashx/posts/{PostId}/ratings/{UserId}
Resoponse
Status: 200 OK
<Rating />
Create Rating
POST /api/mediagalleries.ashx/posts/{PostId}/ratings/
Request
<int>[value 0-5]</int>
Resoponse
Status: 201 CREATED
<Rating />
Update Rating
PUT /api/mediagalleries.ashx/posts/{PostId}/ratings/{UserId}
Request
<int>[value 0-5]</int>
Resoponse
Status: 200 OK
<Rating />
Members (Owners)
The members endpoint is used to provide an owner list for a MediaGallery. This is a list of user accounts with administrative access to this media gallery. Only member type "owner" is support by MediaGalleries.
GET /api/mediagalleries.ashx/mediagalleries/{MediaGalleryId}/members
Response
Status: 200 OK
<MembershipList> <Member /> ... </MembershipList>
GET /api/mediagalleries.ashx/mediagalleries/{Id}/members/{UserId}
Response
Status: 200 OK
<Member />
Create Member
POST /api/mediagalleries.ashx/mediagalleries/{Id}/members
Request
<Member />
Response
Status: 201 CREATED
<Member />
Update Member
PUT /api/mediagalleries.ashx/mediagalleries/{Id}/members/{UserId}
Request
<Member />
Response
Status: 200 OK
<Member />
Delete Member
DELETE /api/mediagalleries.ashx/mediagalleries/{Id}/members/{UserId}
Response
Status: 200 OK
Permissions
Displays the MediaGallery permissions assigned to each role. Permissions may be overriden within each MediaGallery, and are settable by the MediaGallery Administrator.
GET /api/mediagalleries.ashx/permissions (Application Level)
Response
Status: 200 OK
<MediaGalleryPermissionList> <MediaGalleryPermission> ... </MediaGalleryPermission> ... </MediaGalleryPermissionList>
GET /api/mediagalleries.ashx/mediagalleries/{Id}/permissions (MediaGallery Level)
Response
Status: 200 OK
<MediaGalleryPermissionList> <MediaGalleryPermission> ... </MediaGalleryPermission> ... </MediaGalleryPermissionList>
GET /api/mediagalleries.ashx/[mediagalleries/{Id}/]permissions/{permission name}
Response
Status: 200 OK
<MediaGalleryPermission> ... </MediaGalleryPermission>
Create Permission
This method is used to explicity define the permissions for a role on a MediaGallery, where the permissions were previously inerhited from the applicaiton default.
POST /api/mediagalleries.ashx/mediagalleries/{Id}/permissions/{permission name}
Request
<MediaGalleryPermission> ... </MediaGalleryPermission>
Response
Status: 201 CREATED
<MediaGalleryPermission> ... </MediaGalleryPermission>
Update Permission
Updates the permissions assigned to a particular role. This request can be made either for a specific MediaGallery, or to set the default values for all MediaGalleries. Roles must already exist to have permissions added or changed, see the membership roles section on adding or deleting roles.
PUT /api/mediagalleries.ashx/[mediagalleries/{Id}/]permissions/{permission name}
Request
<MediaGalleryPermission> ... </MediaGalleryPermission>
Response
Status: 200 OK
<MediaGalleryPermission> ... </MediaGalleryPermission>
Delete Permission
Removes the specified explicity defined permission (where Implied="false") from the MediaGallery. This will cause the permissions for that role to again be inherited from the applicaiton level.
DELETE /api/mediagalleries.ashx/mediagalleries/{Id}/permissions/{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.
Data Reference
MediaGalleryGroup
<MediaGalleryGroup Id="7" Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagallerygroups/7"> <Name>Media Downloads</Name> <Description /> </GalleryGroup>
MediaGallery
<MediaGallery Id="8"
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8">
<MediaGalleryGroupInfo Id="7"
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagallerygroups/7" />
<Name>My Gallery</Name>
<Key>mine</Key>
<Url>http://localhost/cs/media/galleries/mine/default.aspx</Url>
<DateCreated>2007-12-31T09:26:46.763</DateCreated>
<Description />
<Settings>
<Enabled>true</Enabled>
<IsSearchable xsi:nil="true" />
<EnableRssSyndication>true</EnableRssSyndication>
<EnableTagsRss>true</EnableTagsRss>
<EnableComments>true</EnableComments>
<ModerateComments>false</ModerateComments>
<EnableCommentNotification>false</EnableCommentNotification>
<EnableMediaGalleryPostNotification>false</EnableMediaGalleryPostNotification>
<EnableRatings>true</EnableRatings>
<EnableDisclaimer>false</EnableDisclaimer>
<RestrictedFileExtensions />
<AllowedFileExtensions />
<EnableExternalLinks>true</EnableExternalLinks>
<GalleryFilesQuota>-1</GalleryFilesQuota>
<GalleryFilesMaxSize>-1</GalleryFilesMaxSize>
</Settings>
</MediaGallery>
MediaGalleryPost
<MediaGalleryPost Id="5"
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8/posts/5">
<Body>
<P mce_keep="true"> </P>
</Body>
<Url>http://localhost/cs/media/galleries/downloads/post5.aspx</Url>
<Title>Theme cool</Title>
<Date>2007-12-31T09:35:04.857</Date>
<Ratings
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8/posts/5/ratings/" />
<Comments
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8/posts/5/comments/" />
<AttachmentInfo
Endpoint="http://localhost/cs/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.00.05/CS2007_5F00_Basic_5F00_Theme.zip" />
<MediaGalleryInfo Id="8"
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8" />
<IsPublished>true</IsPublished>
<AuthorInfo Id="2100"
Endpoint="http://localhost/cs/api/membership.ashx/users/2100" />
</MediaGalleryPost>
MediaGalleryComments
<Comment Id="197" Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/36/posts/196/comments/197"> <Title>re: My First File</Title>
<Body>The sample post comment.</Body> <Date>2008-03-19T13:20:56.073</Date>
<IsPublished>true</IsPublished>
<MediaGalleryInfo Id="36" Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/36" />
<PostInfo Id="196" Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/36/posts/196" /> <AuthorInfo Id="2100" IsOwner="false">
<Time>0001-01-01T00:00:00</Time>
<HostAddress>000.000.000.000</HostAddress>
<Name />
</AuthorInfo>
</Comment>
Rating
<Rating ItemId="2" UserId="2100" UserUrl="http://localhost/cs/api/membership.ashx/users/2100" Value="5" OldValue="0"/>
Member
<Member Id="2100"
Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/8/members/2100"
Type="Owner" DateAdded="2008-01-15T08:14:42.477"/>
Permission
<MediaGalleryPermission Id="3108c739-2bf5-4e15-b12a-09dc1a321694" Name="Everyone" Implied="true" Endpoint="http://localhost/cs/api/mediagalleries.ashx/mediagalleries/permissions/everyone"> <Read>false</Read>
<Write>false</Write>
<Comment>false</Comment>
<Video>false</Video>
<LocalAttachment>false</LocalAttachment>
<RemoteAttachment>false</RemoteAttachment>
</MediaGalleryPermission>
Query Reference
Query properties are key value pairs separated by a semicolon. Arrays should be formatted as comma separated strings.
MediaGallery Query
| Property | Type | Description |
|---|---|---|
| Ids | int[] | The MediaGallery Ids you wish to include in your search |
| Keys | string[] | The MediaGallery Keys you wish to include in your search |
| GroupIds | int[] | The MediaGalleryGroup Ids you wish to include in your search |
| IsActive | bool | Include only Active MediaGalleries (only mediagallery administrators can see inactive mediagalleries) |
| PageSize | int | (defaults to 20) |
| PageIndex | int | (defaults to 0) |
| AccessLevel | string | (Defaults to "View") type of Permission Post, Edit, Reply, View, Video, LocalAttachment, RemoteAttachment |
| Name | string | The name of the Media Gallery |
| SortBy | string | Criteria to sort the media galleries by Name, Thread, Post, LastPost |
| SortOrder | string | Ascending / Descending |
MediaGallery Post Query
| Property | Type | Description |
|---|---|---|
| Ids | int[] | The Post Ids you wish to include in your search |
| GroupIds | int[] | The MediaGalleryGroup Ids you wish to include in your search |
| MediaGalleryIds | int[] | The Ids of the MediaGalleries you want to include in your search |
| IsActive | bool | Include only Pubished or Unpubished Posts |
| PageSize | int | (defaults to 20) |
| PageIndex | int | (defaults to 0) |
| Date | string | A date to filter based on |
| ThreadType | int | If Date is present, specifies the criteria to filter posts by Recent, MediaGallery (defaults to MediaGallery) |
| SortBy | string | Criteria to sort the posts by Subject, Author, Comments, Views, PostDate, Rating, Downloads (defaults to PostDate) |
| SortOrder | string | Ascending / Descending |
Comment Query
| Property | Type | Description |
|---|---|---|
| Ids | int[] | The Comment Ids you wish to include in your search |
| GroupIds | int[] | The MediaGalleryGroup Ids you wish to include in your search |
| MediaGalleryIds | int[] | The Ids of the MediaGalleries you want to include in your search |
| PostId | int | The Parent MediaGallery Post Id to find related Comments for |
| CommentId | int | The ID of the Comment to limit the query to a given post |
| IsActive | bool | Include only Pubished or Unpubished Comments |
| PageSize | int | (defaults to 20) |
| PageIndex | int | (defaults to 0) |
| Date | string | A date to filter based on |
| ThreadType | int | If Date is present, specifies the criteria to filter posts by Recent, MediaGallery (defaults to MediaGallery) |
| SortBy | string | Criteria to sort the posts by Subject, Author, Comments, Views, PostDate, Rating, Downloads (defaults to PostDate) |
| SortOrder | string | Ascending / Descending |