Lilt API Binding for Javascript
All URIs are relative to https://lilt.com/2
Method | HTTP request | Description |
---|---|---|
createComment | POST /comments | Create a new comment |
deleteComment | DELETE /comments | Delete a Comment |
getDocumentComments | GET /comments | Retrieve a document's comments by segment |
updateComment | PUT /comments | Update an existing comment |
Comment createComment(documentId, segmentId, body)
Create a new comment
Create a new comment for the specified Segment ID.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.CommentsApi();
let documentId = 56; // Number | A unique document identifier.
let segmentId = 56; // Number | A unique segment identifier.
let body = new LiltNode.CommentBody(); // CommentBody | The comment being created
apiInstance.createComment(documentId, segmentId, body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
documentId | Number | A unique document identifier. | |
segmentId | Number | A unique segment identifier. | |
body | CommentBody | The comment being created |
CommentDeleteResponse deleteComment(commentId)
Delete a Comment
Delete a Comment. Example CURL command: ``` curl -X DELETE https://lilt.com/2/comments?key=API_KEY&comment_id=123 ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.CommentsApi();
let commentId = 56; // Number | A unique Comment identifier.
apiInstance.deleteComment(commentId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
commentId | Number | A unique Comment identifier. |
DocumentComments getDocumentComments(documentId)
Retrieve a document's comments by segment
Retrieves all comments associated with a specified document, grouped by their Segment's ID. To retrieve a document's comments, specify the <strong>document_id</strong> request parameter. Example CURL command: ``` curl -X GET https://lilt.com/2/comments?key=API_KEY&document_id=123 ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.CommentsApi();
let documentId = 56; // Number | A unique document identifier.
apiInstance.getDocumentComments(documentId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
documentId | Number | A unique document identifier. |
Comment updateComment(commentId, documentId, body)
Update an existing comment
Update an existing comment.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.CommentsApi();
let commentId = 56; // Number | A unique comment identifier.
let documentId = 56; // Number | A unique document identifier.
let body = new LiltNode.CommentBody(); // CommentBody | The comment being updated.
apiInstance.updateComment(commentId, documentId, body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
commentId | Number | A unique comment identifier. | |
documentId | Number | A unique document identifier. | |
body | CommentBody | The comment being updated. |