SMS API
createSMSMessage
Anchor link to사용자에게 SMS 알림을 보내는 데 사용됩니다.
POST https://api.pushwoosh.com/json/1.3/createSMSMessage
요청 본문
Anchor link to| 이름 | 필수 여부 | 유형 | 설명 |
|---|---|---|---|
| auth* | 예 | string | Pushwoosh Control Panel의 API Access token. |
| application* | 예 | string | Pushwoosh Application code |
| notifications* | 예 | array | 콘텐츠 설정. 메시지 매개변수의 JSON 배열입니다. 자세한 내용은 아래를 참조하세요. |
알림 매개변수
| 이름 | 필수 여부 | 유형 | 설명 |
|---|---|---|---|
| send_date* | 예 | string | 알림을 보낼 날짜와 시간입니다. YYYY-MM-DD HH:mm 형식을 사용하거나 즉시 보내려면 now를 사용하세요. |
| content* | 예 | string | SMS 메시지의 텍스트 콘텐츠입니다. |
| devices* | 예 | array | 고객 전화번호입니다 (/registerDevice를 사용하여 User ID와 연결되고 hwid 매개변수에 지정되거나 use_auto_registration을 사용해야 함). 여기에는 하나의 번호만 지정할 수 있습니다. |
| use_auto_registration | 아니요 | boolean | true로 설정하면 devices 매개변수에 지정된 전화번호가 자동으로 등록됩니다. |
| dynamic_content_placeholders | 아니요 | object | 메시지 콘텐츠를 커스터마이징하기 위한 동적 콘텐츠 자리 표시자입니다. 각 자리 표시자는 해당하는 동적 값으로 대체됩니다. |
| preset | 아니요 | string | Control Panel의 SMS Preset Code. |
요청 예시
Anchor link to{ "request": { "application": "12345-67891", // required. Pushwoosh application code. "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel. "notifications": [{ "send_date": "now", // required. YYYY-MM-DD HH:mm OR "now". "content": "Hello!", // required. SMS text (string). "devices": ["+1234567890"], // required. Customer phone number (must be associated with // a UserId using. /registerDevice and specified in // the "hwid" parameter or use "use_auto_registration"). // Only one number can be specified here. "preset": "XXXXX-XXXXX", // optional. SMS Preset Code from your Control Panel. "use_auto_registration": true // optional. Automatically register phone number specified // in "devices" parameter. }] }}응답 예시
Anchor link to{ "status_code": 200, "status_message": "OK", "response": { "Messages": [ "9648-0B10ECB6-0D9F214D" ] }}오류 응답
Anchor link to{ "status_code": 210, "status_message": "Invalid devices list. \"devices\" must be an array.", "response": { "Messages": [] }}SMS 통계를 얻으려면 totalsByIntervals 메서드를 사용하세요.
Message History 섹션에서 각 메시지에 대한 통계를 볼 수도 있습니다.