Welcome, Guest Login

Support Center

Remote Query - RESTful Call Block

Last Updated: Jan 16, 2019 09:00PM EST

Remote Query - RESTful Call

Version: 4.10

Build query against a remote (RESTful based) source and parse results. <a href="http://support.eachscape.com/customer/portal/articles/1571988-remote-query-block-restful-calls" target="_blank">Tutorial</a>

Usage

Drag this block into your app and then you can edit it's settings by right clicking on the block with your mouse.

Version:4.00
The Remote Query Block is used to interact with web services through a RESTful API. You can add as many text fields as you need and one image and/or video to your request, choose the HTTP method (POST, GET, PUT, ..) used for the request, and store fields from the response in one or more variables that you define. The Block will trigger a different Event (Success, Failure, No Response) depending on the response from the remote server.

The request (query) will be sent by the Remote Query Block as soon as the Block is visible on the screen. In most cases, the Block is added as the only block on its own layer. The layer containing the remote query block is added using the Add Layer Action when the event occurs that you want to trigger the remote query. The layer is removed when the request is completed using the Remove A Layer action on the Success/Failure/No Response events.

Parameters

Show Busy Indicator Display a spinning "busy" indicator while loading.
URL The URL for the <b>REST call</b>.<br><br>Learn more on how to set up REST calls with <a href="http://support.eachscape.com/customer/portal/articles/1571988-remote-query-block-restful-calls" target="_blank">Remote Query Tutorial</a><br><br> IMPORTANT:<br>The default URL: <a href="http://support.eachscape.com/customer/en/portal/articles/2322784-create-update-delete-cloud-collection-api#ECCv2URL" target="_blank">builder.eachscape.com/data/api/v2.xm</a> is the URL used to <a href="http://support.eachscape.com/customer/en/portal/articles/1442667-write-into-a-cloud-collection-from-an-app" target="_blank">Write into EachScape Cloud Collection</a>. <br><br>If you use <b>your own web services</b>, you must replace this URL by your own URL to your own RESTful Web Services.
Fields Query parameter variables. Will be appended to the URL for GET method, or set in the body in the POST method. <br><br><b>IMPORTANT:</b> If you are using EachScape Cloud Collection DO NOT FORGET the <a href="http://support.eachscape.com/customer/en/portal/articles/1430838-authorize-write-access-to-a-cloud-collection" target="_blank">api_key parameter</a>
Header An extra HTTP Header field to put into the request. (e.g: Content-Type: application/json)
Name Name of the query parameter. <br><br>If using Cloud Collection, the syntax is: <b>values[Name of Cloud Collection Column] </b>with the name of the column in brackets as show here without quotes.<br><br><a href="http://support.eachscape.com/customer/en/portal/articles/2322784-add-delete-update-cloud-collection-api" target="_blank">Learn more on Cloud Collection API</a>
Value Value of the query parameter. It can be static or a variable.
Files The number of Files to be uploaded. <br><br>If Files isn't set the Header will not be posted.<br> <a href="http://support.eachscape.com/customer/portal/articles/2954902" target="_blank">One HTML File Selector</a> per file to upload is required. That File Selector <b>MUST</b> be saved as a Custom Block.<br><br><b>ONLY WORKS WITH HTML VIEWS</b>
File Selector HTML File Selector Block used to select the file to upload.<br><br>The Block itself, is the handle to the file being uploaded.That File Selector <b>MUST</b> be saved as a Custom Block.<br><br><a href="http://support.eachscape.com/customer/portal/articles/2954902" target="_blank">How to use the HTML File Selector</a><br><br><b>ONLY WORKS WITH HTML VIEWS</b>
Field Name Name of the query parameter. <br><br>If using Cloud Collection, the syntax is: <b>values[Name of Cloud Collection Column] </b>with the name of the column in brackets as show here without quotes.<br><br><a href="http://support.eachscape.com/customer/en/portal/articles/2322784-add-delete-update-cloud-collection-api" target="_blank">Learn more on Cloud Collection API</a>
File Name The name of the file being uploaded. If left blank, the original file name will be used.
Image Block The image to upload. To be passed on as a Parameter, the image MUST be <a href="http://support.eachscape.com/customer/portal/articles/1362626" target="_blank"><b>stored in a Custom Block</b></a>. <br><br>Here is how:
<a href="http //support.eachscape.com/customer/portal/articles/2526159-save-photos" target="_blank">Tutorial to send image using a Custom Block</a><br><br>For more, also review <a href="http://support.eachscape.com/customer/en/portal/articles/2322784-add-delete-update-cloud-collection-api" target="_blank">syntax for ECC API</a>
Image Name Name of the Parameter to upload the image. This is the equivalent of 'Name' for our Text Parameters.<br><br> If using Cloud Collection, the syntax is: values[Name of Cloud Collection Column][asset], see <a href="http://support.eachscape.com/customer/en/portal/articles/2322784-add-delete-update-cloud-collection-api" target="_blank">syntax for ECC API</a>
Image Filename You <b>MUST add a .png or .jpg extension to that name</b>. <br><br>This is Metadata conveying the name of the file of the uploaded image. <br>This is <b>NOT</b> a name actually used to select the uploaded image, the image is uploaded using a Custom Block via the Image Block Parameter. This is the name of the filename of the image on the remote server. <a href="http://support.eachscape.com/customer/portal/articles/2526159-save-photos" target="_blank">Refer to the the Save Photos Tutorial for a working example</a>
Video URL The URL for a video that will be uploaded with this remote query.
Method Use the method <b>required by your back end</b>.<br><br> If using EachScape Cloud Collection then use: <br><b>POST to create<br> PUT to Edit<br> Delete to delete</b>. <br><br>Learn more on <a href="http://support.eachscape.com/customer/en/portal/articles/2322784-create-update-delete-cloud-collection-api" target="_blank">EachScape Cloud Collection API</a>.
Response Type If RAW is selected then the response will be stored in the first key as the value.
Response Parser Only XPath is supported at this time.
Status Code Variable Variable to use to store the HTTP response code (i.e. 200, 404).
Status Code Reason Variable This is the Status Response/Reason for the status code that's part of the response.
Variables A set of variable/path pairs that are used to extract values from the response and store them in your app.<br><br>This action sets the value of a variable. <br><br>Variable values can be obtained by using the <a href="http://support.eachscape.com/customer/en/portal/articles/807649-introduction-to-expressions" target="_blank">Expression</a><b> [[var:name]]</b>, where you have replaced the string <b>name</b> with the name of the variable you want to access.<br><br><a href="http://support.eachscape.com/customer/portal/articles/1651789" target="_blank">Creating a Variable</a><br><br><a href="http://support.eachscape.com/customer/en/portal/articles/1338143-using-variables" target="_blank">Using Variables</a>
Variable Variable to store data located in the Path.<br><br>This action sets the value of a variable. <br><br>Variable values can be obtained by using the <a href="http://support.eachscape.com/customer/en/portal/articles/807649-introduction-to-expressions" target="_blank">Expression</a><b> [[var:name]]</b>, where you have replaced the string <b>name</b> with the name of the variable you want to access.<br><br><a href="http://support.eachscape.com/customer/portal/articles/1651789" target="_blank">Creating a Variable</a><br><br><a href="http://support.eachscape.com/customer/en/portal/articles/1338143-using-variables" target="_blank">Using Variables</a>
Path The XPath expression used to extract the value from the response. <br><br> If the Response Type is JSON, then this must begin with <b>/json/</b>.<br><br><a href="http://support.eachscape.com/customer/portal/articles/2801978-rest-response-path-json-xml" target="_blank">More on XPath</a>

Event(s)

Before Draw, Success, Failure, No Response

Help us improve! Rate this article:

Yes I found this article helpful

Ask a Question   

support@eachscape.com
http://assets2.desk.com/
false
eachscape
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete