Finnhub-API icon indicating copy to clipboard operation
Finnhub-API copied to clipboard

Invalid IPO Date Format for Sandbox Company Profile(+v2) Response

Open nhmood opened this issue 4 years ago • 1 comments

What is the issue ? Plz describe in details

Calling the Company Profile and Company Profile 2 endpoints with the Sandbox key returns invalid data in the "ipo" field causing the clients to fail on parsing.

CompanyProfile Sandbox Response

{
                  :address => "sheriff Guadalupe's uncover Lorrie's",
                     :city => "oiliness",
                  :country => "certify",
                 :currency => "Camemberts",
                    :cusip => "ikons",
              :description => "dehumidifies Anatolian Lents splints barks minister's Yaqui ls hurry's snaking plummest Bayes probes scavengers Biggles brier sesame bootblack's republic's Polaroid neatness handy rubrics upswings Cornwall's Caleb's suspensions convictions refractory Phaethon's recoverable newborns privation enigmas egoists gutsiest dyers agent coached mechanize irreversible casing Spirograph fascinations choppiness's tranquility's rookie's groupings snout peroxide's Nouakchott's rowboat Antonius collegian's dehydration typefaces retrofit immaculately foci Malabar Lowery Sunbeam gamekeeper astrophysicist's plunk giblet's research's red's assaulter slashes unloose McIntyre's stodginess's oodles's Camoens gripes Windex's housecleaning's clayey etiology peerages pickle's rodent's suspect's encrusted Boethius whip's maxes seabeds custard Vorster suffragists pectin's coequal's tarmacked hereafter hobble's westbound outfielder Israeli vaporized wallpaper parsec's rope's trudged uncouth succulent roosted open linger microfilm defensive's interference's Buñuel dopy abscessing mildness's Madelyn's fans turnkeys goblet Richards objectivity doltish wrestler Alexander's cider's swapping Alpo's poetic morasses adventuresome enlistee's sassafrases convincing clowned tirade's Moravian airdrops wranglers gadding chow's relevancy's ATM's braining agencies hose's paralleled kickstands successful contours warning's Colombian's Murray's bridge's portraiture judgeship's smocking towhead's tile's advertisements Stacy's Ra's slitting riffing literature finishing parity trial circumventing Ainu allegory's Triassic's dude's Furtwängler caulkings",
            :employeeTotal => "pinstripes",
                 :exchange => "Cecilia sourness's righteousness dowdiest downturns",
          :finnhubIndustry => "preoccupy",
                   :ggroup => "zircons revenging hiker's enlists",
                     :gind => "swag dears Aimee's crested quarterfinal's",
                  :gsector => "mortals prerecorded",
                  :gsubind => "suppurated sectionals subsumes falsehoods Schwinger",
                      :ipo => "bacterium's",
                     :isin => "disentangles",
                     :logo => "Dwight",
     :marketCapitalization => 4949047.5,
                    :naics => "unable financier's Medicare",
    :naicsNationalIndustry => "finder whitewash shoeshine clearinghouses Carboloy's nimbus's gear's hair's impolitic",
              :naicsSector => "tarmacked",
           :naicsSubsector => "bedeviled coldness dethronement anytime declaration",
                     :name => "armorer's satire's",
                    :phone => "Reagan",
                    :sedol => "exacerbating",
         :shareOutstanding => 42756.34,
                    :state => "gynecologists",
                   :ticker => "AAPL",
                   :weburl => "subpoenaed"
}

CompanyProfile2 Sandbox Response

{
                 :country => "blob",
                :currency => "lodge",
                :exchange => "underselling Sunnyvale gradation's leitmotif preponderances",
         :finnhubIndustry => "Christs",
                     :ipo => "squalider",
                    :logo => "reproofs",
    :marketCapitalization => 4949047.5,
                    :name => "awesome blobbed",
                   :phone => "sirocco's",
        :shareOutstanding => 42756.34,
                  :ticker => "AAPL",
                  :weburl => "modulation's"
}

How to reproduce the error ?

Call the CompanyProfile or CompanyProfile2 endpoints with a Sandbox token. The sample ruby code below will fail using the sandbox with the date parsing error.

#!/usr/bin/env ruby

require 'bundler/setup'
require 'finnhub_ruby'

API_KEY = "sandbox_but8pi748v6uea8aqcq0"

FinnhubRuby.configure do |config|
  config.api_key['token'] = API_KEY
end

@client = FinnhubRuby::DefaultApi.new
begin
  @client.company_profile({symbol: "AAPL"})
rescue StandardError => e
  puts e.inspect
  puts e.backtrace
end

begin
  @client.company_profile2({symbol: "AAPL"})
rescue StandardError => e
  puts e.inspect
  puts e.backtrace

end

What is the expected result and why do you think it's the correct result ?

The "ipo" is expected to be a DateTime or Date format, however, in both responses, it is appearing as a random string as seen in the responses above. The field returns in the YYYY-MM-DD format in the non-sandbox response such that the handlers in the client can parse it correctly.

nhmood avatar Nov 22 '20 21:11 nhmood

Hi,

Thank you for the feedback. This issue will be fixed within this week.

Our apology for the inconvenience.

finnhubio avatar Nov 23 '20 16:11 finnhubio