> ## Documentation Index
> Fetch the complete documentation index at: https://developer.alltalk.co.kr/llms.txt
> Use this file to discover all available pages before exploring further.

# LMS 발송

> 등록된 발신번호를 통해 장문 메시지(LMS)를 전송합니다.

<Warning>
  * **메시지 길이 제한**: LMS는 최대 **2,000바이트** (한글 약 1,000자). 초과 시 자동으로 잘리거나 발송 실패할 수 있습니다.
  * **발신번호 사전 등록**: `callbackNo` 에 사용할 발신번호는 반드시 사전에 등록되어 있어야 합니다.
</Warning>

## Headers

<ParamField header="apikey" type="string" required>
  제공받은 API key
</ParamField>

<ParamField header="groupId" type="string" required>
  그룹 코드
</ParamField>

## Body (JSON)

<ParamField body="service" type="number" required>
  제공받은 SMS 서비스 번호
</ParamField>

<ParamField body="message" type="string" required>
  발송할 메시지 (최대 2,000바이트)
</ParamField>

<ParamField body="numbers" type="string[]" required>
  수신자 핸드폰 번호 배열
</ParamField>

<ParamField body="groupId" type="string" required>
  그룹코드
</ParamField>

<ParamField body="callbackNo" type="string" required>
  발신번호. 사전에 등록되어있는 발신번호만 사용 가능합니다.
</ParamField>

<ParamField body="subject" type="string">
  메시지 제목
</ParamField>

<ParamField body="mapping" type="object[]">
  가변 변수 매핑 배열. `numbers` 와 동일 순서로 매칭됩니다.
</ParamField>

## 예제

<RequestExample>
  ```javascript Node.js theme={null}
  const lmsData = {
    service: 1234567890,
    subject: '배송 안내',
    message: `#{name}님, 주문하신 상품이 발송되었습니다.

  [배송 정보]
  - 주문번호: #{VAR1}
  - 상품명: #{VAR2}
  - 배송업체: #{VAR3}
  - 운송장번호: #{VAR4}

  배송 조회는 해당 택배사 홈페이지에서 확인 가능합니다.`,
    numbers: ['01012345678'],
    groupId: 'YOUR_GROUP_ID',
    callbackNo: '16612460',
    mapping: [
      {
        name: '홍길동',
        VAR1: 'ORD20240115001',
        VAR2: '샘플 상품',
        VAR3: 'CJ대한통운',
        VAR4: '123456789012',
      },
    ],
  };

  await axios.post('https://api.alltalk.co.kr/sms/lms', lmsData, {
    headers: {
      apikey: 'YOUR_API_KEY',
      groupId: 'YOUR_GROUP_ID',
    },
  }).then((res) => {
    console.log('전송 결과:', res.data);
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "success",
    "code": "200",
    "datetime": "2024-01-15 14:35:10",
    "value": [
      {
        "uid": 37668015185,
        "date": 1705298110123,
        "status": "MMS_0000"
      }
    ],
    "count": 1,
    "total": 1
  }
  ```
</ResponseExample>

## SMS/LMS 공통 응답코드

| 코드         | 설명                                 |
| ---------- | ---------------------------------- |
| `SMS_00`   | SMS 발송 진행 중 (발송 결과는 별도 요청으로 확인 필요) |
| `MMS_0000` | LMS 발송 진행 중 (발송 결과는 별도 요청으로 확인 필요) |
| `OK`       | 발송 접수 완료                           |
| `ERROR`    | 전송 실패                              |

전체 결과 코드는 [에러 코드](/guides/error-codes) 페이지의 SMS/LMS 결과코드 섹션을 참고하세요.

<Note>
  `status` 값은 **발송 접수 상태**를 나타냅니다. 실제 수신자에게 도달했는지는
  별도의 결과 조회 또는 콜백을 통해 확인하세요.
</Note>
