So … I was giving it some more thought. I think instead of chasing every API from here to eternity … and there will be many more. You will constantly be programming APIs. That is probably not the best solution.
I think what you should do is just create a Universal WEBHOOK Feature … that let’s the user create as many Webhooks / API types as they want while making your job easier with less work. It would be very similar to the structure I detailed earlier … and Of course, allow us to pass and extract Macro values to and from the webhooks.
Allow User to create unlimited webhooks and for each one
ASK USER FOR:
Webhook Name
Server Endpoint
Method (GET or POST)
Workflow (TextArea for All Request Parameters, allow for Macro Variables)
Payload Type (type of response expected … is it text, json, xml, image, video?)
Payload Parser (TextArea that allows macro variables to be set from extracted data and returned to task)
Timeout (s).
You can even do templates for popular webhooks, like ComfyUI, or heck … anything … (think Zapier/Make.com - no limits!).
This way you are not chasing the horizon with every new API that comes out that users will want.
… or do you have a similar feature already? I looked, but couldn’t find a webhook system.
I asked Perplexity about creating a universal webhook system and this was the response:
Designing a universal webhook system that allows users to construct JSON/request parameters themselves and extract the needed data is indeed feasible. Such a system can provide flexibility and scalability, accommodating various APIs without hard-coding specific API calls. Below are some examples and considerations for implementing such a system.
Examples of Universal Webhook Solutions
Symphony’s Universal Webhook
Symphony’s Universal Webhook allows external apps and cloud services to share content within Symphony chats. Users can configure webhooks using the Symphony extension app, which supports various formats like xml, x-www-form-urlencoded, and form-data. This system forwards received messages in a standardized format (MessageML) to the Symphony platform, making it versatile for different services like Zapier, IFTTT, Jira, etc…
Docs:
Github:
Rapid7’s Universal Webhook Data Exporter
Rapid7’s Universal Webhook Data Exporter enables integration with third-party or custom software by sending HTTP POST messages to a configured URL when events trigger on the Rapid7 Platform. It includes request headers and body specifications, allowing for event-specific data to be sent and processed, which can be useful for security and IT operations.
DOCS: Universal Webhook | InsightIDR Documentation
InsightIDR Universal Webhook
InsightIDR’s Universal Webhook allows for the integration of Rapid7 Platform products with third-party software. It sends HTTP POST requests with specific headers and JSON bodies, making it adaptable for various event types and ensuring secure and verified communications.
Design Considerations for a Universal Webhook System
Storing Event Payloads
Storing event payloads can be beneficial for replaying or retransmitting them to other services. This approach saves from re-implementing webhook receipt code and provides context for debugging and auditing. However, it requires careful consideration of storage and potential high traffic.
Processing Webhook Receipts
Using background jobs (e.g., Sidekiq) to process webhook receipts can improve performance by quickly acknowledging receipt (HTTP 200 status) and processing the payload asynchronously. This method helps manage load and ensures timely processing of webhook events.
Flexible Configuration
Allowing users to configure the JSON/request parameters themselves can be achieved by providing a user-friendly interface to define the structure and content of the requests. This flexibility can be enhanced by supporting various content types and ensuring robust validation and error handling
For generating images, a simplified webhooks would work.
So under api logins, AI there is a box for Image AI
Then inside I could give you
Target url
JSON post data
A macro to %keyword%
%keyword% would be from the image prompt.
Right now we have an ai image prompt
However it only goes to openai or scm default ai.
I need to add stablediffusion / custom webhook to it.
Right now all AI image infrastructure isn’t built out like the text AI section is.
However I do plan to add AI image section with stable diffusion, open ai and comfyui (if I can figure out how to make it zero config)
Ideally, you just add [img-src-base64:%keyword%] to your article prompt, and it goes to whatever service you picked as default for ai image, which can mean a webhook to comfui, and the %keyword% part is given to you to fill out the JSON post parameter.
If you follow where I’m going with the Universal Webhook idea … you will only need the WebhookAPI NameID and the prompt. The WebhookAPI record has all the info related to it, including MIME type, so you would already know that it is an image that you are expecting.
[Webhook API NameID: prompt ]
If you want or need to specify image for your internal programming purposes, then you can put the type before it:
[text|Webhook API NameID: prompt ]
or
[img-src-base64|Webhook API NameID: prompt ]
but the user would have already indicated the Mime-type in the Webhook/API record, so indicating it here might seem repetitive and unnecessary. However, it still might be a good idea to specify [img-src-base64|APIname…] considering an image-src base64 could theoretically be returned inside of a JSON string … no? This way they can specify the MIME type here in case it is different than what the payload MIME type is. This should be as flexible as possible.
Just make sure the Webhook system has can read/write to all the User’s %macro variables%. Problem solved.
PS: A Universal Webhook idea, makes SCM extremely flexible and allows it to work not just with AI, but just about any data source on the web. And it eliminates the need for you having to program for every future API on the planet. The more I think about it, the more sense it’s making to include a Universal Webhook API feature.
I called it Webhook/API module … but really needs to as flexible as possible, so it can be used for just about any data source. Most API calls today are JSON or XLM-based … SCM user would be asked for Method (GET,POST, etc) and the payload (response) would need to parsed so SCM can return %macro-variables% back to whatever module called it.
Tim, I don’t know how you can ideally parse the payload … to make it easy for SCM users to set returned values into %macro-variables%, but I figure that you probably have more experience with that since you created the various scrapers in this tool.
If SCM users can easily Webhook/API into data sources and other automation engines, like Zapier, Make.com, ActivePieces, etc … it boggles the mind just how many use cases SCM will have.
Exactly, I’ve requested webhook feature in the past, but with HTTP/API tool, it will 10x SCM integration muscle , both internal (agentic chat)/external (automation workflow) request.
Will support only JSON calls, ie whatever in the body will always be parsed as JSON object. If you paste in a non valid json string, it will cause the call to fail.
The result box gives you access to the result via a javascript function call. That way you can do some basic manipulation on the data, or just correctly select the part of the JSON result data you want to use. This requires some javascript knowledge.
Picture is an example of how it couldwork to access groq
I’m not sure if everything having to be JSON is a limitation or not since AI models allow json calls.
I’m doing some testing to see how easy it is to call external apis with this setup