Is there a way to set webhook headers by code?
I'd like to send an authorization header to the fulfillment webhook but I need to set it dynamically from code (using nodejs)
At the moment my headers are empty.
Currently, you could pass a header via webhookHeaders of the QueryParameters object. It's available from v2beta1 version. Check it out https://cloud.google.com/dialogflow/docs/reference/rest/v2beta1/QueryParameters
Related
I'm trying to create a customer in Stripe using Excel VBA and the Stripe API. I'm able to do this successfully, however I've hit a snag.
When I send the following URL to the API, I am successfully creating a customer with the following parameters (auto_advance, collection_method, customer) set.
b_url + "/v1/invoices?auto_advance=false;collection_method=charge_automatically;customer=" + customerid
However, I am struggling on the syntax required in my URL when attempting to send values to a parameter with child attributes. Stripe customer object has a parameter called "custom_fields" that I would like to populate. The param requires a custom_fields.name and custom_fields.value.
How do I send parameters with a "dot"?
So it turns out the URL needs to be formatted as an array value to pass these. So sending
;custom_fields[0][name]=Provider;custom_fields[0][value]=TestName
worked great.
I'm trying to enable some kind of "voice unlinking" (which should remove the access token from the google assistant) for my google action. I'm using the webhook fulfillment via Dialogflow and I'd like to send a response text like "Okay, your account linking got removed."
To do so, I'm currently trying to send a response using the status code 401, but it seems that my response body gets either ignored by the assistant or filtered along the way.
So my question is:
Is there a way to add any body information to a response with status code 401 or are there other ways to achieve the removing of access tokens via response?
I am new to Jmeter please help me in this, i try to do performance test of my nodejs application.And i have one api, for this i have to pass parameters as well as post from .csv file but i am not able to achieve so give your valuable input
Put your parameters to "Path" input field
Put your request body to "Body Data" input field
You might also need to add a HTTP Header Manager and configure it to send Content-Type header with the value of application/json. See REST API Testing - How to Do it Right for more details.
I am using actions-on-google ApiAiAssistant node.js library with API.ai for designing my chatbot.
I have created a German API.ai Agent specifically for it. So, I need to get the locale value from the request to webhook to know which locale the request is coming from.
I have seen a method something like ApiAiAssistant.getLocale to get the locale information from the request but I am not able to find the specific one from the documentation.
Is the method deprecated? And how can I get the locale information from API.ai webhook request?
You're probably looking for the getUserLocale() method. https://developers.google.com/actions/reference/nodejs/AssistantApp#getUserLocale
For example:
const app = new ApiAiApp({request, response});
const locale = app.getUserLocale();
It returns the language/locale combination (such as "en-AU").
If you're just using the JSON object and not the API, you can find the value at originalRequest.data.user.locale. This is the same value returned by the method.
If you just want a non-standard language field that is returned by API.AI, you can use the lang field. This isn't available through the API, just by reading the JSON directly, and only contains language information - not locale information. On the other hand, lang is available if you're using it for multiple platforms, not just Actions on Google. (But if you're using it for other platforms - you probably don't want to be using the actions-on-google node.js library.)
I can not for the life of me find any documentation regarding the possible properties of varnish (version 3) objects.
We know (from googling, varnish documentation just mumbles and leaves you more frustrated) for example that the request object has the url property (req.url) and also that it has req.http.X-Forwarded-For. But has anyone ever in any way found... say... a list?
Thanks!
/joakim
You can't really give a comprehensive list of things like req.http.X-Forwarded-For because req.http.* are HTTP headers. The Cookie header of a request will be req.http.Cookie and the User-Agent header will be req.http.User-Agent. There are a lot of standard headers, but you can set any arbitrary header and it will show up in req.http.___________. You can see the headers of the HTTP response in resp.http.*. Same for backend response in beresp.http.*.
All of the other properties are listed here: https://www.varnish-cache.org/docs/3.0/reference/vcl.html#variables