I have downloaded program-ab-0.0.4.3, so that I can make use of AIML 2.0 features.
I want to make a API call based on users input. Any guidance on how do i do it ?
I read about oob tags and sraix, there are some oob tag examples in aiml folder in program-ab-0.0.4.3, but when i run it to understand how it works, it just outputs the tag as a result
Ex: Human: what is the weather like?
Sraix ‘WHAT+IS+THE+WEATHER+LIKE’ failed
Robot: I used my lifeline to ask another robot, but he didn’t know.
Perhaps we should try a web search.
<oob><search>what is the weather like</search></oob>
Please help me to know how do i call any API based on user input and give customized output to user based on API response
Thanks
Your api call should look something like this. Change service to XML if you are using an XML to pass data.
For more details refer here https://www.botlibre.com/forum-post?id=13020078
<category>
<pattern>*</pattern>
<that>What is your postal code</that>
<template>You live in <sraix service="JSON" hint="code/name">URL_GOES_HERE</sraix>.</template>
</category>
Related
I am supporting an app that gets player game statistics. We have for example playstation or xbox nickname and need to find bungie membershipId.
I look code - we missuse "Destiny2/SearchDestinyPlayer" API, as it requires not playstation nickname (or xbox nickname) but full bungie name including #xxxx (# id)
https://bungie-net.github.io/#Destiny2.SearchDestinyPlayer
Looks like before in Destiny2 appeared cross-save function it was the same nickname and #id was not mandatory.
Could someone suggest another API that accepts platform (xbox or playstation) nickname?
Also maybe suggest forum dedicated to bungie API?
PS: I searched alternative sites, for example on "https://destinytracker.com/" I am able to select platform "Playstation" and enter nickname "T-rex_on_point" - it finds bungie name Brontosaurus881#6169 and also membershipId inside URL. How it does it? What API it uses?
I finally need "membershipId" id, but if I will find full bungie display name - then I am able to find "membershipId" with Destiny2/SearchDestinyPlayer" API mentioned above
There is no "Other API". All applications uses one API which's Bungie's.
I'm assuming you're making the request using # in the URL which's not UTF-8 URL encoded.
You'll need to encode the URL specifically the # which will be encoded to %23. So instead of making the request with this name Brontosaurus881#6169 it should be like this Brontosaurus881%236169.
Also what language are you using? if Python then use urllib.parse.quote("Brontosaurus881#6169").
If not then i suggest you looking up how to encode a URL in x language.
Also if you're using Python, There's a wrapper around the API that already does that for you if you're interested and using Python.
I have been using Infusionsoft form embedded in html page but now I want to send data to Infusionsoft form using their API. I checked their APIs but could not figure out which one should be used to submit data to the Infusionsoft form. Can someone please help me with this?
https://developer.infusionsoft.com/docs/xml-rpc/
Thanks for looking into this.
Thank you, Naresh
Try to use REST API instead of XML RPC. Developer center already marked XML RPC to "legacy" module, and I guess they will replace "XML RPC" sooner or later.
Regarding to your question, you will need to define what data set you want to update.
For example, if your form is going to insert a new contact, you will need 2 things from your code.
First, prepare the parameters such like "email_addresses", "phone_numbers" and "given_name".
Second, POST request with parameters to this URL "https://api.infusionsoft.com/crm/rest/v1/contact?access_token=123abc" after authentication.
Ways to test:
Try REST API calls on page https://developer.infusionsoft.com/docs/rest/
Good luck.
To pull Webformvia API you will have to use following method, this will pull the HTML form:
Retrieve a Form's HTML
to submit a data to Infusionsoft via API
You will have to use Create contact and update contact API:
Create Contact
Update COntact
XML RPC is still in use but Infusionsoft suggests to use REST API methods
Create a Contact
Update a Contact
Single API call for two methods: Create or Update a Contact
I want to integrate my web application with IBM's dialog api. Basically, I want to sometimes send the pure text result from the IBM dialog API, as I set it up in the XML, and other times, such as when the user wants a dynamic response, which might involve me querying a database to find an account balance, for example. My current thought is to include some sort of syntax in my dialog XML which I can parse to know if the response from the conversation requires me to change it. I was thinking of something like:
<input>
<grammar>
<item>What is my account balance?</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>{ACTION_GETBALANCE}</item>
</prompt>
</output>
</input>
So if I got a response like {ACTION_***} I would take my own action. Is this an appropriate way of doing this? Is there another way which might be better?
This is indeed the recommended method
see for example line 1358 on the movie application demo dialog file provided on WDC git repo
<prompt selectionType="RANDOM">
<item>"{Search_Now:"{Search_Now}", Recency:"{Recency_Preference}", Rating:"{Certification_Preference}", Genre:"{Genre_Preference}", Index:"{Current_Index}", Page:"{Page}"}"</item>
</prompt>
I can't seem to find the section in their api reference. I tried it as a searchquery but it doesn't seem to work. api.soundcloud.com/stream or /explore return a 404, so that doesn't work either
Thats actually not a part of the public API.
But its quite easy to grab your call from the dev console.
Thats an example call from my user:
https://api-v2.soundcloud.com/stream?user_id=e87647259112403eaa239b6e2c510e46&sc_a_id=e87647259112403eaa239b6e2c510e46&user_urn=soundcloud%3Ausers%3A1672444&promoted_playlist=true&limit=10&offset=0&linked_partitioning=1&client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea&app_version=a089efd
To make that call work, you need to modify the headers.
These answers may help you:
Retrieving the "recommended" playlist via API call?
soundcloud: Is api-v2 allowed to be used and is there documentation on it?
How to get "all" tracks related to an artist with Souncloud API
Using these endpoints does not go inline with SoundClouds TOS.
How can code be resource?
I will give you an example: I want to create a hotel web site. But also i want to show my customers, which come from abroad, at which time they can come to my city. So i deal with an airplane web site. This site will give me his resources using REST. (resources mean representation of resources). For example his URI will be like that http://example.com/plane/flight%5Fnumber http://example.com/plane/flight%5Fnumber/date
My users will give me a date and i will say them at which flight number they can come. I'll give him a list of flight number then he can fly. OK. there is something i haven't solve yet. if i would know the plane number, i found date. But i dont know which flight number can he travel. So i need to search all the plane and all the flight number to find the same date. But how can i do it? How can i write my query?
another question is I have a function. That function gives me the flight number if i give the date [ int get_Flight_Number(12/11/2009) ].
I just want that clients can see parameters and name of function. And I want him to use my function. How this will be happen?
Without the details of the media types returned by the service it is difficult to answer your question. Does the site return a search form? Does the site return a collection of flights for a set of dates?
The general flow of any http based RESTful client inquiry should go something like this:
Do a HTTP GET on the root url of the
API.
Parse the response based on the
media type specified in the http header "Content-Type".
Does the response contain the answer
to my question?
If yes then extract the information
and do what you want with it.
If no, then does the response
contain a link to another resource
that may have the answer to my
question.
If yes then do a HTTP GET or POST on
that link based on what the media
type definition tells you to do. Goto step 3.
If no then stop looking and tell the
user you cannot find an answer.