Send ReST API Request

Send the data source request via the Web API proxy server for CRUD operations.

This function is how client-side applications securely access server-side ReST API requests without having to know about security credentials.

All ReST API CRUD operation for custom forms, and activity metrics calls this function which is designed to handle any type of ReST API for all HTTP methods.

Send App Studio Data Source Request

POST AppStudio/InvokeCRUDoperationUsingThirdPartyDataSource

This is a POST method which passes both the API and session keys as headers, and a body. If successful, the custom data sources can be stored.

Headers

Name
Value

Content-Type

application/json

SiteKey

API Key

DataServicesKey

Session Key

Body

Name
Type
Description

BodyJson

String

JSON body specified when data source request was connected in App Studio.

CustomVariables

List

A list of custom variables assigned to fields on the form, or components on the form. This passes the context of the client-side data to the server for processing.

RequestGUID

String

The data source request ID associated with the form, component or field. Identifying this is described here.

RequestURL

String

This is optionally supplied only when the designer is creating and testing data source requests and wishes to manually override parameters.

Response Snippet

{
  "Success": true,
  "URL": "https://.....",
  "Verb": "GET",
  "Columns": [
      {
         "field": "_id",....
     }, ....
  ],
  "DataTable": {
    "FirstRowNumber": 0,
    "LastRowNumber": 0,
    "List": [
      {
        "Country": "Mexico",
        "Flag": "[\r\n  \"681c5e4f78badf65000b663e\"\r\n]",
        "Name": "Mexican",
        "_id": "681c5e4f78badf65000b663f"
      }
    ],
    "PageNumber": 1,
    "RecordsPerPage": 10,
    "Success": false,
    "TotalPageCount": 1,
    "TotalRecordCount": 1
  }
}

Pagination

The response snippet above shows how this Web API call always returns data in this format with columns and a data table containing a list. This is because the list may only be a small part of the entire data table i.e. only a page of data is returned. These are useful when the ReST API is enabled for paging to optimise performance for both the client and server by sending only small pages of data, rather than the entire data set which could be millions of records.

This is a complex subject discussed for production designers here.

Full Response Sample

This shows the data set displayed in a data grid.

Here is the response from the Web API after it has executed the ReST API request:

