POST | /RestApi/comments-api/comments |
---|
"use strict";
export class GroupCreateRequest {
/** @param {{Key?:string,Name?:string,Description?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Key;
/** @type {string} */
Name;
/** @type {string} */
Description;
}
export class ThreadCreateRequest {
/** @param {{Key?:string,Type?:string,Behavior?:string,Title?:string,Language?:string,DataSource?:string,GroupKey?:string,Group?:GroupCreateRequest}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Key;
/** @type {string} */
Type;
/** @type {string} */
Behavior;
/** @type {string} */
Title;
/** @type {string} */
Language;
/** @type {string} */
DataSource;
/** @type {string} */
GroupKey;
/** @type {GroupCreateRequest} */
Group;
}
export class CaptchaInfo {
/** @param {{Answer?:string,CorrectAnswer?:string,InitializationVector?:string,Key?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Answer;
/** @type {string} */
CorrectAnswer;
/** @type {string} */
InitializationVector;
/** @type {string} */
Key;
}
export class CommentCreateRequest {
/** @param {{Message?:string,Name?:string,Email?:string,CustomData?:string,ThreadKey?:string,Thread?:ThreadCreateRequest,Captcha?:CaptchaInfo,Rating?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Message;
/** @type {string} */
Name;
/** @type {string} */
Email;
/** @type {string} */
CustomData;
/** @type {string} */
ThreadKey;
/** @type {ThreadCreateRequest} */
Thread;
/** @type {CaptchaInfo} */
Captcha;
/** @type {?number} */
Rating;
}
export class CommentResponse {
/** @param {{Key?:string,Name?:string,Message?:string,DateCreated?:string,ProfilePictureUrl?:string,ProfilePictureThumbnailUrl?:string,Status?:string,Email?:string,ThreadKey?:string,AuthorIpAddress?:string,CustomData?:string,Rating?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Key;
/** @type {string} */
Name;
/** @type {string} */
Message;
/** @type {string} */
DateCreated;
/** @type {string} */
ProfilePictureUrl;
/** @type {string} */
ProfilePictureThumbnailUrl;
/** @type {string} */
Status;
/** @type {string} */
Email;
/** @type {string} */
ThreadKey;
/** @type {string} */
AuthorIpAddress;
/** @type {string} */
CustomData;
/** @type {?number} */
Rating;
}
JavaScript CommentCreateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /RestApi/comments-api/comments HTTP/1.1
Host: www.asg.com.au
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CommentCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Services.Comments.DTO">
<Captcha>
<Answer>String</Answer>
<CorrectAnswer>String</CorrectAnswer>
<InitializationVector>String</InitializationVector>
<Key>String</Key>
</Captcha>
<CustomData>String</CustomData>
<Email>String</Email>
<Message>String</Message>
<Name>String</Name>
<Rating>0</Rating>
<Thread>
<Behavior>String</Behavior>
<DataSource>String</DataSource>
<Group>
<Description>String</Description>
<Key>String</Key>
<Name>String</Name>
</Group>
<GroupKey>String</GroupKey>
<Key>String</Key>
<Language>String</Language>
<Title>String</Title>
<Type>String</Type>
</Thread>
<ThreadKey>String</ThreadKey>
</CommentCreateRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CommentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Services.Comments.DTO"> <AuthorIpAddress>String</AuthorIpAddress> <CustomData>String</CustomData> <DateCreated>0001-01-01T00:00:00</DateCreated> <Email>String</Email> <Key>String</Key> <Message>String</Message> <Name>String</Name> <ProfilePictureThumbnailUrl>String</ProfilePictureThumbnailUrl> <ProfilePictureUrl>String</ProfilePictureUrl> <Rating>0</Rating> <Status>String</Status> <ThreadKey>String</ThreadKey> </CommentResponse>