Formats

The Web Connector allows to get data from RESTful Web Services that serve JSON content.

Supported response content include the three most commons standards: JSON:API, ODATA, JSEND

JSON:API format example:

{
  "links": {
    "self": "http://example.com/articles"
  },
  "data": [
    {
      "type": "articles",
      "id": "1",
      "attributes": "att1"
    },
    {
      "type": "articles",
      "id": "2",
      "attributes": "att2"
    }
  ]
}

With this format, the connector will create a one table schema. This table will be named “data”.

ODATA Example:

{
  "@context": "http://host/service/$metadata",
  "value": [
    {
      "name": "Orders",
      "kind": "EntitySet",
      "url": "Orders"
    },
    {
      "name": "OrderItems",
      "title": "Order Details",
      "url": "OrderItems"
    },
    {
      "name": "TopProducts",
      "title": "Best-Selling Products",
      "kind": "FunctionImport",
      "url": "TopProducts"
    }
  ]
}

Similarly to the JSON:API format, the connector will create a one table schema. This table will be named “value”.

JSEND Example:

{
  "status": "success",
  "message": "Data found",
  "data": {
    "requests": [
      {
        "id": 10,
        "request_code": "8B2BD1",
        "provider_name": "Al Marasim Ladies Salon",
        "provider_name_ar": "Al Marasim Ladies Salon",
        "provider_name_en": "Al Marasim Ladies Salon",
        "service_name": "Nails & Feet",
        "start_datetime": "2018-09-04 18:03:07",
        "status_label": "Pending",
        "status": 1
      },
      {
        "id": 8,
        "request_code": "8713ED",
        "provider_name": "Provider",
        "provider_name_ar": "Provider",
        "provider_name_en": "Provider",
        "service_name": "Nails & Feet",
        "start_datetime": "2018-09-04 18:03:07",
        "status_label": "Pending",
        "status": 1
      }
    ]
  }
}

For this exact format, the Web connector would create a one table schema with one table named “request”. However, depending on how the JSEND API was programmed, the sub-object under data could be named differently e.g “payload”, “post” or basically any name the original developers decided to use. In this cases, the connector will name the table accordingly to the keyword used.

In addition to these three standard formats, the Web connector also support multiple non-standard json responses.

Simple Array:

[
  {
    "Id": 8569,
    "Module": "Production",
    "Shift": "Noon",
    "Staff": "Captain Marvel",
    "Kiln_Feed": 89.6533838600779
  },
  {
    "Id": 8563,
    "Module": "Production",
    "Shift": "Noon",
    "Staff": "Captain America",
    "Kiln_Feed": 89.3475083300634
  },
  {
    "Id": 8556,
    "Module": "Production",
    "Shift": "Noon",
    "Staff": "Captain America",
    "Kiln_Feed": 88.3035192802069
  }
]

With this type of response the connector will create a one table schema with one table named “data array”.

Multiple Arrays

{
  "TableA": [
    {  // data record 1 for TableA
      "FieldA1": "ValueA1_1",
      "FieldA2": "ValueA2_1",
      ...
    },
    {  // data record 2 for TableA
      "FieldA1": "ValueA1_2",
      "FieldA2": "ValueA2_2",
      ...
    },
    {  // data record 3 for TableA
      "FieldA1": "ValueA1_3",
      "FieldA2": "ValueA2_3",
      ...
    },
    ...
  ],
  "TableB": [
    {  // data record 1 for TableB
      "FieldB1": "ValueB1_1",
      "FieldB2": "ValueB2_1",
      ...
    },
    ...
  ],
  ...
}

Here a multi-table schema will be created with one table for each object array present in the response.

Data Property

{
  "cityid": "101010100",
  "date": "201805",
  "cityEn": "beijing",
  "avgbWendu": "28",
  "avgyWendu": "16",
  "maxAqi": "186",
  "minAqi": "99",
  "maxAqiLevel": "4",
  "minAqiLevel": "1",
  "data": [
    {
      "ymd": "2018-05-01",
      "aqi": "121",
      "aqiLevel": "3"
    },
    {
      "ymd": "2018-05-02",
      "aqi": "44",
      "aqiLevel": "1"
    }
  ]
}

If no common standard is recognized, the connector will look for a “data” property. In this response exemple, the connector would create a single-table schema with a table named “data”.

Selecting Connection Type

In the “Create Connection” dialog change the Connection “Type” by selecting “Web” :

connection Web parameters

Connection Parameters

URL

Enter the API URL which must be a valid REST API as seen above.

Authentication Type

Select the authentication to use :

  • “No Authentication”
  • “Basic HTTP Authentication” : with User name and Password

Data refresh and Buffer

The Web Connector is bufferized.

If you need to get new data, see Chapter The data Buffer

Last modified: Jun 18, 2020

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment