> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/dev-guide/dev-start/markdown/url.md).

# 단축 URL 가이드

이 문서는 단축 URL을 생성하는 방법에 대해 다룹니다.

{% stepper %}
{% step %}

### Config 설정 방법 및 확인

application.yml 예시:

```yaml
shortUrl:
  clientId: fguXF8_4cJHrRgDEIQCJ
  secretKey: dEs5wPqo93
```

{% hint style="info" %}
`clientId`, `secretKey` 속성들은 네이버 개발자 센터에서 발급받아 작성합니다.
{% endhint %}
{% endstep %}

{% step %}

### 각 업무단 작성 방법 (샘플 및 설명)

#### Sample 소스 (예시)

```java
... private final ShortUrl shortUrl;

public ShortUrlResponse shortUrl(String url) throws Exception {
    ShortUrlResponse shortUrlResponse = shortUrl.getShortUrl(url);
    return shortUrlResponse;
}
...
```

단축할 url 정보를 String으로 받아 `getShortUrl` 메소드에 파라미터로 넣고 호출하면 아래 테이블과 같이 값이 반환 됩니다.

| 속성               | 타입     | 설명                     |
| ---------------- | ------ | ---------------------- |
| message          | string | 오류 메시지. 응답에 성공하면 ok 반환 |
| code             | string | HTTP 상태 코드             |
| result.hash      | string | 단축 URL의 해시 정보          |
| result.url       | string | 단축된 URL                |
| result.orgUrl    | string | 원본 URL                 |
| {% endstep %}    |        |                        |
| {% endstepper %} |        |                        |


---

# 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:

```
GET https://tech.x2bee.com/dev-guide/dev-start/markdown/url.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.
