sendgo-python 1.3.0__tar.gz → 1.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/PKG-INFO +54 -1
  2. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/README.md +53 -0
  3. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/pyproject.toml +1 -1
  4. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/__init__.py +2 -0
  5. sendgo_python-1.5.0/sendgo/account.py +77 -0
  6. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/brand_template.py +2 -1
  7. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/client.py +9 -3
  8. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/notice_template.py +2 -0
  9. sendgo_python-1.5.0/sendgo/template_folder.py +25 -0
  10. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo_python.egg-info/PKG-INFO +54 -1
  11. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo_python.egg-info/SOURCES.txt +2 -0
  12. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/_payload.py +0 -0
  13. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/alimtalk.py +0 -0
  14. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/brand_message.py +0 -0
  15. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/exceptions.py +0 -0
  16. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/friendtalk.py +0 -0
  17. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/http_client.py +0 -0
  18. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/kakao_image.py +0 -0
  19. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/kakao_sender.py +0 -0
  20. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/message_template.py +0 -0
  21. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/rejected_number.py +0 -0
  22. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/sender_registration.py +0 -0
  23. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/short_url.py +0 -0
  24. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/sms.py +0 -0
  25. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/token_manager.py +0 -0
  26. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo/webhook.py +0 -0
  27. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo_python.egg-info/dependency_links.txt +0 -0
  28. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo_python.egg-info/requires.txt +0 -0
  29. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/sendgo_python.egg-info/top_level.txt +0 -0
  30. {sendgo_python-1.3.0 → sendgo_python-1.5.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sendgo-python
3
- Version: 1.3.0
3
+ Version: 1.5.0
4
4
  Summary: Sendgo Python SDK — 카카오 알림톡/브랜드메시지, SMS/LMS/MMS
5
5
  Author-email: Sendgo <dev@sendgo.io>
6
6
  License: MIT
@@ -808,3 +808,56 @@ MIT License © 2026 [Sendgo](https://sendgo.io)
808
808
  ---
809
809
 
810
810
  *키워드: 카카오 알림톡 Python, 카카오 친구톡 Django, SMS 발송 FastAPI, 알림톡 SDK pip, Python 카카오 API 연동, Django 문자 발송, FastAPI 알림톡, Celery 알림톡 비동기, Sendgo Python SDK*
811
+
812
+ ## 계정·조직·API 키 관리 (1.5.0)
813
+
814
+ 발송용 `accessKey`/`secretKey`가 없는 단계에서 사용하는 **별도 계정 클라이언트**입니다.
815
+ 콘솔에서 발급받은 에이전트 토큰(`SENDGO_AGENT_TOKEN`)으로 `/api/v2/account`를 호출합니다.
816
+ 계정 조회에는 `account:read`, 키·허용 IP 변경에는 `keys:write` 권한이 필요합니다.
817
+ 토큰 만료나 권한 부족(401/403)은 그대로 예외로 반환하며 자동 갱신·재시도하지 않습니다.
818
+
819
+ 조직 선택은 서버에 저장되는 **사용자 계정의 현재 조직**을 바꿉니다. 같은 사용자로
820
+ 여러 조직의 설정을 동시에 변경하지 마세요. 개인 계정으로 돌아가려면 조직 ID에
821
+ `null`(Python `None`, Ruby `nil`, Go `nil`) 또는 `personal`을 전달합니다.
822
+ 키 발급 응답의 `data.apiKey.secretKey`는 한 번만 반환되므로 서버의 비밀 저장소에 보관하세요.
823
+ 허용 IP가 하나라도 등록되면 목록 밖의 IP는 차단됩니다.
824
+ 에이전트 토큰과 키는 브라우저·모바일 앱에 포함하거나 응답·로그에 출력하지 않습니다.
825
+
826
+ ```python
827
+ import os
828
+ from sendgo import AccountClient
829
+ account = AccountClient(agent_token=os.environ['SENDGO_AGENT_TOKEN'])
830
+ result = account.me()
831
+ account.select_organization('team-uuid')
832
+ issued = account.create_api_key({'name': '서버 연동'})
833
+ ```
834
+
835
+ 지원 메서드: `me`, `organizations`, `select_organization`, `api_keys`, `create_api_key`, `api_key`, `update_api_key`, `delete_api_key`, `issue_token`, `allowed_ips`, `add_allowed_ip`, `delete_allowed_ip`.
836
+
837
+ 키 생성 인자는 `name`, 선택적 `ipAddresses: [{ip, description}]`이며, 허용 IP 추가 인자는 `ip`, 선택적 `description`입니다. 키·IP 식별자는 응답의 `id`(UUID)를 사용합니다.
838
+
839
+ ## 템플릿 폴더 (1.5.0)
840
+
841
+ 기업 계정의 발송용 API 키와 `apiVersion=v2` 설정으로 사용하는 서버 전용 API입니다.
842
+ 폴더는 알림톡·브랜드메시지가 공유하며, 목록의 `templateType`은 `notice` 또는 `brand`입니다.
843
+ 목록은 `data.folders` 트리와 `total`, `uncategorised` 개수를 반환합니다.
844
+ `templateCount`는 하위 폴더를 제외한 해당 폴더의 템플릿 수입니다.
845
+
846
+ - 생성: `name`, 선택 `parentUuid`. 최대 5단계이며 같은 부모 아래 이름 중복은 409입니다.
847
+ - 이동: 동일 발신프로필의 `templateCodes` 1~100개. `folderUuid`는 필수이며 `null`이면 미분류로 이동합니다.
848
+ - 템플릿 목록: `folderUuid=none`은 미분류, UUID는 해당 폴더, 생략은 전체입니다.
849
+ - 템플릿 등록: 선택 필드 `folderUuid`로 폴더를 지정합니다. 기존 템플릿 수정 API 대신 폴더 이동 API를 사용하세요.
850
+
851
+ 승인되지 않은 키의 `403 ACCESS_KEY_NOT_APPROVED`는 토큰 재발급·재시도 없이 반환합니다.
852
+ 계정 API의 `autoApprove`는 서버 설정의 실제 승인 정책을 나타냅니다.
853
+
854
+ ```python
855
+ client.template_folders.list(template_type="notice")
856
+ client.template_folders.create(name="주문 안내")
857
+ client.template_folders.assign(
858
+ template_type="notice", kakao_sender_key=kakao_sender_key,
859
+ template_codes=["ORDER_001"], folder_uuid=None,
860
+ )
861
+ client.notice_templates.list(folder_uuid="none")
862
+ # 템플릿 생성 시 folder_uuid=폴더_UUID를 선택 인자로 전달합니다.
863
+ ```
@@ -781,3 +781,56 @@ MIT License © 2026 [Sendgo](https://sendgo.io)
781
781
  ---
782
782
 
783
783
  *키워드: 카카오 알림톡 Python, 카카오 친구톡 Django, SMS 발송 FastAPI, 알림톡 SDK pip, Python 카카오 API 연동, Django 문자 발송, FastAPI 알림톡, Celery 알림톡 비동기, Sendgo Python SDK*
784
+
785
+ ## 계정·조직·API 키 관리 (1.5.0)
786
+
787
+ 발송용 `accessKey`/`secretKey`가 없는 단계에서 사용하는 **별도 계정 클라이언트**입니다.
788
+ 콘솔에서 발급받은 에이전트 토큰(`SENDGO_AGENT_TOKEN`)으로 `/api/v2/account`를 호출합니다.
789
+ 계정 조회에는 `account:read`, 키·허용 IP 변경에는 `keys:write` 권한이 필요합니다.
790
+ 토큰 만료나 권한 부족(401/403)은 그대로 예외로 반환하며 자동 갱신·재시도하지 않습니다.
791
+
792
+ 조직 선택은 서버에 저장되는 **사용자 계정의 현재 조직**을 바꿉니다. 같은 사용자로
793
+ 여러 조직의 설정을 동시에 변경하지 마세요. 개인 계정으로 돌아가려면 조직 ID에
794
+ `null`(Python `None`, Ruby `nil`, Go `nil`) 또는 `personal`을 전달합니다.
795
+ 키 발급 응답의 `data.apiKey.secretKey`는 한 번만 반환되므로 서버의 비밀 저장소에 보관하세요.
796
+ 허용 IP가 하나라도 등록되면 목록 밖의 IP는 차단됩니다.
797
+ 에이전트 토큰과 키는 브라우저·모바일 앱에 포함하거나 응답·로그에 출력하지 않습니다.
798
+
799
+ ```python
800
+ import os
801
+ from sendgo import AccountClient
802
+ account = AccountClient(agent_token=os.environ['SENDGO_AGENT_TOKEN'])
803
+ result = account.me()
804
+ account.select_organization('team-uuid')
805
+ issued = account.create_api_key({'name': '서버 연동'})
806
+ ```
807
+
808
+ 지원 메서드: `me`, `organizations`, `select_organization`, `api_keys`, `create_api_key`, `api_key`, `update_api_key`, `delete_api_key`, `issue_token`, `allowed_ips`, `add_allowed_ip`, `delete_allowed_ip`.
809
+
810
+ 키 생성 인자는 `name`, 선택적 `ipAddresses: [{ip, description}]`이며, 허용 IP 추가 인자는 `ip`, 선택적 `description`입니다. 키·IP 식별자는 응답의 `id`(UUID)를 사용합니다.
811
+
812
+ ## 템플릿 폴더 (1.5.0)
813
+
814
+ 기업 계정의 발송용 API 키와 `apiVersion=v2` 설정으로 사용하는 서버 전용 API입니다.
815
+ 폴더는 알림톡·브랜드메시지가 공유하며, 목록의 `templateType`은 `notice` 또는 `brand`입니다.
816
+ 목록은 `data.folders` 트리와 `total`, `uncategorised` 개수를 반환합니다.
817
+ `templateCount`는 하위 폴더를 제외한 해당 폴더의 템플릿 수입니다.
818
+
819
+ - 생성: `name`, 선택 `parentUuid`. 최대 5단계이며 같은 부모 아래 이름 중복은 409입니다.
820
+ - 이동: 동일 발신프로필의 `templateCodes` 1~100개. `folderUuid`는 필수이며 `null`이면 미분류로 이동합니다.
821
+ - 템플릿 목록: `folderUuid=none`은 미분류, UUID는 해당 폴더, 생략은 전체입니다.
822
+ - 템플릿 등록: 선택 필드 `folderUuid`로 폴더를 지정합니다. 기존 템플릿 수정 API 대신 폴더 이동 API를 사용하세요.
823
+
824
+ 승인되지 않은 키의 `403 ACCESS_KEY_NOT_APPROVED`는 토큰 재발급·재시도 없이 반환합니다.
825
+ 계정 API의 `autoApprove`는 서버 설정의 실제 승인 정책을 나타냅니다.
826
+
827
+ ```python
828
+ client.template_folders.list(template_type="notice")
829
+ client.template_folders.create(name="주문 안내")
830
+ client.template_folders.assign(
831
+ template_type="notice", kakao_sender_key=kakao_sender_key,
832
+ template_codes=["ORDER_001"], folder_uuid=None,
833
+ )
834
+ client.notice_templates.list(folder_uuid="none")
835
+ # 템플릿 생성 시 folder_uuid=폴더_UUID를 선택 인자로 전달합니다.
836
+ ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sendgo-python"
7
- version = "1.3.0"
7
+ version = "1.5.0"
8
8
  description = "Sendgo Python SDK — 카카오 알림톡/브랜드메시지, SMS/LMS/MMS"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -18,6 +18,7 @@ Sendgo Python SDK — 카카오 알림톡/친구톡, SMS/LMS/MMS
18
18
  )
19
19
  """
20
20
 
21
+ from .account import AccountClient
21
22
  from .brand_message import BrandMessageService
22
23
  from .brand_template import BrandTemplateService
23
24
  from .kakao_image import (
@@ -40,6 +41,7 @@ from .client import Sendgo
40
41
  from .exceptions import SendgoError
41
42
 
42
43
  __all__ = [
44
+ "AccountClient",
43
45
  "Sendgo",
44
46
  "SendgoError",
45
47
  "BrandMessageService",
@@ -0,0 +1,77 @@
1
+ from __future__ import annotations
2
+
3
+ from urllib.parse import quote
4
+ import requests
5
+ from .exceptions import SendgoError
6
+
7
+
8
+ class AccountClient:
9
+ """서버 전용 계정 API. 에이전트 토큰은 자동 갱신하지 않는다."""
10
+
11
+ def __init__(self, *, agent_token: str, base_url: str = "https://sendgo.io") -> None:
12
+ if not agent_token or not agent_token.strip():
13
+ raise ValueError("Sendgo: agent_token은 필수입니다.")
14
+ self._agent_token = agent_token
15
+ self._base_url = base_url.rstrip("/")
16
+
17
+ def me(self) -> dict:
18
+ """계정 상태와 다음 단계 조회."""
19
+ return self._request("GET", f"")
20
+
21
+ def organizations(self) -> dict:
22
+ """조직 목록 조회."""
23
+ return self._request("GET", f"organizations")
24
+
25
+ def select_organization(self, organization_id: str | None) -> dict:
26
+ """조직 선택. null은 개인 계정."""
27
+ return self._request("POST", f"organizations/select", {'organizationId': organization_id})
28
+
29
+ def api_keys(self) -> dict:
30
+ """현재 조직의 API 키 목록."""
31
+ return self._request("GET", f"api-keys")
32
+
33
+ def create_api_key(self, params: dict) -> dict:
34
+ """API 키 발급. secretKey는 이 응답에서만 반환."""
35
+ return self._request("POST", f"api-keys", params)
36
+
37
+ def api_key(self, api_key_id: str) -> dict:
38
+ """API 키 상세 조회."""
39
+ return self._request("GET", f"api-keys/{quote(api_key_id, safe='')}")
40
+
41
+ def update_api_key(self, api_key_id: str, name: str) -> dict:
42
+ """API 키 이름 변경."""
43
+ return self._request("PATCH", f"api-keys/{quote(api_key_id, safe='')}", {'name': name})
44
+
45
+ def delete_api_key(self, api_key_id: str) -> dict:
46
+ """API 키 폐기."""
47
+ return self._request("DELETE", f"api-keys/{quote(api_key_id, safe='')}")
48
+
49
+ def issue_token(self, api_key_id: str) -> dict:
50
+ """승인된 API 키의 발송용 토큰 발급."""
51
+ return self._request("POST", f"api-keys/{quote(api_key_id, safe='')}/token", {})
52
+
53
+ def allowed_ips(self, api_key_id: str) -> dict:
54
+ """허용 IP 목록과 호출자 IP 조회."""
55
+ return self._request("GET", f"api-keys/{quote(api_key_id, safe='')}/allowed-ips")
56
+
57
+ def add_allowed_ip(self, api_key_id: str, params: dict) -> dict:
58
+ """허용 IP 추가. ip와 선택적 description 사용."""
59
+ return self._request("POST", f"api-keys/{quote(api_key_id, safe='')}/allowed-ips", params)
60
+
61
+ def delete_allowed_ip(self, api_key_id: str, ip_id: str) -> dict:
62
+ """허용 IP 삭제."""
63
+ return self._request("DELETE", f"api-keys/{quote(api_key_id, safe='')}/allowed-ips/{quote(ip_id, safe='')}")
64
+
65
+ def _request(self, method: str, path: str, body: dict | None = None) -> dict:
66
+ response = requests.request(
67
+ method, f"{self._base_url}/api/v2/account" + (f"/{path}" if path else ""),
68
+ headers={"Authorization": f"Bearer {self._agent_token}", "Accept": "application/json"},
69
+ json=body, timeout=15, allow_redirects=False,
70
+ )
71
+ try:
72
+ data = response.json() if response.content else {}
73
+ except ValueError:
74
+ data = {}
75
+ if not 200 <= response.status_code < 300:
76
+ raise SendgoError.from_response(response.status_code, data, path or "account", "v2")
77
+ return data
@@ -43,11 +43,12 @@ class BrandTemplateService:
43
43
  kakao_sender_key: str | None = None,
44
44
  search: str | None = None,
45
45
  count: int | None = None,
46
+ folder_uuid: str | None = None,
46
47
  ) -> dict[str, Any]:
47
48
  """목록 조회."""
48
49
  return self._http.get(
49
50
  self._RESOURCE,
50
- {"kakaoSenderKey": kakao_sender_key, "search": search, "count": count},
51
+ {"folderUuid": folder_uuid, "kakaoSenderKey": kakao_sender_key, "search": search, "count": count},
51
52
  )
52
53
 
53
54
  def show(self, template_code: str) -> dict[str, Any]:
@@ -15,6 +15,7 @@ from .short_url import ShortUrlService
15
15
  from .sms import SmsService
16
16
  from .token_manager import TokenManager
17
17
  from .webhook import WebhookService
18
+ from .template_folder import TemplateFolderService
18
19
 
19
20
 
20
21
  class Sendgo:
@@ -66,9 +67,13 @@ class Sendgo:
66
67
 
67
68
  # ------------------------------------------------------ 관리 API (v2)
68
69
  # 콘솔에서만 되던 등록·심사. 발송과 달리 대부분 즉시 완료되지 않는다 —
69
- # 등록 성공은 "접수됨"이지 "사용 가능"이 아니다.
70
- # 카카오 채널 등록의 인증번호와 휴대폰 발신번호의 본인인증은 사람이
71
- # 개입해야 하므로 API 로 대체되지 않는다.
70
+ # 등록 성공은 "접수됨"이지 "사용 가능"이 아니다. 결과는 웹훅으로 받는다.
71
+ #
72
+ # 사람이 개입하는 지점은 카카오 채널 인증번호 하나뿐이고, 그마저도
73
+ # 여러분 화면에서 끝난다 — request_token() 이 채널 관리자 휴대폰으로
74
+ # SMS 를 보내고, 사용자가 입력한 코드를 create() 가 받는다. 휴대폰
75
+ # 발신번호는 PASS 대신 신분증 사본을 첨부해 접수하면 sendgo 가 대신
76
+ # 심사한다.
72
77
  self.kakao_senders = KakaoSenderService(http)
73
78
  self.notice_templates = NoticeTemplateService(http)
74
79
  self.brand_templates = BrandTemplateService(http)
@@ -77,3 +82,4 @@ class Sendgo:
77
82
  self.kakao_images = KakaoImageService(http)
78
83
  self.rejected_numbers = RejectedNumberService(http)
79
84
  self.webhook = WebhookService(http)
85
+ self.template_folders = TemplateFolderService(http)
@@ -52,11 +52,13 @@ class NoticeTemplateService:
52
52
  inspection_status: str | None = None,
53
53
  search: str | None = None,
54
54
  count: int | None = None,
55
+ folder_uuid: str | None = None,
55
56
  ) -> dict[str, Any]:
56
57
  """목록 조회."""
57
58
  return self._http.get(
58
59
  self._RESOURCE,
59
60
  {
61
+ "folderUuid": folder_uuid,
60
62
  "kakaoSenderKey": kakao_sender_key,
61
63
  "inspectionStatus": inspection_status,
62
64
  "search": search,
@@ -0,0 +1,25 @@
1
+ """템플릿 공용 폴더. v2 전용, 기업 계정 전용."""
2
+ from __future__ import annotations
3
+ from typing import Any, Literal
4
+ from .http_client import HttpClient
5
+
6
+ class TemplateFolderService:
7
+ def __init__(self, http: HttpClient) -> None:
8
+ self._http = http
9
+
10
+ def list(self, *, template_type: Literal["notice", "brand"] | None = None,
11
+ kakao_sender_key: str | None = None) -> dict[str, Any]:
12
+ """폴더 트리와 유형별 템플릿 수를 조회합니다."""
13
+ return self._http.get("template-folders", {"templateType": template_type, "kakaoSenderKey": kakao_sender_key})
14
+
15
+ def create(self, *, name: str, parent_uuid: str | None = None) -> dict[str, Any]:
16
+ """루트 또는 하위 폴더를 생성합니다."""
17
+ return self._http.post("template-folders", {"name": name, "parentUuid": parent_uuid})
18
+
19
+ def assign(self, *, template_type: Literal["notice", "brand"], kakao_sender_key: str,
20
+ template_codes: list[str], folder_uuid: str | None) -> dict[str, Any]:
21
+ """1~100개 템플릿을 이동합니다. None이면 미분류로 이동합니다."""
22
+ return self._http.patch("template-folders/templates", {
23
+ "templateType": template_type, "kakaoSenderKey": kakao_sender_key,
24
+ "templateCodes": template_codes, "folderUuid": folder_uuid,
25
+ })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sendgo-python
3
- Version: 1.3.0
3
+ Version: 1.5.0
4
4
  Summary: Sendgo Python SDK — 카카오 알림톡/브랜드메시지, SMS/LMS/MMS
5
5
  Author-email: Sendgo <dev@sendgo.io>
6
6
  License: MIT
@@ -808,3 +808,56 @@ MIT License © 2026 [Sendgo](https://sendgo.io)
808
808
  ---
809
809
 
810
810
  *키워드: 카카오 알림톡 Python, 카카오 친구톡 Django, SMS 발송 FastAPI, 알림톡 SDK pip, Python 카카오 API 연동, Django 문자 발송, FastAPI 알림톡, Celery 알림톡 비동기, Sendgo Python SDK*
811
+
812
+ ## 계정·조직·API 키 관리 (1.5.0)
813
+
814
+ 발송용 `accessKey`/`secretKey`가 없는 단계에서 사용하는 **별도 계정 클라이언트**입니다.
815
+ 콘솔에서 발급받은 에이전트 토큰(`SENDGO_AGENT_TOKEN`)으로 `/api/v2/account`를 호출합니다.
816
+ 계정 조회에는 `account:read`, 키·허용 IP 변경에는 `keys:write` 권한이 필요합니다.
817
+ 토큰 만료나 권한 부족(401/403)은 그대로 예외로 반환하며 자동 갱신·재시도하지 않습니다.
818
+
819
+ 조직 선택은 서버에 저장되는 **사용자 계정의 현재 조직**을 바꿉니다. 같은 사용자로
820
+ 여러 조직의 설정을 동시에 변경하지 마세요. 개인 계정으로 돌아가려면 조직 ID에
821
+ `null`(Python `None`, Ruby `nil`, Go `nil`) 또는 `personal`을 전달합니다.
822
+ 키 발급 응답의 `data.apiKey.secretKey`는 한 번만 반환되므로 서버의 비밀 저장소에 보관하세요.
823
+ 허용 IP가 하나라도 등록되면 목록 밖의 IP는 차단됩니다.
824
+ 에이전트 토큰과 키는 브라우저·모바일 앱에 포함하거나 응답·로그에 출력하지 않습니다.
825
+
826
+ ```python
827
+ import os
828
+ from sendgo import AccountClient
829
+ account = AccountClient(agent_token=os.environ['SENDGO_AGENT_TOKEN'])
830
+ result = account.me()
831
+ account.select_organization('team-uuid')
832
+ issued = account.create_api_key({'name': '서버 연동'})
833
+ ```
834
+
835
+ 지원 메서드: `me`, `organizations`, `select_organization`, `api_keys`, `create_api_key`, `api_key`, `update_api_key`, `delete_api_key`, `issue_token`, `allowed_ips`, `add_allowed_ip`, `delete_allowed_ip`.
836
+
837
+ 키 생성 인자는 `name`, 선택적 `ipAddresses: [{ip, description}]`이며, 허용 IP 추가 인자는 `ip`, 선택적 `description`입니다. 키·IP 식별자는 응답의 `id`(UUID)를 사용합니다.
838
+
839
+ ## 템플릿 폴더 (1.5.0)
840
+
841
+ 기업 계정의 발송용 API 키와 `apiVersion=v2` 설정으로 사용하는 서버 전용 API입니다.
842
+ 폴더는 알림톡·브랜드메시지가 공유하며, 목록의 `templateType`은 `notice` 또는 `brand`입니다.
843
+ 목록은 `data.folders` 트리와 `total`, `uncategorised` 개수를 반환합니다.
844
+ `templateCount`는 하위 폴더를 제외한 해당 폴더의 템플릿 수입니다.
845
+
846
+ - 생성: `name`, 선택 `parentUuid`. 최대 5단계이며 같은 부모 아래 이름 중복은 409입니다.
847
+ - 이동: 동일 발신프로필의 `templateCodes` 1~100개. `folderUuid`는 필수이며 `null`이면 미분류로 이동합니다.
848
+ - 템플릿 목록: `folderUuid=none`은 미분류, UUID는 해당 폴더, 생략은 전체입니다.
849
+ - 템플릿 등록: 선택 필드 `folderUuid`로 폴더를 지정합니다. 기존 템플릿 수정 API 대신 폴더 이동 API를 사용하세요.
850
+
851
+ 승인되지 않은 키의 `403 ACCESS_KEY_NOT_APPROVED`는 토큰 재발급·재시도 없이 반환합니다.
852
+ 계정 API의 `autoApprove`는 서버 설정의 실제 승인 정책을 나타냅니다.
853
+
854
+ ```python
855
+ client.template_folders.list(template_type="notice")
856
+ client.template_folders.create(name="주문 안내")
857
+ client.template_folders.assign(
858
+ template_type="notice", kakao_sender_key=kakao_sender_key,
859
+ template_codes=["ORDER_001"], folder_uuid=None,
860
+ )
861
+ client.notice_templates.list(folder_uuid="none")
862
+ # 템플릿 생성 시 folder_uuid=폴더_UUID를 선택 인자로 전달합니다.
863
+ ```
@@ -2,6 +2,7 @@ README.md
2
2
  pyproject.toml
3
3
  sendgo/__init__.py
4
4
  sendgo/_payload.py
5
+ sendgo/account.py
5
6
  sendgo/alimtalk.py
6
7
  sendgo/brand_message.py
7
8
  sendgo/brand_template.py
@@ -17,6 +18,7 @@ sendgo/rejected_number.py
17
18
  sendgo/sender_registration.py
18
19
  sendgo/short_url.py
19
20
  sendgo/sms.py
21
+ sendgo/template_folder.py
20
22
  sendgo/token_manager.py
21
23
  sendgo/webhook.py
22
24
  sendgo_python.egg-info/PKG-INFO
File without changes