{
    "Columns": [
        {
            "field": "_id",
            "title": "Id",
            "type": "string",
            "format": null,
            "width": 100,
            "hidden": true,
            "template": null
        },
        {
            "field": "Country",
            "title": "Country",
            "type": "string",
            "format": null,
            "width": 200,
            "hidden": false,
            "template": null
        },
        {
            "field": "Name",
            "title": "Name",
            "type": "string",
            "format": null,
            "width": 200,
            "hidden": false,
            "template": null
        },
        {
            "field": "Flag",
            "title": "Flag",
            "type": "string",
            "format": null,
            "width": 200,
            "hidden": false,
            "template": null
        }
    ],
    "DataTable": {
        "List": [
            {
                "_id": "67f8e87578badf6500052231",
                "Country": "Germany",
                "Name": "German",
                "Flag": "[\\r\\n  \\"67f8e87478badf6500052230\\"\\r\\n]"
            },
            {
                "_id": "681c5e4f78badf65000b663f",
                "Country": "Mexico",
                "Name": "Mexican",
                "Flag": "[\\r\\n  \\"681c5e4f78badf65000b663e\\"\\r\\n]"
            },
            {
                "_id": "6863e59178badf6500137d4f",
                "Country": "Nigeria",
                "Name": "Nigerian",
                "Flag": "[\\r\\n  \\"6863e59178badf6500137d4e\\"\\r\\n]"
            },
            {
                "_id": "67f7cb3378badf650004fb57",
                "Country": "Norway",
                "Name": "Norwegian",
                "Flag": "[\\r\\n  \\"67fe0bf178badf650005cfb5\\"\\r\\n]"
            },
            {
                "_id": "67f7cb6f78badf650004fb67",
                "Country": "South Korea",
                "Name": "South Korean",
                "Flag": "[\\r\\n  \\"67fe0c2c78badf650005cfbf\\"\\r\\n]"
            },
            {
                "_id": "6863f5f478badf650013800d",
                "Country": "Denmark",
                "Name": "Danish",
                "Flag": "[\\r\\n  \\"6863f5f478badf650013800c\\"\\r\\n]"
            },
            {
                "_id": "6863e4f378badf6500137d33",
                "Country": "Morocco",
                "Name": "Morocco",
                "Flag": "[\\r\\n  \\"6863e4f378badf6500137d32\\"\\r\\n]"
            },
            {
                "_id": "67f7cba378badf650004fb74",
                "Country": "Ireland",
                "Name": "Irish",
                "Flag": "[\\r\\n  \\"67fe0d3478badf650005cfdc\\"\\r\\n]"
            },
            {
                "_id": "67f7cbea78badf650004fb8d",
                "Country": "Spain/Espana",
                "Name": "Spanish",
                "Flag": "[\\r\\n  \\"67fe0d6d78badf650005cff1\\"\\r\\n]"
            },
            {
                "_id": "67a601e44779de1b00027af9",
                "Country": "Great Britain",
                "Name": "British",
                "Flag": "[\\r\\n  \\"67fa327278badf6500054bc4\\"\\r\\n]"
            },
            {
                "_id": "67a601f84779de1b00027afc",
                "Country": "Brazil",
                "Name": "Brazilian",
                "Flag": "[\\r\\n  \\"67f9119d78badf6500052737\\"\\r\\n]"
            },
            {
                "_id": "67a602084779de1b00027afe",
                "Country": "France",
                "Name": "French",
                "Flag": "[\\r\\n  \\"67fa30a978badf6500054b87\\"\\r\\n]"
            },
            {
                "_id": "67f7cbff78badf650004fb92",
                "Country": "Belguim",
                "Name": "Belgian",
                "Flag": "[\\r\\n  \\"67fa312678badf6500054ba0\\"\\r\\n]"
            },
            {
                "_id": "67f7cbce78badf650004fb81",
                "Country": "Netherlands/Holland",
                "Name": "Dutch",
                "Flag": "[\\r\\n  \\"67fa31a478badf6500054bb4\\"\\r\\n]"
            },
            {
                "_id": "67f7cb5278badf650004fb5d",
                "Country": "Egypt",
                "Name": "Egyptian",
                "Flag": "[\\r\\n  \\"67fa32d678badf6500054bcc\\"\\r\\n]"
            },
            {
                "_id": "67f7cb8278badf650004fb6b",
                "Country": "England",
                "Name": "English",
                "Flag": "[\\r\\n  \\"67fa336b78badf6500054bea\\"\\r\\n]"
            },
            {
                "_id": "67f7cb1478badf650004fb4d",
                "Country": "Portugal",
                "Name": "Portuguese",
                "Flag": "[\\r\\n  \\"67fd5d3578badf650005ba96\\"\\r\\n]"
            },
            {
                "_id": "67f7cb8e78badf650004fb6d",
                "Country": "Scotland",
                "Name": "Scottish",
                "Flag": "[\\r\\n  \\"67fe0c6078badf650005cfc4\\"\\r\\n]"
            },
            {
                "_id": "67f7cb9778badf650004fb6f",
                "Country": "Wales",
                "Name": "Welsh",
                "Flag": "[\\r\\n  \\"67fe101b78badf650005d03d\\"\\r\\n]"
            },
            {
                "_id": "681b7aaa78badf65000b3561",
                "Country": "Falkland Islands",
                "Name": "Falkland Islander",
                "Flag": "[\\r\\n  \\"681b7aa978badf65000b3560\\"\\r\\n]"
            },
            {
                "_id": "681b79b578badf65000b353a",
                "Country": "Croatia",
                "Name": "Croatian",
                "Flag": "[\\r\\n  \\"681b79b578badf65000b3539\\"\\r\\n]"
            },
            {
                "_id": "681b924878badf65000b3979",
                "Country": "Mauritius",
                "Name": "Mauritian",
                "Flag": "[\\r\\n  \\"681b924878badf65000b3978\\"\\r\\n]"
            },
            {
                "_id": "681b84b078badf65000b371b",
                "Country": "Kazakhstan",
                "Name": "Kazakh",
                "Flag": "[\\r\\n  \\"681b84b078badf65000b371a\\"\\r\\n]"
            },
            {
                "_id": "681de29778badf65000babea",
                "Country": "United States of America [USA]",
                "Name": "American",
                "Flag": "[\\r\\n  \\"681de29778badf65000babe9\\"\\r\\n]"
            },
            {
                "_id": "686e910978badf65001445dc",
                "Country": "Algeria",
                "Name": "Algerian",
                "Flag": "[\\r\\n  \\"686e910878badf65001445db\\"\\r\\n]"
            },
            {
                "_id": "6863e1d478badf6500137cc2",
                "Country": "Argentina",
                "Name": "Argentine",
                "Flag": "[\\r\\n  \\"6863e1d478badf6500137cc1\\"\\r\\n]"
            },
            {
                "_id": "6863f46478badf6500137fc8",
                "Country": "Canada",
                "Name": "Canadian",
                "Flag": "[\\r\\n  \\"6863f46478badf6500137fc7\\"\\r\\n]"
            },
            {
                "_id": "6863e45878badf6500137d1a",
                "Country": "Australia",
                "Name": "Australian",
                "Flag": "[\\r\\n  \\"6863e45778badf6500137d19\\"\\r\\n]"
            },
            {
                "_id": "6863e78278badf6500137da9",
                "Country": "Switzerland",
                "Name": "Swiss",
                "Flag": "[\\r\\n  \\"6863e78278badf6500137da7\\"\\r\\n]"
            },
            {
                "_id": "6863e37978badf6500137cfa",
                "Country": "Ivory Coast",
                "Name": "Ivorian",
                "Flag": "[\\r\\n  \\"6863e37978badf6500137cf9\\"\\r\\n]"
            },
            {
                "_id": "6863ee4f78badf6500137eb7",
                "Country": "Bosnia & Herzegovina",
                "Name": "Bosnian",
                "Flag": "[\\r\\n  \\"6863ee4f78badf6500137eb6\\"\\r\\n]"
            },
            {
                "_id": "6863fe6578badf65001381ef",
                "Country": "Sweden",
                "Name": "Swedish",
                "Flag": "[\\r\\n  \\"6863fe6578badf65001381ee\\"\\r\\n]"
            },
            {
                "_id": "686f8b6478badf650014590f",
                "Country": "Italy",
                "Name": "Italian",
                "Flag": "[\\r\\n  \\"686f8b6378badf650014590e\\"\\r\\n]"
            },
            {
                "_id": "686f88dc78badf65001458ce",
                "Country": "Slovakia",
                "Name": "Slovakian",
                "Flag": "[\\r\\n  \\"686f88dc78badf65001458cd\\"\\r\\n]"
            },
            {
                "_id": "686f8d8b78badf6500145941",
                "Country": "Senegal",
                "Name": "Senegalese",
                "Flag": "[\\r\\n  \\"686f8d8b78badf6500145940\\"\\r\\n]"
            }
        ],
        "DynamicColumns": null,
        "TotalRecordCount": 0,
        "TotalPageCount": 0,
        "FirstRowNumber": 0,
        "LastRowNumber": 0,
        "PageNumber": 1,
        "RecordsPerPage": 35,
        "SortColumnName": null,
        "SortAscending": true,
        "AICriteria": null,
        "Success": false,
        "ErrorMessage": null
    },
    "URL": "https://restdb.trisys.co.uk/rest/nationality",
    "Verb": "GET",
    "Success": true,
    "ErrorMessage": null
}

Last updated