Examples

API Examples:

Example 1:

In this example, that uses 2 parameters, the function 'string.join' is called to concatenate the elements of the "value" array, using a specified "separator" between each element of the array.

When calling a function using the API, the parameter input values must be in the specified order of the overloaded function you wish to invoke.

curl --location 'https://portal.datafeed360.com/api/v1/function/{workspace_id/call/string.join' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data '{
    "separator": "-",
    "value": [ "A", "b", "C", 55]
}'
curl --location 'https://portal.datafeed360.com/api/v1/function/{workspace_id/call/string.join' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data '{
    "parameters": {
      "separator": "-",
      "value": [ "A", "b", "C", 55]
    }
}'
Return Type & Return Value

In the call result, below, the returnType value of 'string' specifies the data type of the returnValue.

{
  "version": 1.0,
  "datetime": "2025-02-18T13:31:24.3899001Z",
  "status": 200,
  "result": {
    "success": true,
    "returnType": "string",
    "returnValue": "A-b-C-55"
  },
  "count": 1
}

Example 2:

In this example, the function 'cis.getCompany' is called to return Companies House information about a registered company, Tesco PLC. Tesco's company number, 00445790, is passed in the companyNumber parameter.

curl --location 'https://portal.datafeed360.com/api/v1/function/{workspace_id}/call/cis.getcompany' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data '{
  "parameters": { "companyNumber": "00445790" }
}'
Return Type & Return Value

In the call result, below, the returnType value specifies the data type of the returnValue, in this example, object.

{
  "version": 1,
  "datetime": "2025-02-18T13:09:55.03955Z",
  "status": 200,
  "result": {
    "success": true,
    "count": 1,
    "returnType": "object",
    "returnValue": {
      "accounts": {
        "accounting_reference_date": {
          "day": "26",
          "month": "02"
        },
        "last_accounts": {
          "made_up_to": "2024-02-24",
          "period_end_on": "2024-02-24",
          "period_start_on": "2023-02-27",
          "type": "group"
        },
        "next_accounts": {
          "due_on": "2025-08-26",
          "overdue": false,
          "period_end_on": "2025-02-26",
          "period_start_on": "2024-02-25"
        },
        "next_due": "2025-08-26",
        "next_made_up_to": "2025-02-26",
        "overdue": false
      },
      "can_file": true,
      "company_name": "TESCO PLC",
      "company_number": "00445790",
      "company_status": "active",
      "confirmation_statement": {
        "last_made_up_to": "2024-06-18",
        "next_due": "2025-07-02",
        "next_made_up_to": "2025-06-18",
        "overdue": false
      },
      "date_of_creation": "1947-11-27",
      "etag": "18bd7b4e97188bfe65828f3e791f6f9cfdaf92d7",
      "has_been_liquidated": false,
      "has_charges": true,
      "has_insolvency_history": false,
      "jurisdiction": "england-wales",
      "last_full_members_list_date": "2013-06-07",
      "links": {
        "self": "/company/00445790",
        "charges": "/company/00445790/charges",
        "filing_history": "/company/00445790/filing-history",
        "officers": "/company/00445790/officers",
        "exemptions": "/company/00445790/exemptions"
      },
      "previous_company_names": [
        {
          "ceased_on": "1983-08-25",
          "effective_from": "1947-11-27",
          "name": "TESCO STORES (HOLDINGS) PUBLIC LIMITED COMPANY"
        }
      ],
      "registered_office_address": {
        "address_line_1": "Tesco House, Shire Park",
        "address_line_2": "Kestrel Way",
        "country": "United Kingdom",
        "locality": "Welwyn Garden City",
        "postal_code": "AL7 1GA"
      },
      "registered_office_is_in_dispute": false,
      "sic_codes": [
        "47110"
      ],
      "type": "plc",
      "undeliverable_registered_office_address": false,
      "has_super_secure_pscs": false
    }
  }
}