How do I get Wit.ai to do math calculations on roles? - wit.ai

I am new to Wit.ai and I am wondering if the chat bot can do a calculation based off two wit/number:values and then relay the value back to the user. Thanks.

Wit doesn't perform any action/computation. You will have to do it on your code based on the returned entities.

Related

Can I use a Slack bot to count how many times each user has posted a message in multiple channels without joining those channels?

I want to use the Slack API to aggregate how many times each user in Slack has posted a message in a specific period of time. The conditions are as follows.
Multiple channels are covered
Both public and private channels are covered
So here's what I'd like to ask you;
I've read the official Slack API documentation, and apparently there are no direct API methods suitable for the above kind of aggregation, is that correct?
If the above is correct, I think the only way is to parse the text from the text property, which is the return value of the conversation.history method, and aggregate it, is that correct?
Unfortunately, there is no out-of-the-box method that will enable you to get that exact data. A bot needs to be in a channel if it's going to call conversations.history. You'd need to identify the id of the user[s] and filter through the response payload to get the aggregate number of messages for that user. However, moving forward you can use the Events API with the [messages][2] event type. This way your app will be notified of all messages in a channel in real time.

Best way to deal with IDs only containing numbers

We're trying to display some booking information to the users and we're asking to them the ID which has a 10 length numbers format like this one: 1553296942
In the stories, we try to identify the user input with an intent called bookingStatus and a entity called uid.
Thing is, this IDs are recognized as a wit/location type (it looks like coordinates to him, I guess) and it doesn't recognize them properly most of the times.
What would be the best approach to handle this situation?
For now, in the Understanding tab we're feeding the bot with lots of these IDs, adding the intent bookingStatus and marking it as uid entity aswell. Is this the right thing and shall we continue training it this way?
You can feed with the 10-length numbers. Actually there are only 10^10 possibilities for the uid entity. You can basically feed the whole 10^10 possibilities with a simple CURL command which contains a loop to 10^10.
How do you feed your NLP without the Understanding tab? Well..
Check the HTTP API Docs here
https://wit.ai/docs/http/20160526#post--entities-:entity-id-values-link
Have a nice day!

Social Tables data model

I've just started looking at the documentation as we are going to need to integrate Salesforce with Social Tables shortly, so I am really new to Social Tables.
Specifically, we will need to sync data between the CRM and Social Tables Events and Guests, and maybe other objects, so it would be very helpful to have a data model or similar to check the relationships and fields available in Social Tables architecture.
I haven't found anything in the documentation, is there any way to get this, even if it's at a high level?
Thanks
Danny
To make an integration with SocialTables you'll have to do a few manual steps, there is no way to do this completely programmatic from my experience. You'll also have to be prepared to contact SocialTables to get get correct guestlist ids. Also keep in mind that the API documentation isn't always correct, the API logic is also quite difficult to understand from time to time.
The first thing you need to do is figure out which version of the Venue Mapper you use. You'd want to use the 4.0 api and as far as I know this version of the api is only supported by Venue Mapper 3.0. I believe the Venue Mapper 3.0 is the frontend tool SocialTables provides to do the venue planning.
In social tables an event has two ids, one numerical one and one alpha-numerical one, when you use the 4.0/events endpoint you only get the alpha-numerical event id, and your going to need the numerical one. The only way I've been able to get the numerical id is to pull it out from the url when using the Venue Mapper, example of the url follows below:
https://plan.socialtables.com/team/{team_id}/event/{event_id}/space/{space_id}
Now you need to get the guestlist id, you can get that by using the following url, using the numerical event id:
GET https://api.socialtables.com/4.0/diagrams?event={numerical_event_id}
This endpoint return a json structure where one of the parameters is "guestlist_id".
Please be aware that the guestlist id you get from this endpoint might not be the correct one. I struggled quite a bit with this part and ended up with SocialTables sending me the guestlist id by email.
To get the guests in your guestlist use the following api endpoint:
GET https://api.socialtables.com/4.0/guestlists/{guestlist_id}
The {guestlist_id} is an alpha-numerical string similar to: cfdac1c0-yb1d-12e6-84a5-a39e92131645
And by that you should hopefully get access to your guests.
Hey thanks for using our API.
To answer your question, the best way to see the data model at the moment is to access our developer portal and use the API console to see what is returned. For events you will need to know the team id of the team you are working with use the team events endpoint to get access to the event ids.
https://developer.socialtables.com/api-console#!/Events/get_4_0_legacyvm3_teams_team_events
This will return some basic information about each event for that team. You can then request additional details for specific events by using this endpoint:
https://developer.socialtables.com/api-console#!/Events/get_4_0_legacyvm3_events_event

Is there a way to get the survey count totals using the SurveyMonkey API?

I have been working with the SurveyMonkey API for a few days now.
My ultimate goal is to be able to gather the voting results for each question in a survey.
For example... if I have a 5 question survey and each question has 3 options/answers... I'd like to gather the results of each question/option.
From what I'm finding in the API documentation... this is not possible.
Can this really not be possible?
Is there a way to gather the results of each question/answer combo using the API?
I hope I'm simply overlooking something.
Thanks!
It is definitely possible to get this kind of information - you can get the metadata of the survey via the API and all response data. How you process and parse that is up to you.
The most common use case to get a list of survey results is done the following way:
Get a list of respondent_ids via get_respondent_list
Send these respondent_ids to get_responses to get the raw response data
Match up the ids from this data with the ids described in the survey's metadata, which you get from get_survey_details

Can you get the exact date a user started following another using the twitter API?

Let's say user A follows user B, and B follows A. I want to know the exact date A started following B and viceversa.
Is this information stored on twitter? Can I retrieve it using the API?
To clear out: The point of this question is finding a way to know who followed who first.
(I'm assuming both A and B deleted the notification e-mails)
No Ignacio, you can't. You just can know who follows who but not the date the follow started.
Looking at the API, there's is no way, there are two calls to get the followers:
User Methods/statuses/followers
and
Social Graph Methods/followers/ids
Neither of them returns dates or even a serial that would let you see who started following first. Really, there's no indication that twitter is internally storing this information, neither in the API nor Twitter's web interface.
This is a very old question, but perhaps some might be interested to know that while you cannot get the date at which someone started following, you can at least infer an "earliest possible following date" from the fact that the list of followers is ordered according to date, and the fact that follower objects come with a created_at timestamp.
Here's a Python function for calculating an "earliest possible following date": https://github.com/BernhardClemm/twitter-follow-dates
Of course Twitter stores it, because Twitter sorts followers and following lists by the date ;)
It is possible to do this, but impractical. When you call the followers API you can page the results. Each returned object contains next_cursor and prev_cursor items. These refer to the first and last records in the next and previous pages. These values are time based and can be used to calculate the time that the respective users followed you.
It follows that, if you set the page size to 1, you can walk through the list of follower IDs one at a time and the next_cursor value will allow you to derive the follow time for the next record.
This is reasonably simple to implement, however, in practice, you'll very quickly hit Twitter's API rate limit.