I was new to API.ai and I created a sample application for that I am using my own local web service which will be running on my local machine with the URL "http://0.0.0.0:5000/webhook" I have enabled and added the URL in the fulfilments and in the indents under the fulfilment tab I checked the use webhook but while I was trying to run the project the post action does not take place.
and the web service does not trigger from my sample API ai application and in the JSON I get the status as
"status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: Webhook response was empty."
},
What should i need to do?
Kindly assist me regarding this issue
You can't fill in your localhost, API.ai has no idea how to reach that from their side. It's only accessible on your own machine.
You would need something like ngrok. ngrok will expose your localhost to the internet making it accessible from outside sources like API.ai for example.
Simple download the ngrok zip file and open up the terminal/command line. Depending on your OS you could run ngrok with:
ngrok http 5000
After that simply copy/paste the https url that ngrok exposes for you and put it as url in the fulfillment page on API.ai.
Related
I am running a ruby Sinatra server on my development machine with ngrok.
I have verified that the accessing the publicly exposed url through ngrok does get routed to the ruby server and the correct response is returned.
I also used apitester.com to verify that the exposed url is accessible from the internet and the correct response is returned.
When I attempt to execute using the Alexa Simulator through the alexa developer console I only get "I am unable to reach the requested skill". I get the same response using a physical echo also.
I have double checked the endpoint configuration of the developer console and everything looks like ok to me.
I am using https for the endpoint with the "My development endpoint is a sub-domain of a domain that has a wildcard certificate" as the SSL certificate type.
Using the JSON request that is generated when attempting to use the Alexa Simultor does successfully send the request to my Sinatra server and the appropriate response is returned. This eliminated my concern that this was related to the sinatra/ngrok configuration, but it continues to fail when entering text (or speaking) into the simulator.
This is my first attempt at creating an Alexa skill, so I may be overlooking something obvious.
Does anyone have any suggestions?
Solved
I had set the default and North America endpoint urls containing the same URL.
Removing the optional North America endpoint url solved the problem for me.
i have read that in in able to test IPN in localhost magento site ,i can use Advance Rest API in google chrome ,now i downloaded already the app and test some values, but it showed The response was Empty..
how to test it correctly? am i doing the right thing there in the picture above? thank you,
You cannot test IPN on your localhost, as IPN is all about PayPal's server initiating a server-side POST to a URL you define.
As a result, your IPN script must be accessible by the outside world (or you can use a tunnel such as ngrok.me/localtunnel.me)
You can test on localhost using ngrok :- https://ngrok.com/
Simply run ngrok locally then paste test url that ngrok gives you (something like http://1bc7d09d.ngrok.com/)
It provides a tunnel to your localhost.
More information visit this URL :-Paypal Sandbox Test Tool IPN Simulator in Localhost
I have deployed a custom UI5 app ( using external REST ful services--> service hosted in another Java stack system) in the front end server.
I used Ajax to call the service directly with the URL as shown below.
This app has run successfully when i use "proxy" in local host(eclipse).
-->Ajax Call code Snippet
So i replaced proxy with target url while deploying in front end. (http ://xxx.xxx:port)
When running from front end server i got cross origin error as shown below.
Error1:<http://xxx:port/xxx/ngservices/rest/query/ZQUE_WEBSERV_APPHISTORY/executeGet. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx:port' is therefore not allowed access. The response had HTTP status code 401>
After enabling CORS plugin in chrome i got unauthorised error as shown below.
Error2:<http://xxx:port/xxx/ngservices/rest/query/ZQUE_WEBSERV_APPHISTORY/executeGet. Response for preflight has invalid HTTP status code 401>
I got the above errors initally while running from localhost.After that i used proxy and it got solved.
I just deployed the app in frontend server and ran it directly. I haven't done any other configurations.
Do i need to do any extra configurations for consuming these external services or kindly suggest any other suggestions.
Important info:
*Able to call external service from localhost(eclipse--> used proxy here) but not able to call service from frontend server.
*Front end architecture: Central hub deployement and connected to SRM,HR and CRM backends currently.
Regards
Phani Poorna
Both of these errors can be solved by creating and configuring a destination on your platform.
A destination is essentially a proxy: when you create it, you specify the backend URL, the authentication mechanism (Principal propagation/basic authentication etc). From your client, you just need to then connect to your destination to query the backend.
What do you mean by Fiori front end server? Are you referring to the Portal service hosted on HANA Cloud Platform?
If so, then you can create a destination by going to Connectivity - Destinations from your HCP account. From your Fiori application, you then need to connect your destination using the following URL pattern:
/destinations/<destination name>/<whatever you want to add to the URL the destination points to>
If you are using a different PaaS, I'm sure it will have some similar way of creating a proxy between your client and your backend. (Edit: I just saw you're using the Central hub deployment - I am not familiar with this system but it must have a very similar way of creating destinations).
Hope this helps, let me know if you have any questions.
I'm starting with Messenger Platform API. I want to make simple Messenger Chatbot. Here is tutorial I follow.
As you see, to start I need to set up webhook (step 2). So basically: web server that provides some REST API and posts some data back. The problem is: facebook requires me to provide some real, existing app URL that works currently in internet. So, do I need to upload my code to server each time I change something? Can I somehow test it locally (on my localhost)? How can I test behavior of my bot?
There's a few services you can use to expose your webserver running on localhost to the public. Two options are localtunnel and ngrok.
An example (from localtunnel's quickstart) of how you might do this, given that your webserver is running at http://localhost:8000/ would look like this:
Install localtunnel from npm:
npm install -g localtunnel
Request a tunnel to your local server:
lt --port 8000
This will generate a link, of the form https://foo.localtunnel.me you can use to access your localhost from the web. One nice feature is that you automatically get https so Facebook won't give you a 'SSL certificate problem' error. Localtunnel or ngrok are also nice for sharing work running locally with others.
Note that the localtunnel url is only valid as long as the connection lives, so you will have to update the url Facebook has if the connection ends.
I created a library that tries to solve this exact problem! With fb-local-chat-bot you can easily test your bot offline. The library also makes testing much more simple. If you're interested, definitely check it out
https://github.com/spchuang/fb-local-chat-bot
Demo:
you may use ngrok to test the messenger bot in localhost. You may download it at:
https://ngrok.com/download
on executing ngrok, it will generate secure link that can be used as a end point in webhook.
You can also check the detailed status of each request and response of ngrok through
http://localhost:4040/inspect/http
Later, once you are done, you may deploy your code to secure server.
You can find more info as to how to build a basic chat bot on the link below:
How to build a basic chat bot on facebook messenger
You can deploy your backend services on heroku free of cost. It provide public DNS with RSA.
If you can't use ngrok for some reason (like routing webhook to multiples dev machines). please try this emulator i have created for developing / debugging webhooks locally. this provides emulation of send api and a messenger ui
I have created an emulator for send api and messenger which i use for debugging web hooks locally
https://github.com/SonOfSardaar/facebook-send-api-emulator
I also came across this (i have not tried this one yet but looks good)
https://learn.microsoft.com/en-us/bot-framework/debug-bots-emulator
Using Ionic serve -- My Ionic app returns data from my REST call to my webapi running on localhost.
But when I issue Ionic run , my REST API call fails. The error.data is blank, so I can't tell what the error is.
I am also able to hit the api of the rest call directly in my browser and see that it returns the data.
Would anybody please give me some pointers as to how to debug this, or why my http calls are failing in run mode?
ionic serve run on browser and ionic run with devices[ios or android]
change localhost to ip address(in your system)
ex- 198.1.1.0:4000(eg.4000 is port number of local server)
and type(CLI)
ionic serve --address 198.1.1.0
check on Mobile browser type 198.1.1.0:4000
Note
If you are using a live server for your REST application,you will run into CORS issues.
I would suggest, you use Ionic's proxy server to do all your request. You will not run in any OPTION request or null request response etc etc.
Check This Official Blog and,
This will also be very helpful Ionic Proxy Example
localhost server is only accessible from your local environment (laptop). Assuming you are running on an actual device, it cannot access that web api in a normal way.
You can use following steps:
Open hotspot from your device
Connect your laptop to the network
Open terminal and type in ipconfig
Call your REST with the specified IP address.
You can find detailed reference here.
How can I access my localhost from my Android device?
I found the solution to my problem in this blogpost. It explained the network host configuration used by GenyMotion emulator : http://bbowden.tumblr.com/post/58650831283/accessing-a-localhost-server-from-the-genymotion
Using this I was able to get the ip address that I should use when invoking my service, that was hosted on my local IIS server.