Skip to content

Commit 4967868

Browse files
authored
Merge pull request #5 from wileyday/main
RCS MMS 예제 추가
2 parents d4b766e + dbdc638 commit 4967868

27 files changed

+397
-10
lines changed
File renamed without changes.
File renamed without changes.

examples/rcs/images/sample1.png

4.72 KB
Loading

examples/rcs/images/sample2.png

4.73 KB
Loading

examples/rcs/images/sample3.png

4.7 KB
Loading

examples/rcs/images/sample4.png

4.63 KB
Loading

examples/rcs/images/sample5.png

4.69 KB
Loading

examples/rcs/images/sample6.png

4.62 KB
Loading

examples/rcs/send_rcs_lms.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
'messages': [
1010
{
1111
'to': '01000000001',
12-
'from': '029302266',
13-
'type': 'RCS_LMS',
12+
'from': '029302266', # 반드시 RCSBizCenter에 등록된 발신번호 입력
1413
'subject': 'LMS 제목',
1514
'text': 'RCS LMS를 발송합니다.',
1615
'rcsOptions': {
17-
'brandId': 'RC01BR210526093952685ArBrUMyeOTy', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
16+
'brandId': 'BR.iIr12HZe3j', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
1817
}
1918
},
2019
# 버튼이 포함된 RCS LMS를 발송합니다. 버튼은 최대 3개까지 추가 가능합니다.
2120
{
2221
'to': [ '01000000002', '01000000003' ], # 신번호를 array로 입력하면 같은 내용을 여러명에게 보낼 수 있습니다.
2322
'from': '029302266',
24-
'type' => 'RCS_LMS',
2523
'subject': 'LMS 제목',
2624
'text': '버튼이 포함된 RCS LMS를 발송합니다. 버튼은 최대 3개까지 추가 가능합니다.',
2725
'rcsOptions': {
28-
'brandId': 'RC01BR210526093952685ArBrUMyeOTy', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
26+
'brandId': 'BR.iIr12HZe3j', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
2927
'buttons': [
3028
{ 'buttonType': 'WL', 'buttonName': '홈페이지 바로가기', 'link': 'https://nurigo.net' }
3129
, { 'buttonType': 'ML', 'buttonName': '지도 위치 표시', 'latitude': '37.280342669603684', 'longitude': '127.11824209721874', 'label': '누리고', 'link': 'https://nurigo.net' }

examples/rcs/send_rcs_mms.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import json
2+
import sys
3+
sys.path.append('../../lib')
4+
import message
5+
import storage
6+
7+
# 한번 요청으로 1만건의 메시지 발송이 가능합니다.
8+
if __name__ == '__main__':
9+
res = storage.uploadRCSImage('../testImage.jpg').json()
10+
fileId = res['fileId']
11+
12+
data = {
13+
'messages': [
14+
{
15+
'to': '01000000001',
16+
'from': '029302266', # 반드시 RCSBizCenter에 등록된 발신번호 입력
17+
'subject': 'MMS 제목',
18+
'text': 'RCS MMS를 발송합니다.',
19+
'imageId': fileId,
20+
'rcsOptions': {
21+
'brandId': 'BR.iIr12HZe3j', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
22+
}
23+
},
24+
# 버튼이 포함된 RCS MMS를 발송합니다. 버튼은 최대 2개까지 추가 가능합니다.
25+
{
26+
'to': [ '01000000002', '01000000003' ], # 신번호를 array로 입력하면 같은 내용을 여러명에게 보낼 수 있습니다.
27+
'from': '029302266',
28+
'subject': 'MMS 제목',
29+
'text': '버튼이 포함된 RCS MMS를 발송합니다. 버튼은 최대 2개까지 추가 가능합니다.',
30+
'imageId': fileId,
31+
'rcsOptions': {
32+
'brandId': 'BR.iIr12HZe3j', # RCSBizCenter(https://www.rcsbizcenter.com/)에서 발급받은 브랜드ID 입력
33+
'buttons': [
34+
{ 'buttonType': 'WL', 'buttonName': '홈페이지 바로가기', 'link': 'https://nurigo.net' }
35+
, { 'buttonType': 'ML', 'buttonName': '지도 위치 표시', 'latitude': '37.280342669603684', 'longitude': '127.11824209721874', 'label': '누리고', 'link': 'https://nurigo.net' }
36+
# , { 'buttonType': 'MQ', 'buttonName': '지도 검색', 'link': 'https://nurigo.net', 'query': '(주)누리고' }
37+
# , { 'buttonType': 'MR', 'buttonName': '나의 현재 위치' }
38+
# , { 'buttonType': 'CA', 'buttonName': '캘린더 일정 생성', 'title': '제목', 'startTime': '2021-06-19T00:00:00.000Z', 'endTime': '2021-06-19T09:00:00.000Z', 'text': '메모' }
39+
# , { 'buttonType': 'CL', 'buttonName': '텍스트 복사', 'text': '복사할 텍스트 내용' }
40+
# , { 'buttonType': 'DL', 'buttonName': '전화 걸기', 'phone': '01012345678' }
41+
# , { 'buttonType': 'MS', 'buttonName': '메시지 보내기', 'phone': '01012345678', 'text': '보낼 메시지 내용' }
42+
]
43+
}
44+
}
45+
# ...
46+
# 1만건까지 추가 가능
47+
]
48+
}
49+
res = message.sendMany(data)
50+
print(json.dumps(res.json(), indent=2, ensure_ascii=False))

0 commit comments

Comments
 (0)