> For the complete documentation index, see [llms.txt](https://skygl.gitbook.io/devlog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skygl.gitbook.io/devlog/api.md).

# API

## Blog Duplication Check

<mark style="color:blue;">`GET`</mark> `https://api.devlog.today/api/blogs/check`

This endpoint allows you to get existence of blog or blog request with given URL.

#### Query Parameters

| Name | Type   | Description                                                                                     |
| ---- | ------ | ----------------------------------------------------------------------------------------------- |
| url  | string | The URL will be checked if a blog or blog request (which is not denied) having same URL or not. |

{% tabs %}
{% tab title="200 Response if URL was registered before or not." %}

```javascript
/*
The URL was not registered before.
*/

{
    exists: true
}


/*
A blog having the URL was registered before.
*/

{
    exists: false,
    type: "blog"
}


/*
A blog request having the URL was registered before.
*/

{
    exists: false,
    type: "blogreq"
}
```

{% endtab %}

{% tab title="422 Given URL was not valid URL format." %}

```
{
    "errors": [
        {
            "value": "URL",
            "msg": "must be url",
            "param": "url",
            "location": "query"
        }
    ]
}
```

{% endtab %}

{% tab title="500 Response if unexpected server error or database error occurs." %}

```
```

{% endtab %}
{% endtabs %}

## Register Blog Request

<mark style="color:green;">`POST`</mark> `https://api.devlog.today/api/blogreqs`

This endpoint allows you to register blog request.

#### Request Body

| Name | Type   | Description                 |
| ---- | ------ | --------------------------- |
| url  | string | The URL will be registered. |

{% tabs %}
{% tab title="200 Response if URL was registered before or not." %}

```javascript
/*
A blog request is registered with given URL.
*/

{
    "created_at": "2020-07-08T12:45:10.292Z",
    "updated_at": "2020-07-08T12:45:10.292Z",
    "_id": "5f05bfd64fa17f3950d1f679",
    "url": "https://skygl.tistory.com",
    "status": "Unhandled",
    "__v": 0,
    "id": "5f05bfd64fa17f3950d1f679"
}


/*
A blog having the URL was registered before.
*/

{
    exists: false,
    type: "blog"
}


/*
A blog request having the URL was registered before.
*/

{
    exists: false,
    type: "blogreq"
}
```

{% endtab %}

{% tab title="409 Blog or Blog request with given URL was already registered." %}

```javascript
/*
A blog having the URL was registered before.
*/

{
    type: "blog"
}


/*
A blog request having the URL was registered before.
*/

{
    type: "blogreq"
}
```

{% endtab %}

{% tab title="422 Given URL was not valid URL format." %}

```javascript
{
    "errors": [
        {
            "value": "URL",
            "msg": "must be url",
            "param": "url",
            "location": "query"
        }
    ]
}
```

{% endtab %}

{% tab title="500 Response if unexpected server error or database error occurs." %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://skygl.gitbook.io/devlog/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
