Connectors / Service / Wolfram|Alpha Full Results

Wolfram|Alpha Full Results

Wolfram|Alpha Full Results

The Wolfram|Alpha Full Results allows the computational and presentation capabilities of Wolfram|Alpha to be integrated into web, mobile, desktop and enterprise applications.

Overview

The Tray.io Wolfram Alpha Full Results connector allows clients to submit free-form queries similar to the queries one might enter at the Wolfram|Alpha website, and for the computed results to be returned in a variety of formats.

Authentication

Note: We have two Wolfram Alpha connectors. You are currently on the docs page for Wolfram Alpha Full Results. For Wolfram Alpha Short Answers please go here.

When using the Wolfram Alpha Full Results connector, the first thing you will need to do is go to your Tray.io account page, and select the relevant workflow. Once in the workflow dashboard itself, search and drag the Wolfram Alpha Full Results connector from the connectors panel (on the left hand side) onto your workflow.

With the new Wolfram Alpha Full Results connector step highlighted, in the properties panel on the right, click on 'New Authentication' which is located under the 'Settings' heading.

This will result in a Tray.io authentication pop-up window, that should look like this:

As you can see, in order to set up a new authentication, you will need an 'AppID'. This can be found at your Wolfram|Alpha Developer Portal.

If you are a new user, in order to get your first AppID (and thereby start the app creation process itself), you will need to complete the sign up process on the Wolfram Alpha website.

Once you have added your contact details etc, you should see a popup similar to the one below which is the final sign up step.

Your app can be created either during sign up (as mentioned above), or afterwards once you have made it to the main dashboard.

Go to your 'Apps' section and click 'Sign up to get your first AppID' button (this will be labelled as 'Get an AppID' if you are a returning user):

After a one-time survey about intended usage, the AppID creation dialog will appear.

Give your application a name and a simple description to register an AppID.

Each application has its own unique AppID:

Once you have these, you can click on the 'New Authentication' button within Tray.io and fill in the authentication sections as appropriate to complete:

Note on Operation Usage

This connector has only one operation, 'Query', whose sole purpose is to return a results from the Wolfram Alpha Full Results API in response to the input parameters.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Example Usage

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Wolfram Alpha Full Results connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

This tutorial will demonstrate how the Wolfram|Alpha Full Results API will use the email trigger in order to return an answer to our query.

PLEASE NOTE: A more likely scenario would be to utilise the Wolfram Alpha Short Answers connector with either a webhook trigger tied into a form from your company website, or even using the Wolfram Alpha Short Answers connector with the Tray.io Form trigger itself.

The first step uses and email to trigger the workflow, which in turn kicks off a sequence of events as follows:

  1. Accept a query via email, using the Email Trigger.
  2. Once sent to the Wolfram|Alpha Full Results API, it in turn will return a result.
  3. Use a Send Email connector to return said Query and Answer in an email message.

The final outcome should look like this:

1. Extract query from Trigger

Due to the nature of the Wolfram Alpha Short Answers connector you are more likely to use this in order to return queries from your own website that customers may have sent in via a webhook trigger, or even through utilising the Tray.io form, but for the purposes of creating a simple example in this scenario we are using the email trigger as it is easy to understand and set up.

To begin with, create a workflow by selecting the email trigger from the connectors panel on the left. The email trigger allows you to trigger a workflow by sending an email.

The email address you will need to send your query to (and will receive your answer from) will be along the lines of:

trigger+**routingID**@traymail.io

To find the routing ID of your workflow, you need to click the settings button in the top left hand corner (the gear icon) and copy the 'Workflow Public URL'

For more information on this trigger and its capabilities please see our dedicated page: Email Trigger

2. Query with Wolfram Alpha Full Results

Add a Wolfram Alpha Full Results connector to step two fo your workflow.

Ensure that your Wolfram Alpha authentication is selected and set up as explained above.

The Operation is set to 'Query' by default. Your next input is called 'Input' and is a required field (what will essentially be submitted to the Wolfram Alpha Short Answers API).

Drag the orange connector-snake from the 'Input' property over to the email trigger, as displayed below, and select the text option in order to auto populate a JSON path to the text result.

CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

The 'Input' property should now read $.steps.trigger.text and the type selector will have changed to the jsonpath symbol as a result.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.

Besides 'Input' there are 25 other properties available to fill in, but they are not required. For the purpose of this tutorial we will add 'Result' to the 'Include Pod ID' field.

3. Receive result

Add the Send Email connector step to the next stage. Again you have only have a singular default operation with this step ('Send Email').

You must add at least one recipient, so make sure to click on the 'Add recipient' button. In doing so you will see that you now have three fields that MUST be populated: 'Email', 'Subject' and 'Content'.

For the 'Content' field you may again use the connector-snake from the 'Content' property, to the Wolfram Alpha Short Answers connector step. Make sure to choose 'plaintext' from the panel.


Populate them as appropriate. You you may wish to use Interpolation to populate your content field automatically in order to clarify your result:

Content:

Query: {$.steps.trigger.text}
Answer: {$.steps.wolfram-alpha-full-results-1.queryresult.pods[0].subpods[0].plaintext}
INTERPOLATION: When you wish to include JSON generated data within another input/ output/ result, use our Interpolation method as described here.

The above will now autofill the email content with both the query and the result. As you can see, curly braces {} and jsonpaths can be used to incorporate output values into the text itself.

Using you email, try sending an email to trigger+routingID@traymail.io with content 'Population of London'.

Remember that you will need to remove any signatures from you email and send plain text.

Once your workflow is run (aka an email is sent to your trigger email address), the result will be seen in both your Debug panel output step:

And of course, also in your inbox:

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our Managing data best practices guide.

All Operations

Latest version:

1.0