본문 바로가기
카카오 REST API & SDK/카카오톡 채널

node.js 예제 - [카카오톡 채널] 카카오톡 채널 관계 확인하기

by kakao-TAM 2021. 8. 31.

'content-Type': 'application/x-www-form-urlencoded;charset=utf-8' 의 GET방식 String Array Parameter 예시

app.get('/v1/api/talk/channels', (req, res) => {
    axios
        .get("https://kapi.kakao.com/v1/api/talk/channels",
            {
                params: {
                    "target_id": '111111111',
                    "target_id_type": 'user_id',
                    "channel_public_ids": ['_tttttttt','_xxxxxxxx']
                },
                headers: {
                    'content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
                    'Authorization': 'KakaoAK 어드민키'
                }
            }
        )
        .then((res) => {
            console.log("success");
            console.log(res);
        })
        .catch((err) => {
            console.log("err");
            console.log(err.response.headers);
            console.log(err.response);
        })
    res.send(res.statusText)
})

댓글