> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetokb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting the Article ID

> Understand how to retrieve article identifiers for use in your API calls.

## What is an article identifier?

Article identifiers are unique values used to reference specific articles in your knowledge base when making API requests. Understanding the different types of identifiers and how to find them is essential for working with the NeetoKB API.

NeetoKB supports three types of identifiers for articles, each serving different purposes:

* **ID (UUID)** - Permanent unique identifier.
  Example: `285c4bab-3ca4-4a24-9288-73392a04554e`
* **Slug** - Human-readable URL identifier.
  Example: `getting-started-guide`
* **Permalink** - Stable short identifier for updates.
  Example: `a-d17829fc`

There are two main ways to get article identifiers:

* **Using the API** - Programmatically retrieve all articles and their identifiers.
* **From the URL** - Extract identifier directly from your browser's address bar.

<Note>
  Permalinks cannot be retrieved via the API or extracted from the URL. Refer to
  the [help article](https://help.neetokb.com/articles/permalinks) for more information.
</Note>

## Method 1: Using the API Endpoint

The [List all articles](/api-reference/articles/list) API endpoint allows you to retrieve a list of all articles in your workspace, including their identifiers. This is particularly useful when you need to programmatically access or retrieve the identifiers of all available articles.

### Step-by-Step Instructions

<Steps>
  <Step title="Make the API request">
    Send a `GET` request to the [List all articles](/api-reference/articles/list) API endpoint, including your API key in the request header.
  </Step>

  <Step title="Parse the response">
    The response will contain an array of articles, each with `id`, `slug`, and other fields.

    Example:

    ```json theme={"system"}
    {
      "articles": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "slug": "getting-started",
          "title": "Getting Started Guide",
          "state": "published",
          "unique_views_count": 123,
          "category": {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "name": "Tutorials"
          }
        },

        // ... rest of the articles
      ],
      "pagination": {
        "total_records": 123,
        "total_pages": 5,
        "current_page_number": 1,
        "page_size": 30
      }
    }
    ```
  </Step>

  <Step title="Extract the article identifier">
    Here the article identifiers for the `Getting Started Guide` are:

    * **ID**: `3c90c3cc-0d44-4b50-8888-8dd25736052a`
    * **Slug**: `getting-started`

    You can access the article identifiers in your code from the response using:

    <CodeGroup>
      ```javascript JavaScript theme={"system"}
      // Get the first article's ID
      const articleId = response.articles[0].id;

      // Or iterate through all articles to find a specific one
      const startedGuide = response.articles.find(article =>
        article.title === "Getting Started Guide"
      );
      const startedGuideId = startedGuide.id;
      const startedGuideSlug = startedGuide.slug;
      ```

      ```python Python theme={"system"}
      # Get the first article's ID
      article_id = response["articles"][0]["id"]

      # Or iterate through all articles to find a specific one
      for article in response["articles"]:
          if article["title"] == "Getting Started Guide":
              started_guide_id = article["id"]
              started_guide_slug = article["slug"]
              break
      ```

      ```bash Bash theme={"system"}
      # Using jq to extract IDs from the response
      curl -X GET "https://{workspace}.neetokb.com/api/external/v1/articles" \
        -H 'X-Api-Key: your-api-key' | \
        jq '.articles[0].id'
      ```
    </CodeGroup>
  </Step>
</Steps>

<Note>
  The `articles` array contains all articles in your workspace. If you have
  multiple articles, you may want to filter by title or other properties to find
  the specific article you need.
</Note>

## Method 2: From the URL

Article identifiers appear in the URL when you view an article in your workspace. This method provides only the slug, not the article’s ID or permalink. For example, in the URL:

```
https://spinkart.neetokb.com/admin/categories/product-guides/articles/getting-started-guide/edit
```

The article slug is: **getting-started-guide**

### Step-by-Step Instructions

<Steps>
  <Step title="Navigate to your article">
    Log into your NeetoKB workspace and navigate to the article you want to work with.
  </Step>

  <Step title="Locate the article URL">
    Once you're viewing the article, look at your browser's address
    bar. The URL will contain the
    article identifier.
  </Step>

  <Step title="Extract the article identifier">
    The article identifier is typically found in the URL path. Look for a pattern like:

    ```
    https://your-subdomain.neetokb.com/admin/categories/product-guides/articles/{article-identifier}/edit
    ```

    The `{article-identifier}` part is what you need.
  </Step>
</Steps>

### Examples

Here are some examples of how article identifiers appear in URLs & permalinks:

| URL Example                                                                                      | Article Identifier      |
| ------------------------------------------------------------------------------------------------ | ----------------------- |
| `https://mycompany.neetokb.com/admin/categories/getting-started/articles/user-guide/edit`        | `user-guide`            |
| `https://support.neetokb.com/admin/categories/faq/articles/troubleshooting-tips/edit`            | `troubleshooting-tips`  |
| `https://docs.neetokb.com/admin/categories/developer-guides/articles/api-integration-guide/edit` | `api-integration-guide` |

| Permalink Example                            | Article Identifier |
| -------------------------------------------- | ------------------ |
| `https://mycompany.neetokb.com/p/a-84af178b` | a-84af178b         |
| `https://support.neetokb.com/p/b-93cd289f`   | b-93cd289f         |
| `https://docs.neetokb.com/p/c-47de12ac`      | c-47de12ac         |
