How to pass BotEngine attributes via BotEngine webhook back to my backend - webhooks

I've been digging around on BotEngine's documentations and their backend for this but haven't found anything solid. Any hints or pointing for directions are very appreciated!

I found how to do it, basically as long as an attribute is defined in a interaction, the attribute's value will be passed to the corresponding webhook in the request body.

Related

Unable to use the method courses.courseWork.studentSubmissions.return() in Google Classroom API

I am trying to return the responses received in Google Classroom, according to the API documentation on this, I need to use this method courses.courseWork.studentSubmissions.return() but this triggers an error because of the keyword return being used as a funtion call.
Please correct me if I'm wrong and any help in this regard would be greatly appreciated.
You can find the documentation of the method in Python here
So the request should look like
service().courseWork().studentSubmissions().return_(courseId=PASS_HERE_THE_COURSEID, courseWorkId=PASS_HERE_THE_COURSEWORDID, id=PASS_HERE_THE_SUBMISSION_ID)
Please keep in mind that:
Only a teacher of the course that contains the requested student submission may call this method.

Give a variable response in Dialogflow without hardcoding in fulfillment

I'm working on a Dialogflow chatbot, and I'm currently giving the response hard coded in fulfillment using agent.add(). However, the product owner wants to be able to modify the wordings without having to change and redeploy code. What are the options for this, other than storing responses in a file or in a database? Is there a way to have variables in the response when you add it in the response section in the Dialogflow console, where that variable is set in fulfillment, but otherwise the response is given as per the response in the console? Is there a way to select which response is given out of the ones set in the Dialogflow console from fulfillment? I'm using the nodejs fulfillment library without actions on google.
I think you have two options:
Use one intent only with various parameters
You can have multiple variants of responses in one intent. These will be prioritized by the maximum parameters they can fill. For example, if you are sending parameter "a" to a single intent using detectIntent API, the second response here will be triggered and shown to the user.
This is a response1 without parameters
This is a response1 with parameter $a <-- This will be triggered
This is a response1 with parameter $a and $b
As a little hack, you can also send an empty unicode space character here, if you prefer not to generate any parameters on the backend. Not too clean, but would work.
Use events triggered from your backend
In this case, your webhook/backend would choose a proper event to call. Hence, you would have mutliple intents, each with a unique response. You can also combine this approach with the first point above. You can read more about events here.

RichResponse VS basicCard order

I'm facing a quite annoying issue with the Actions On Google SDK.
I want to send to the user these things in this order :
A basic card
A text
A suggestion chip
I simply did this :
let richResponse = assistant.buildRichResponse();
richResponse.addBasicCard( ... );
richResponse.addSimpleResponse( ... );
richResponse.addSuggestions( ... );
Problem is, no matter the order set in my code, google will always send the simple response before the card.
If i log the JSON before sending it, the card is indeed AFTER the message.
I tried to simply switch them in the JSON before sending it but then the assistant simply crashes.
All in all, i see no option to achieve what i want :/
If i could send a 1 item carousel i wouldn't need all that, but it's apparently impossible to send such carousel because the assistant also crashes.
If i could add buttons with JSON payload instead of external URL in BasicCard i could also workaround all these issues, but that's not possible either... I feel quite stuck.
Anyone has a workaround ?
Regards
The RichResponse object requires that the first item in the response be a SimpleResponse object, so you need some text first.
However, you are allowed to have two SimpleResponse objects, so you can try adding a SimpleResponse, the card, another SimpleResponse, and then the suggestions.
It isn't clear how being able to have just one option would let you work around this (although I agree). You would still need a SimpleResponse that appears before the option.
It isn't clear what you mean by "buttons with JSON". In this sense, suggestion chips work exactly the same way options do - they send something back to your webhook (options send the tag, while the suggestion chips send their contents).

How can I reliable match link, link_title and link_description

When parsing the message request object in my connector how can I reliable match a link to its title and description attribute? Are they always sorted in a special order in the parts array or is there only one link per message allowed?
I didn't find anything about this in the documentation.
Currently in unificationengine, it seems that you can send only one link at a time by using v2/message/send api command.

Getting workerId by assignmentId

In Amazon Mechanical Turk, when creating an External Question then it will send you each assignment like this:
http://tictactoe.amazon.com/gamesurvey.cgi?gameid=01523
&hitId=123RVWYBAZW00EXAMPLE
&assignmentId=123RVWYBAZW00EXAMPLE456RVWYBAZW00EXAMPLE
Surprisingly, it doesn't send me the workerId and I can't find any way to do this. The closest method is GetAssignmentsForHIT which only gives me the assignment already submitted but I need to render the assignment based on the worker history.
As msha points out, the sending of a workerID parameter to an ExternalQuestion page seems to be deprecated, or at least taken out of the latest version of the documentation.
However, a fellow researcher who's been using MTurk a lot says: "People seem to be using it in the forums. I would go ahead with it...if it ever actually disappears, I'm sure that the developer community will yell very loudly. :) "
I tried it empirically today (2011-08-19), and indeed a workerID is being sent to the ExternalQuestion page I set up on my own server, after the HIT has been accepted. This was in the sandbox. My ExternalQuestion page contained a Java Web Start button (as described here: http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/createWebStartLaunchButtonFunction.html ); I don't know if that made any difference.
A recent addition to the API is the GetAssignment call, which takes the assignment ID as an argument and will return the Worker ID inside the Assignment data structure.
According to the MTurk docs here,
When a Worker accepts your HIT, you can get the ID of the Worker. If
your HIT contains a Java Applet, an IFrame, or embedded binary data,
the URL contains a value for the workerId. If your HIT does not
contain these types of data, or if a Worker has not accepted the HIT,
the workerId element doesn't appear.
Haven't tried to confirm this myself yet.

Resources