Caution
Experimental - 이 SDK는 현재 실험 단계입니다. API가 예고 없이 변경될 수 있으며, 프로덕션 환경에서의 사용은 권장하지 않습니다. 피드백은 GitHub Discussions에 남겨주세요!
SMS, LMS, MMS, 카카오 알림톡/친구톡 발송을 지원하는 SOLAPI 공식 Elixir SDK입니다.
1. 의존성 추가 (mix.exs):
def deps do
[{:solapi, "~> 0.1.0"}]
end2. 환경 변수 설정:
export SOLAPI_API_KEY="your_api_key"
export SOLAPI_API_SECRET="your_api_secret"3. 메시지 발송:
Solapi.send(%{to: "01012345678", from: "0212345678", text: "안녕하세요!"})config/runtime.exs:
config :solapi,
api_key: System.get_env("SOLAPI_API_KEY"),
api_secret: System.get_env("SOLAPI_API_SECRET")client = Solapi.client(api_key: "key", api_secret: "secret")
Solapi.send(client, %{to: "01012345678", from: "0212345678", text: "안녕하세요!"})Solapi.send(%{to: "01012345678", from: "0212345678", text: "안녕하세요!"})Solapi.send(%{to: "01012345678", from: "0212345678", subject: "공지", text: "장문 메시지..."})Solapi.send(%{to: "01012345678", from: "0212345678", type: "MMS", text: "내용", image_id: "IMG_ID"})Solapi.send(%{
to: "01012345678",
from: "0212345678",
kakao_options: %{
"pfId" => "KA01PF...",
"templateId" => "KA01TP...",
"variables" => %{"#{고객명}" => "홍길동"}
}
})messages = [
%{to: "01012345678", from: "0212345678", text: "메시지 1"},
%{to: "01087654321", from: "0212345678", text: "메시지 2"}
]
Solapi.send(client, messages)| 타입 | 설명 |
|---|---|
Solapi.Error.ValidationError |
필수 파라미터 누락 |
Solapi.Error.ApiError |
API 응답 에러 (인증 실패 등) |
Solapi.Error.NetworkError |
네트워크 오류 |
case Solapi.send(message) do
{:ok, response} -> IO.puts("성공: #{response["messageId"]}")
{:error, %Solapi.Error.ApiError{message: msg}} -> IO.puts("실패: #{msg}")
{:error, error} -> IO.puts("에러: #{inspect(error)}")
end- 예제: examples/
- API 문서: HexDocs
- SOLAPI 문서: developers.solapi.com
MIT License - LICENSE