And also the error statement on the api url is like below.
{“message”:“Invalid value: “Api-Token. Api-Token is missing.”.”,“code”:400401,“error”:true}
I thought sendbird js connection with “user_id” and “session_token” is the only thing that requires for connection not “api_token”. How can I fix this problem?
Actually the value above are just an examples and I wrote the real values. And cannot expose it so i just replace to some random strings for security issue.
Is there any other reason that can yield this problem?
What I see is that you need to be connected before accessing your channels. Please try this:
sb.connect("ahn_test", "session_token_test", function (user, error) {
console.log(user);
console.log(error);
if (!error) {
// Once we are connected and no error is present...
sb.GroupChannel.getChannel("make-sure-this-channel-exists-just-in-case", function (groupChannel, error) {
if (error) {
return;
}
console.log(groupChannel);
groupChannel.enter(function (response, error) {
if (error) {
return;
}
})
});
}
});