Bookmark and Share Share   

Using Mashable/Mashup Technical Specs

Most of the information you need to invoke mashables or mashups programmatically using either the Presto REST API or Presto Connect for JavaScript (PC4JS) API is available as a Technical Spec on each mashable’s or mashup’s artifact page.

To find this information:

  1. Find the mashable or mashup from Browse or other links and open the artifact page for that mashable or mashup.

  2. If this is a mashable and it has more than one operation, choose the operation you want to invoke.

    You can also change the input parameter values, if desired.

  3. Select Details > Technical Spec. The specific details, including the REST URL to use and the content type are shown:

    You can change any of the values for parameters or add or delete any Presto Headers/Parameters.

    The sample URL always includes thePresto header x-p-resultFormat=json. This header requests a JSON format for the response, which is highly useful if you are working with JavaScript in Apps or web pages.

    For other languages or situations, you can remove this Presto header/parameter to receive the response in the native format returned by the mashable or mashup. Or change the value to XML to receive the response in XML.

    If the mashable or mashup requires a POST request, this also includes a sample of the POST body:

  4. If you are working in JavaScript, you can also simply copy and tweak any of the code samples shown:

    This includes samples using Presto Connect for JavaScript (PC4JS) or using jQuery or ExtJS.