Skip to content

Commit 1f8604e

Browse files
[Chore] update inquiry examples
1 parent ddd1d6e commit 1f8604e

3 files changed

Lines changed: 52 additions & 66 deletions

File tree

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,49 @@
11
/**
22
* 메시지 조회 예제(문자, 알림톡 등)
33
*/
4-
const { SolapiMessageService } = require("solapi");
5-
const messageService = new SolapiMessageService("ENTER_YOUR_API_KEY", "ENTER_YOUR_API_SECRET");
6-
7-
messageService.getMessages({
8-
// 불러올 메시지 갯수 제한
9-
// limit: 5, // 5를 입력하면 5건이 조회됩니다, 미 입력시 20개로 지정
10-
11-
// 메시지 ID로 검색
12-
// messageId: '메시지 ID 입력', // 메시지 ID는 대개 M4V로 시작합니다
13-
14-
// 여러 메시지 ID로 검색
15-
/*messageIds: [
4+
const {SolapiMessageService} = require('solapi');
5+
const messageService = new SolapiMessageService(
6+
'ENTER_YOUR_API_KEY',
7+
'ENTER_YOUR_API_SECRET',
8+
);
9+
10+
messageService
11+
.getMessages({
12+
// 불러올 메시지 갯수 제한
13+
// limit: 5, // 5를 입력하면 5건이 조회됩니다, 미 입력시 20개로 지정
14+
// 메시지 ID로 검색
15+
// messageId: '메시지 ID 입력', // 메시지 ID는 대개 M4V로 시작합니다
16+
// 여러 메시지 ID로 검색
17+
/*messageIds: [
1618
'메시지 ID 입력' // 메시지 ID는 대개 M4V로 시작합니다
1719
],*/
18-
19-
// 그룹 ID로 검색
20-
// groupId: '그룹 ID 입력', // 그룹 ID는 대개 G4V로 시작합니다
21-
22-
// 발신번호로 검색
23-
// from: '01012345678',
24-
25-
// 수신번호로 검색
26-
// to: '01012345678',
27-
28-
/**
29-
* 메시지 타입으로 검색
30-
* SMS: 단문 문자, LMS: 장문 문자, MMS: 사진 문자, ATA: 알림톡, CTA: 친구톡, CTI: 이미지(1장) 친구톡
31-
*/
32-
// type: "SMS",
33-
34-
// 날짜로 검색하는 경우
35-
/*duration: {
36-
dateType: 'CREATED', 메시지 생성 일 기준, UPDATED로 변경하면 메시지 상태 갱신일자 기준으로 조회 함
37-
startDate: '2022-03-01 00:00:00', // Date 객체로도 요청 가능
38-
endDate: '2022-03-31 23:59:59' // Date 객체로도 요청 가능
39-
}*/
40-
}).then(res => console.log(res));
20+
// 그룹 ID로 검색
21+
// groupId: '그룹 ID 입력', // 그룹 ID는 대개 G4V로 시작합니다
22+
// 발신번호로 검색
23+
// from: '01012345678',
24+
// 수신번호로 검색
25+
// to: '01012345678',
26+
/**
27+
* 메시지 타입으로 검색
28+
* SMS: 단문 문자, LMS: 장문 문자, MMS: 사진 문자, ATA: 알림톡, CTA: 친구톡, CTI: 이미지(1장) 친구톡
29+
*/
30+
// type: "SMS",
31+
// 날짜로 검색하는 경우
32+
// startDate: '2022-12-01 00:00:00', // Date 객체로도 요청 가능
33+
// endDate: '2022-12-31 23:59:59', // Date 객체로도 요청 가능
34+
})
35+
.then(res => console.log(res));
4136

4237
/**
4338
* 페이징 예제
4439
* */
4540
messageService.getMessages().then(res => {
46-
47-
messageService.getMessages({
48-
// startKey 부분에 nextKey를 입력할 경우 초기 20건 다음의 데이터를 표시하게 됩니다.
49-
startKey: res.nextKey
50-
}).then(res2 => {
51-
console.log(res2);
52-
});
53-
41+
messageService
42+
.getMessages({
43+
// startKey 부분에 nextKey를 입력할 경우 초기 20건 다음의 데이터를 표시하게 됩니다.
44+
startKey: res.nextKey,
45+
})
46+
.then(res2 => {
47+
console.log(res2);
48+
});
5449
});
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
/**
22
* 통계 조회 예제
33
*/
4-
const { SolapiMessageService } = require("solapi");
5-
const messageService = new SolapiMessageService("ENTER_YOUR_API_KEY", "ENTER_YOUR_API_SECRET");
4+
const {SolapiMessageService} = require('solapi');
5+
const messageService = new SolapiMessageService(
6+
'ENTER_YOUR_API_KEY',
7+
'ENTER_YOUR_API_SECRET',
8+
);
69

7-
messageService.getStatistics({
8-
// 날짜로 검색하는 경우
9-
/*duration: {
10-
startDate: '2022-03-01 00:00:00', // Date 객체로도 요청 가능
11-
endDate: '2022-03-31 23:59:59' // Date 객체로도 요청 가능
12-
}*/
13-
}).then(res => console.log(res));
10+
messageService
11+
.getStatistics({
12+
// 날짜로 검색하는 경우
13+
// startDate: '2022-12-01 00:00:00', // Date 객체로도 요청 가능
14+
// endDate: '2022-12-31 23:59:59' // Date 객체로도 요청 가능
15+
})
16+
.then(res => console.log(res));

examples/javascript/common/src/kakao/channel/get_channels.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,8 @@ messageService
2121
'조회할 페이지네이션 키 입력, 보통 채널 조회 시 응답받는 nextKey 항목으로 넣어보실 수 있습니다.',
2222

2323
// 생성일자로 검색
24-
dateCreated: {
25-
// 검색 조건 설명은 링크를 참조해주세요!
26-
// https://docs.solapi.com/documents/references/#operator
27-
gte: '2022-09-01',
28-
lte: '2022-09-30',
29-
},
30-
31-
// 수정일자로 검색
32-
dateUpdated: {
33-
// 검색 조건 설명은 링크를 참조해주세요!
34-
// https://docs.solapi.com/documents/references/#operator
35-
gte: '2022-09-01',
36-
lte: '2022-09-30',
37-
},
24+
startDate: '2022-12-01',
25+
endDate: '2022-12-09',
3826
},
3927
)
4028
.then(res => console.log(res));

0 commit comments

Comments
 (0)