Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Format of Callback subscriptions #701

Open
sgarg7 opened this issue Dec 5, 2017 · 3 comments
Open

Format of Callback subscriptions #701

sgarg7 opened this issue Dec 5, 2017 · 3 comments

Comments

@sgarg7
Copy link

sgarg7 commented Dec 5, 2017

Hi,

I've been trying to get Http callbacks to work with notifications. When I use a URL (eg http://requestbin.company.com) in the "subscriptions" field", I see the following error in the logs - notification send response: HTTP/1.1 500 illegal subscription format: Unrecognized token 'requestbin': was expecting ('true', 'false' or 'null')
When I try JSON matching the Request class in CallbackService.java, it gets read as two subscriptions split by the comma in the JSON. Is there a correct format that will work for the subscriptions field for callback?

Thank you

@amitkumar912
Copy link

I too am running into an error posting Alert data. Is there a specific input required here?
TIA.

@bsura
Copy link
Contributor

bsura commented Dec 15, 2017

This is the templating engine used:
https://github.com/antlr/stringtemplate4

Here's the PR for this feature. There's some info in there as well:
#358

Let us know if it works out. We have not enabled this feature in our production environment and would like to get some feedback on it.

@sgarg7
Copy link
Author

sgarg7 commented Jan 23, 2018

I started with the following in the "Subscriptions" field, following the format specified in the PR
{"uri": "http://requestbin.commpany.com/abcdefg", "method": "POST", "header": {}, "body": "Hello world", "template": null }

But upon saving and refresh, it changed to :
"body": "Hello world", "template": null }, "method": "POST", "header": {}, {"uri": "http://requestbin.commpany.com/abcdefg"

The JSON is being split based on the commas. So it looks like the subscription field is not the right place for the callback JSON. I added it to the "Custom Text" field of a notification. Will report back what I find.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants