Moderar comentário
curl --request PATCH \
--url https://api.cakto.com.br/public_api/members/comments/{id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_hidden": true
}
'import requests
url = "https://api.cakto.com.br/public_api/members/comments/{id}/"
payload = { "is_hidden": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_hidden: true})
};
fetch('https://api.cakto.com.br/public_api/members/comments/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cakto.com.br/public_api/members/comments/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'is_hidden' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/members/comments/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_hidden\": true\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.patch("https://api.cakto.com.br/public_api/members/comments/{id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_hidden\": true\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/members/comments/{id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"is_hidden\": true\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"status": "<string>",
"is_hidden": true,
"creator_viewed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"picture": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
},
"lesson": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"module": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"position": 123,
"section": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
},
"replies": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"is_hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"user": {
"picture": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
}
}
]
}
Comentários
Moderar comentário
is_hidden: true esconde o comentário dos alunos.
PATCH
/
public_api
/
members
/
comments
/
{id}
/
Moderar comentário
curl --request PATCH \
--url https://api.cakto.com.br/public_api/members/comments/{id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_hidden": true
}
'import requests
url = "https://api.cakto.com.br/public_api/members/comments/{id}/"
payload = { "is_hidden": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_hidden: true})
};
fetch('https://api.cakto.com.br/public_api/members/comments/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cakto.com.br/public_api/members/comments/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'is_hidden' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/members/comments/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_hidden\": true\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.patch("https://api.cakto.com.br/public_api/members/comments/{id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_hidden\": true\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/members/comments/{id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"is_hidden\": true\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"status": "<string>",
"is_hidden": true,
"creator_viewed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"user": {
"picture": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
},
"lesson": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"module": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"position": 123,
"section": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
},
"replies": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"is_hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"user": {
"picture": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
}
}
]
}
Escopo
write members
Authorizations
Token de autenticação do tipo Bearer {access_token}, onde {access_token} é o token obtido no fluxo de autenticação.
Response
Was this page helpful?