No project description provided
Project description
한국 통신사 rcs 를 위한 pydantic 구조체
Installation
pip install rcs-pydantic
Quick start
import httpx
from fastapi import Body, FastAPI
from rcs_pydantic import scheme
app = FastAPI()
def get_card(message_info):
rcs_message = RcsMessage(
message_info,
agency_id="ktbizrcs",
message_base_id="STANDALONE_1",
service_type="RCSSMS",
expiry_option=2,
header="0",
footer="080-0000-0000",
cdr_id="ktrcs02",
copy_allowed=True,
body=scheme.RcsSMSBody(
description=textwrap.dedent(
"""\
안녕하세요.
메세지입니다.
"""
)
),
buttons=[
scheme.ButtonInfo(
suggestions=[
scheme.SuggestionInfo(
action=scheme.ActionInfo(
urlAction=scheme.UrlActionInfo(
openUrl=scheme.OpenUrlInfo(url="https://www.kt.com")
),
displayText="kt 홈페이지 들어가기",
postback=scheme.PostbackInfo(data="postback_kt"),
)
)
]
)
],
)
return rcs_message
@app.post("/corp/{version}/momsg")
async def recieve_message(version: str, message_info: scheme.MessageInfo = Body(...)):
"""
메세지 받는 웹훅
"""
body = get_card(message_info)
response = httpx.post(url=f"{config.RCS_URL}/message", json=body.json())
return {"status": response.status_code, "content": response.json()}
Features
TODO
Contribution
TODO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rcs-pydantic-0.1.8.tar.gz
(12.1 kB
view hashes)
Built Distribution
Close
Hashes for rcs_pydantic-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f3ddc33723b2bdbdfac74bb7e21844bd12bb08fa134f5fa2bd4fe7fb039a347 |
|
MD5 | 874710e9ee1344795dee260d4fea8e0e |
|
BLAKE2b-256 | b3ce5b5e255eba9dc10b1dc8868a3c95c9b9dda021d4d1f942bbeeb29155ebb7 |