Subscribing to a message event is giving me a hard time. I have set up webhook notifications for my account before but a previous integration was failing so I had to remove my old subscription and create a new one to test with locally. Now when I go to subscribe to the webhook using the extensions credentials to sign in, the process responds back with an error message "403 - Forbidden" "Not allowed to subscribe for events of other account". I don't know how this could be though since I am signing in as myself to subscribe to an event.
platform.login({
"username": 1234567890,
"password": "nOTmyPaSsword",
"extension": 999
})
platform.on(platform.events.loginSuccess, async ()=>{
var body = {
eventFilters: [
"/restapi/v1.0/account/1234567890/extension/999/message-store/instant?type=SMS"
],
expiresIn: 315360000,
"deliveryMode": {
"transportType": "WebHook",
"address": "https://bigtest.ngrok-free.app/ring-central",
"verificationToken": "verificationTOKEN"
}
}
var respose = await platform.post("/restapi/v1.0/subscription", body);
var json = await respose.json();
console.log(json);
})
If it really helps I can expose the extension and number (just not the password obviously) but this is what I have been using to try and subscribe to an event. I am logging in with the extension and then if I log in successfully, subscribe. I am able to log-in successfully as I am logging successes back to the console, but as I said earlier, the API returns a 404 Forbidden Response. Is there something that I am inherently missing?