# Post with Comments Tracking API

Fetch All Comments with Sentiment Off - API Instructions

| Status       | Draft                                 |
| ------------ | ------------------------------------- |
| **Base URL** | `https://dashboard.ylytic.com/ylytic` |

***

### 1. Create One-Post Campaign <a href="#id-1.-create-one-post-campaign" id="id-1.-create-one-post-campaign"></a>

**Description:** Initialize a tracking campaign with **"Fetch All" enabled** and **"Sentiment Analysis" disabled**.

**Endpoint:** `POST /admin/api/v1/campaigns/post_tracking`

### Request Details <a href="#request-details" id="request-details"></a>

**Headers:**

* `Authorization`: `Bearer <ACCESS_TOKEN>`
* `Content-Type`: `application/json`

**Body Parameters:**

| Parameter                | Type    | Required | Description                         |
| ------------------------ | ------- | -------- | ----------------------------------- |
| `url`                    | String  | Yes      | The URL of the post to track.       |
| `tracking_duration`      | Enum    | Yes      | Options: `day`, `14_days`, `month`. |
| `fetch_all_comments`     | Boolean | Yes      | Set to `true`.                      |
| `sentiment_analysis_req` | Boolean | Yes      | Set to `false`.                     |

### Code Examples (cURL) <a href="#code-examples-curl" id="code-examples-curl"></a>

**Track for 1 Day**

`curl --location --request POST "https://dashboard.ylytic.com/ylytic/admin/api/v1/campaigns/post_tracking" \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Content-Type: application/json" \ --data-raw '{ "url": "<POST_URL>", "tracking_duration": "day", "fetch_all_comments": true, "sentiment_analysis_req": false }'`

**Track for 14 Days**

`curl --location --request POST "https://dashboard.ylytic.com/ylytic/admin/api/v1/campaigns/post_tracking" \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Content-Type: application/json" \ --data-raw '{ "url": "<POST_URL>", "tracking_duration": "14_days", "fetch_all_comments": true, "sentiment_analysis_req": false }'`

***

### 2. Get Campaign Comments List (Business API) <a href="#id-2.-get-campaign-comments-list" id="id-2.-get-campaign-comments-list"></a>

**Description:** Retrieve the list of comments for a specific campaign via the campaign comment list endpoint.

**Endpoint:** `GET /business/api/v1/campaigns/<CAMPAIGN_ID>/comments_list`

**Request Details**

**Headers:**

* `Authorization`: `Bearer <ACCESS_TOKEN>`

**Query Parameters:**

| Parameter | Type    | Required | Description                 |
| --------- | ------- | -------- | --------------------------- |
| `page`    | Integer | Yes      | Page number for pagination. |
| `limit`   | Integer | Yes      | Number of results per page. |

**Code Examples (cURL)**&#x20;

**Fetch Page 1**

bash

```
curl --location --request GET "https://dashboard.ylytic.com/ylytic/business/api/v1/campaigns/<CAMPAIGN_ID>/comments_list?page=1&limit=100" \
--header "Authorization: Bearer <ACCESS_TOKEN>"
```

**Fetch Page 2**

bash

```
curl --location --request GET "https://dashboard.ylytic.com/ylytic/business/api/v1/campaigns/<CAMPAIGN_ID>/comments_list?page=2&limit=100" \
--header "Authorization: Bearer <ACCESS_TOKEN>"
```

***

### Suggested Workflow <a href="#suggested-workflow" id="suggested-workflow"></a>

1. **Initialize**: Call `post_tracking` with the required flags.
2. **Store ID**: Save the `campaign_id` returned in the response.
3. **Wait for Webhook**: Wait for the system to process comments.
4. **Fetch Data**: Call `comments_list` starting at `page=1`.
5. **Paginate**: Increment the `page` parameter until `has_next` is `false`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ylytic.com/ylytic/rest-apis/api-overview/post-with-comments-tracking-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
