I have created azure functions with "HTTP trigger" and "generic Webhooks" with Visual studio 2017.The only difference I found that both "triggers" can be triggered by HTTP request.
both functions have "HttpTrigger" as parameter.
so I am confused when should we use one over the other as both triggers allows us to run small piece of code in cloud.
How Is it different from one another ?
An HttpTriggered function can respond to any HTTP verb you configure. However, a webhook only responds to POST and expects the payload to be JSON.
Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook#responding-to-webhooks
This restricts requests to only those using HTTP POST and with the
application/json content type.
A 'Webhook' is a user defined callback that can be registered on a website in case you want to react to certain events.
For example something that is often done is responding to events in a gtihub repository, like when someone does a check-in or an issue is added. Typically you would want to trigger a build when a check-in happens. You can register a callback/webhook on github which points to a url provided by you that reacts to the HTTP POST called by github.
Azure function can be configured to be triggered by a normal HTTP request or it can be setup as a webhook i.e. it will be called whenever a specific event on some website has occurred. Functions configured as webhooks will respond only to a HTTP POST. There are already built in values to set up an Azure Function as a github or Slack webhook.
If you are not reacting to an external event or cannot register a webhook in the event source just go with the HttpTrigger and explicitly invoke your function.
As per the documentation, the webhooks only work with 1.x version of Azure functions runtime while if you are working with the newer runtime 2.x - it is recommended to use the HttpTrigger instead.
From the documentation,
In version 1.x, webhook templates provide additional validation for
webhook payloads. In version 2.x, the base HTTP trigger still works
and is the recommended approach for webhooks.
Related
We are developing a chatbot to handle internal and external processes for a local authority. We are trying to display contact information for a particular service from our api endpoint. The HTTP request is successful and delivers, in part, exactly what we want but there's still some unnecessary noise we can't exclude.
We specifically just want the text out of the response ("Response").
Logically, it was thought all we need to do is drill down into ${dialog.api_response.content.Response} but that fails the HTTP request and ${x.content} returns successful but includes Tags, response and the fields within 1.
Is there something simple we've missed using composer to access what we're after or do we need to change the way our endpoint is responding 2? Unfortunately the MS documentation for FrwrkComp is lacking to say the very least.
n.b. The response is currently set up as a (syntactically) SSML response, this is just a test case using an existing resource.
Response in the Emulator
Snippet from FwrkComp
Turns out it was the first thing I tried just syntactically correct. For the case of the code given it was as simple as:
${dialog.api_response.content[0].Response}
I am trying to get my head around web hooks. I receive a web hook from Shopify. I use https://beeceptor.com/ to receive the web hook which looks like the screenshot attached. It is a JSON. I want to use python to process the received POST and take some action. Can I know how I can retrieve this using python? Do I need to use the Flask framework or can I do with request? Here are details from Shopify https://shopify.dev/tutorials/manage-webhooks#verify-webhook
which I am unsure of.
You need to create a web app that can accept incoming HTTP traffic from Shopify - you can do this in Flask/Python or really any other web technology stack. Services like AWS Lambda can also work to receive the webhook and do some processing.
I'm trying to use the Assistant2 APIs inside my Web Application (Angular CLI project) with the ibm-watson library and the suggested Webpack Configuration.
But at runtime I get different CORS policy errors calling the Assistant2 APIs.
So it's possible to use the Assistant2 APIs via browser?? Or calls must be all made server side to avoid the CORS policy errors?
Well, Watson Assistant provides REST API that can be called from anywhere where there is access to IBM Cloud (which bacicaly means access to internet) - so from browser as well.
Now, while you can call the Watson Assistant REST API directly from the client-side browser, sometimes it might be beneficial to have a server doing the actual call as when you call the REST API from the browser then the user has access to the request and the response from the system. This means the user has access to context part of the dialog response which in some cases might not be desired (depends on the stuff that the author is storing in the context).
Is it possible for GitHub to trigger a new test deployment when a pull request is submitted? I'd like for it to create a new folder on the server (Azure preferred) so that a test URL (e.g. http://testserver.com/PR602/) is generated that we can refer to in the pull request.
This would allow anyone to test a pull request without having to clone the repo, check out the branch, and build it locally.
In my initial research I found that Travis CI can deploy all branches, but I'm not clear how this would be triggered. Do I have to write a custom app that's triggered by pull request web hooks? I'm hoping someone has discovered a simpler method.
Do I have to write a custom app that's triggered by pull request web hooks?
Yes, or find someone else who has happened to have written the exact webhook handler you need.
Writing a webhook handler isn't terribly much work. If you don't want to integrate it with your current app, you can use a micro-framework like Flask to do this in only a few lines of code.
Coming back to this in 2022, there is now also the option of Github Actions, which is a first-party CI service. Actions provides a framework for defining what things to do when certain triggers happen, and there's an extensive marketplace of drop-in components, so you may be able to do all of your triggering of other systems without writing any custom code or running a webserver to listen to webhooks.
Good day,
I'm having trouble calling DSAPI methods via SOAP ( C# Integration ). I keep getting 405 Method not allowed errors. So far I've tried calling the RequestTemplate and CreateEnvelopeFromTemplates methods, both of which fail. I was able to successfully retrieve the DSAPIServiceSoapClient object and also successfully login via the login method of the credential API. If you need more information, i'm ready to provide them. Thank you.
You're succeeding with the login, which is good.
My guess is that the other calls are not well formed. Perhaps they're missing the right base url (which you receive from the login call).
Are you switching to the different base url for your subsequent calls? (Different server name?)
I suggest that you try the API logging feature and see what it reports. It enables you to see a log of your API requests. See the Request Logging article for the classic DocuSign experience, or the new DocuSign UI.
i just needed to add the in the X-DocuSign-Authentication http header whenever i try to get a DSAPIClient object.