createComment
/api/courses/{courseId}/comments
Usage and SDK Samples
curl -X POST \
-H "Accept: */*" \
"https://localhost:8443/api/courses/{courseId}/comments?text=text_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CommentRestControllerApi;
import java.io.File;
import java.util.*;
public class CommentRestControllerApiExample {
public static void main(String[] args) {
// Create an instance of the API class
CommentRestControllerApi apiInstance = new CommentRestControllerApi();
Long courseId = 789; // Long |
String text = text_example; // String |
try {
Object result = apiInstance.createComment(courseId, text);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentRestControllerApi#createComment");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final Long courseId = new Long(); // Long |
final String text = new String(); // String |
try {
final result = await api_instance.createComment(courseId, text);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->createComment: $e\n');
}
import org.openapitools.client.api.CommentRestControllerApi;
public class CommentRestControllerApiExample {
public static void main(String[] args) {
CommentRestControllerApi apiInstance = new CommentRestControllerApi();
Long courseId = 789; // Long |
String text = text_example; // String |
try {
Object result = apiInstance.createComment(courseId, text);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentRestControllerApi#createComment");
e.printStackTrace();
}
}
}
// Create an instance of the API class
CommentRestControllerApi *apiInstance = [[CommentRestControllerApi alloc] init];
Long *courseId = 789; // (default to null)
String *text = text_example; // (default to null)
[apiInstance createCommentWith:courseId
text:text
completionHandler: ^(Object output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OpenApiDefinition = require('open_api_definition');
// Create an instance of the API class
var api = new OpenApiDefinition.CommentRestControllerApi()
var courseId = 789; // {Long}
var text = text_example; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createComment(courseId, text, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createCommentExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new CommentRestControllerApi();
var courseId = 789; // Long | (default to null)
var text = text_example; // String | (default to null)
try {
Object result = apiInstance.createComment(courseId, text);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling CommentRestControllerApi.createComment: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CommentRestControllerApi();
$courseId = 789; // Long |
$text = text_example; // String |
try {
$result = $api_instance->createComment($courseId, $text);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CommentRestControllerApi->createComment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CommentRestControllerApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CommentRestControllerApi->new();
my $courseId = 789; # Long |
my $text = text_example; # String |
eval {
my $result = $api_instance->createComment(courseId => $courseId, text => $text);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CommentRestControllerApi->createComment: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.CommentRestControllerApi()
courseId = 789 # Long | (default to null)
text = text_example # String | (default to null)
try:
api_response = api_instance.create_comment(courseId, text)
pprint(api_response)
except ApiException as e:
print("Exception when calling CommentRestControllerApi->createComment: %s\n" % e)
extern crate CommentRestControllerApi;
pub fn main() {
let courseId = 789; // Long
let text = text_example; // String
let mut context = CommentRestControllerApi::Context::default();
let result = client.createComment(courseId, text, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| courseId* |
Long
(int64)
Required
|
| Name | Description |
|---|---|
| text* |
String
Required
|