<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
<a id="create-kakao-link-btn" href="javascript:;">
<img src="https://developers.kakao.com/assets/img/about/logos/kakaolink/kakaolink_btn_medium.png"
/>
</a>
<script type="text/javascript">
Kakao.init('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
Kakao.Link.createDefaultButton({
container: '#create-kakao-link-btn',
objectType: 'feed',
content: {
title: 'Test',
description: '#cake #strawberry #cafe #atmosphere #blinddate',
imageUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTRHSi_7ap2mHaZtTsH7M4JIZpyuMh23OSnw&usqp=CAU',
link: {
mobileWebUrl: 'https://developers.kakao.com',
webUrl: 'https://developers.kakao.com',
},
},
social: {
likeCount: 286,
commentCount: 45,
sharedCount: 845,
},
buttons: [
{
title: 'View on Web',
link: {
mobileWebUrl: 'https://www.facebook.com',
webUrl: 'https://www.facebook.com',
},
},
{
title: 'View on App',
link: {
mobileWebUrl: 'https://www.facebook.com',
webUrl: 'https://www.facebook.com',
},
},
],
})
</script>
Here is my code for a button to share using kakao. What happens is that when I click on the button I get the following message with a 4002 error - Invalid request.
Please contact the service provided to share.
Can anyone tell me why is this happening and also what is the possible solution for this problem.