API not accepting my key(?)

Discussion in 'Other technical not related to ADSBx Feeding' started by Qetesh, Jun 10, 2019.

  1. Qetesh

    Qetesh New Member

    Hi!
    I recently got an API-key and now finally got the time to try to access the API using python. It does work - until I send the api-auth header. As soon as I send that, all I get back is
    {'ERR': 'UNRECOGNIZED API CALL'}
    If I don't send the api-auth header it works fine - of course I get the "You need a key" message though.

    I traced the packages sent to make sure there's no other differences and I can say that both requests are exactly the same besides the api-auth header.

    Even sending a wrong api key gets me results. The error message only appears when sending the correct key.

    I am confused...
     
  2. James

    James Guest

    {'ERR': 'UNRECOGNIZED API CALL'}

    Self explanatory ... it's accepting your key but your url format is fail ....

    Also known as ..

    You're doing it wrong.
     
  3. Qetesh

    Qetesh New Member

    OK, I found the error... I indeed forgot a part of the URL. But:

    Why does the exact same call without the api key work then? Even the exact same call with a wrong api key gives me the default result as I already wrote. Shouldn't both calls give me the error message? That's what threw me off and made me not even question the format of the call. In the sake of user friendliness a wrong call without api key should give the same error message and not pretend to be giving out valid data.
    Besides that please keep in mind that not everyone here is as knowing about the topic as you and being a little less rude to new people might help, too.

    Anyway, thank you. It works now.
     
  4. James

    James Guest

    Saying you're doing it wrong is rude? hmmm ..... don't melt snowflake.

    Call without API key does not work.

    It replies with below. Read it better, less mistakes are made when you take time to check your work.

    {"ac":[{"postime":"1561041129973","icao":"AD5B00","reg":"CONTACTADSBX","type":"787","wtc":"1","spdtyp":"1","spd":"999","altt":"0","alt":"35000","galt":"35000","talt":"69000","lat":"0","lon":"0","vsit":"0","vsi":"0","trkh":"0","ttrk":"180","trak":"50","sqk":"7600","call":"NEEDFEED","gnd":"0","trt":"2","pos":"1","mlat":"0","tisb":"0","sat":"0","opicao":"ADSBX","cou":"USA","mil":"0"}],"msg":"You need a key. Get a feeder or use pay API. https://rapidapi.com/adsbx/api/adsbexchange-com","total":"1","ctime":"1561041129973"}