insuffcient scopes 에러가 떠면서 사진 upload가 안되네요. 어찌 scopes등록을 하나요?
Post image to KakaoStory:
insuffcient scopes 에러가 떠면서 사진 upload가 안되네요. 어찌 scopes등록을 하나요?
Post image to KakaoStory:
story_publish 스콥이 누락되었네요.
에러의 required_scopes를 참조해 주세요.
예 그건 알고 있습니다. 아래 소스엔 그런게 없고 따로 어디서 해야 되는 것으로 보입니다.
아래 소스…(공개된 것)
Kakao.init('ef0c8c3e0ce726d89fcc889ec162e742');
Kakao.Auth.createLoginButton({
container: '#kakao-login-btn',
success: function() {
document.getElementById('file-input-wrapper').style.display = "block";
},
fail: function(err) {
alert(JSON.stringify(err))
}
});
document.getElementById('file-input').onchange = function (event) {
Kakao.Auth.getStatus(function(statusObj) {
if (statusObj.status == "not_connected") {
alert('You should log in first.');
} else {
// API를 호출합니다.
alert('Step1');
Kakao.API.request({
url: '/v1/api/story/upload/multi',
files: event.target.files
}).then(function (res) {
// 이전 API 호출이 성공한 경우 다음 API를 호출합니다.
alert('Step2');
return Kakao.API.request({
url: '/v1/api/story/post/photo',
data: {
image_url_list: res
}
});
스콥(동의항목)을 앱 설정에서 설정하고, 그에 따라 최초 로그인 시의 정보제공동의에서 받거나 동적동의를 사용하여 받아야 합니다.
동적동의는 REST API 동적동의 가이드를 참조해 주세요.
감사합니다.
Kakao.Auth.createLoginButton({
container: '#kakao-login-btn',
scope: "story_publish,story_read,talk_message",,
하면 되네요. 샘플이 문제네요.