All URIs are relative to https://dev.to/api.
| Method | HTTP request | Description |
|---|---|---|
| getCommentById() | GET /comments/{id} | Comment |
| getCommentsByArticleId() | GET /comments | Comments |
getCommentById($id): \Bitween\DevTo\Model\CommentComment
This endpoint allows the client to retrieve a comment as well as his descendants comments. It will return the required comment (the root) with its nested descendants as a thread. See the format specification for further details.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Bitween\DevTo\Api\CommentsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = m35m; // string | Comment identifier.
try {
$result = $apiInstance->getCommentById($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CommentsApi->getCommentById: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | Comment identifier. |
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCommentsByArticleId($aId, $pId): \Bitween\DevTo\Model\Comment[]Comments
This endpoint allows the client to retrieve all comments belonging to an article or podcast episode as threaded conversations. It will return the all top level comments with their nested comments as threads. See the format specification for further details.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Bitween\DevTo\Api\CommentsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$aId = 270180; // int | Article identifier.
$pId = 124; // int | Podcast Episode identifier.
try {
$result = $apiInstance->getCommentsByArticleId($aId, $pId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CommentsApi->getCommentsByArticleId: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| aId | int | Article identifier. | [optional] |
| pId | int | Podcast Episode identifier. | [optional] |
\Bitween\DevTo\Model\Comment[]
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]