get JSON generated by a webhook hosted onlilne - node.js

I am making a plagariam check and then it communicates to the server of the company via webhook, the response is then recorded in RequestBin, which generates a JSON response in their website, how do I extract the information from the website to my node js code?
The webpage looks like this: my requestb.in online webhook
What I need is to get that raw JSON.

You cannot get data via API from RequestBin.
RequestBin doesn't provide API for you to catch the responses. It is built for manual testing where a person checks the data using their UI.
If you wish to check the response, register a WebHook with the company that points to your server where your app resides.

Related

Google Forms to Notion API

I am working on creating an API to send google form responses to a notion database. I want to send a response to the database each time a form submission is completed, however, the forms API only has two methods for retrieval retrieving all the responses at once or a specific response by the id.
https://developers.google.com/forms/api/guides/retrieve-forms-responses#node.js
How would I create a trigger, with either google app scripts or something else to send this data to my API endpoint.

Not Receiving SMS in Twilio

I need to fetch SMS Response sent from Twilio using web hook using Twilio trial account credentials. In that, generated number is from US. And sms is sending from India number. And when message is sent back to Twilio that is not shows in incoming messages and not call the webhook url also.
I created app in twiml. And set webhook url in that also. But doesn't work.
For web hook I am using ngrok so in my local server so I can get data.
Any one have idea what is wrong I am doing.
EDITED
I have created testing twilio account. Generated number and the generated number is from US. I have set up webhook url in manage numbers.
URL is generated from ngrok so It can be used outside my network.
I have setup Twiml App also. And webhook url is also set there.
I am sending one programmable message from my node api. And that was working fine. User is getting programmable message but when user reply to that message it should call my webhook url. But it not calling my webhook url and also it not showing in my incoming message.
Thanks for any help.
For those who are struggling with this,
As of now Twilio not supports 2-way messaging in India.
Please refer this for more details.
Twilio Guidelines for India

Sendgrid Event Webhook sends fake emails response and not real data

I have created a post api and did put that post api inside the event webhook settings of sendgrid. But when i enabled it and check the json response on my api in local, i am getting fake messages and not real data.
Anyone know whats the reason. I checked their documentation, it is not telling anything else.
Source of information : https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook/
If you are using event webhook according to above documentation in the question. You wont get the real data as for testing purpose sendgrid sends that data from your account. Instead try implementing the API. Then you will get the real response as it would contain your sendgrid api key.

Edit request in js before sending it to fullfillment endpoint

I need to edit request before sending it to endpoint.
Using Web Demo integration I'm able to send request to the endpoint.
But I can't edit the request in order to provide some extra data to request. Extra data is stored in localStorage so I need to do this in javascript.
I've already connected the agent to an endpoint that handle the request using fullfillment. The problem is that request misses data I can retrieve only from the browser. From fullfillment I can set headers and basic auth but statically and it is not enough.
So I need to add a step in request building/sending:
User write or tell something to embedded chat (Web Demo integration)
Dialogflow recognize intent, params, generate the request.
Additional step: Update the request in javascript
Forward cutomized request to the endpoint
Maybe it's not possible using Web Demo integration. In Documentation can't find a way to just send string or audio in order to receive the generated request.
First of all you will need a custom chat integration, not the default Dialogflow one. Something like Smooch or Kommunicate. The default web demo should only be used for testing your bot. There is NO way you would want to use that in a production environment.
I would save whatever is in the local storage in a database such as Firestore. Once that data is in the database you can use it to modify your request in your fulfillment.
So what I would do:
Have a way to identify a user and save its local storage to the database (as soon as someone clicks on your chat window or opens the chat window)
Once an intent is triggered you check which user is contacting you (through the way that you identified the user) and get all data from the database
Request the data in your fulfillment server
There is no other way in which this is possible. You can't change requests before your query hits Dialogflow.

Intercept fulfillment response

Im using fulfillment to get data from database. And I have integrated my bot with facebook.
And currently I'm customizing db response as per facebook in my api itself and sending it to the dialogflow.
And I want to integrate it with skype too.
Now my question is, can I customise my api response in dialogflow instead of in API. As I want to integrate my bot with multiple platforms so accordingly their response will be formatted as per facebook or skype.
So i will need to create another api for skype too. I want to avoid this.
So I want to get output from my api and format it in dialogflow itself using custom payload. So is it possible to work in this way?
Sure! You get the stored data using your API and then you format the response for the platforms you are going to use. In this example, the payload contains different responses for Google Assistant, Facebook and Slack.
Also, take a look at this NodeJS library which makes easier develop your fulfillment code.

Resources