Chilkat Online Tools

DataFlex / Broker API / Announcements

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Set ComBasicAuth Of hoHttp To True
    Set ComLogin Of hoHttp To "{{api_key}}"
    Set ComPassword Of hoHttp To "{{api_secret}}"

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "ca_types" "dividend,merger,spinoff,split" To iSuccess
    Get ComUpdateString Of hoQueryParams "since" "2021-12-01" To iSuccess
    Get ComUpdateString Of hoQueryParams "until" "2021-12-17" To iSuccess

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://domain.com/v1/corporate_actions/announcements" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -G -d "ca_types=dividend,merger,spinoff,split"
	-d "since=2021-12-01"
	-d "until=2021-12-17"
	-u '{{api_key}}:{{api_secret}}'
https://domain.com/v1/corporate_actions/announcements

Postman Collection Item JSON

{
  "name": "Announcements",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{HOST}}/v1/corporate_actions/announcements?ca_types=dividend,merger,spinoff,split&since=2021-12-01&until=2021-12-17",
      "host": [
        "{{HOST}}"
      ],
      "path": [
        "v1",
        "corporate_actions",
        "announcements"
      ],
      "query": [
        {
          "key": "ca_types",
          "value": "dividend,merger,spinoff,split",
          "description": "A comma-delimited list of ENUM.CorporateActionType values"
        },
        {
          "key": "since",
          "value": "2021-12-01",
          "description": "The start (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days."
        },
        {
          "key": "until",
          "value": "2021-12-17",
          "description": "The end (inclusive) of the date range when searching corporate action announcements. This should follow the YYYY-MM-DD format. The date range is limited to 90 days."
        },
        {
          "key": "symbol",
          "value": "",
          "description": "The symbol of the company initiating the announcement.",
          "disabled": true
        },
        {
          "key": "cusip",
          "value": "",
          "description": "The CUSIP of the company initiating the announcement.",
          "disabled": true
        },
        {
          "key": "date_type",
          "value": "",
          "description": "ENUM.DateType. Potential values are declaration_date, ex_date, record_date, or payable_date",
          "disabled": true
        }
      ]
    }
  },
  "response": [
  ]
}