Upon using the API POST it only returns error 400 even though all field is correct. Please help check. Thank you.
async function registerEventSubListeners() {
const response = await fetch('https://api.twitch.tv/helix/eventsub/subscriptions', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + OAUTH_TOKEN,
"Client-Id": CLIENT_ID
},
body: JSON.stringify({
"type": "user:read:chat",
"version": "1",
"condition": {
"broadcaster_user_id": CHAT_CHANNEL_USER_ID,
"user_id": CHAT_CHANNEL_USER_ID
},
"transport": {
"method": "websocket",
"session_id": websocketSessionID
}
})
})