Open saisub opened 7 years ago
I think so. You can check the groupId of glip message to tell which channel/team the message comes from.
If you want to know who is asking, check the creatorId of the glip message.
Hmm. I could not find a way to access that information in API.AI. Will continue looking. Alternatively is there a way to have multiple AI agents connect via the same Ringcentral API or do I have to create a Ringcentral APP for each one. Essentially I am trying to have different agents for different audiences. Can I have multiple bits in GLIP all of which are enabled via a single API.AI integration?
Sorry, I'm not sure what do you mean by "that information in API.AI".
BTW, @saisub welcome to join our RingCentral Developers discuss group in Glip. You can talk with ours developers and PM directly. Join by here. Or search RingCentral Developers
in Glip.
Can you tell me how I can assign the group ID, creator ID, etc from a glip message to parameters in an API.AI intent? I.e. how do I acess them inside API,AI. Thanks a bunch
Sai
How about sending group ID
and creator ID
to API.AI by sessionId in request
I think I am missing something basic. In glip the user types something and in api.ai I have the console where I can put intents etc. I don't see how I can pass or access any of the hidden variables like group ID etc. Do I have to do some JSON hacking or use webhooks/write separate javascript or am I missing something basic
In your code I see all of these variables. Do I just have to add code inside it --- Something like if groupID =x then do y inside "send message" or is there a way to expose those variable inside the API.AI UI so that I can just add intents like
If the user sai @xyz then post abc on the xyz channel etc. The problems I am trying to solve are the following:
1.) Whenever someone says @team1 inside the everyone channel lets say--> I want to send notification to the people in team 1 by posting on the team1 channel or create an @mention for everyone in team1
2.) For a certain question I want to give different answers based on the groupID (i.e the team that it was posted in) /
I see that those variables exist in your code. Just don't know how to expose them inside API.AI's UI. Should I branch your code and try to write stuff in it? Is there a way to automatically have those values appended to everything that the user sends so that I can access them as parameters in the API.AI intents /entitys?
Some folks have talked about setting up a generic context like this for facebook for example. I wonder if we can create a glip context that gets assigned all of these values --> group ID, user ID etc. Also if we can expose glip sys parameters like group ID etc that can be changed ---> for example to send a message to team B when we get a message from team A. Don't know if any this make sense. Thanks for all your help
let apiaiRequest = apiAiService.textRequest(text,
{
sessionId: sessionIds.get(sender),
contexts: [
{
name: "generic",
parameters: {
facebook_user_id: sender
}
}
]
});
HI I was able to make changes to your code to extract the group ID of a team when there is an @team in the message and send a message to that channel. I now just need help with the following. The scenario
Somepone posts a message in team1 with a mention to team2 by saying in team 1 something like he @team2 respond to this please. I am able to send a message to the team2 (that part is working). I now would like to include the name of team1 and a link back. I can access the groupID of team from the msg.groupID but don't know how to compose a message so that a link to team1 shows up in the message I compose for team 2. Basically my message on team2 should be. Hey team2 there is an important message for you at name at team 1(link of team1)
BTW I have even succeeded in getting the link to show up in team2 in the raw form http://app.glip.com/groupID but can't seem to show it as an embedded link the link format does not seem to work
Hi, @saisub You can send group Id or other params to API.AI by contexts. This is a example.
And the structure of my bot is: Glip ---> Your Bot -> API.AI ---> Your Bot ---> Glip.
You can set you message logics in You Bot code. And use API.AI to choice actions and generate response message.
Thanks I will give it a try. BTW as per my previous entries. I have gotten pretty close to solving the message teamB when there is a mention in teamA with a @teamB message. I can now send a message to teamB alerting them of a message in teamA. I can also include a link in that message which looks like https://app.glip.com/groupIDofteamA. I have not yet figured out how to embed the link as part of the message. I tried the link method but that does not work. It sends it to another tab in chrome.. Any thoughts of that would be great.
I am afraid that Glip app don't support it. I will check it with my colleagues
Alternatively is there a way to @mention someone via the API. I could possibly just extract all the members of a team and send @mentions to them
Is there a way to populate different input contexts depending on which channel/team the message comes from. I am trying to respond with different messages based on who is asking -- a customer vs an employee for the same question