[Breaking Change] Connect API Flight Plan Format

Hey @api,

In version 22.1, there is a breaking change to how flight plans are returned in both the v1 and v2 APIs. Please see here for the updated format - this is returned as a JSON string.

We apologise for the lack of prior notice for this change, but hope this will mean you can do some cooler stuff with flight plans now. If you have any questions, please feel free to let us know and we’ll help you out where we can.

Cheers,
Kai

10 Likes

Hello @KaiM

Is this API Update able to take flight hours from each of them?

Sorry, I don’t know what you mean. What data do you need?

Can we request Flight Time Data after Flying?

This post is about a breaking change to the Connect API, but there’s an update to the Public REST API coming soon for that 😉

Ooooh, If you want to tell, where can I request Flight Time Data after Flying? can I request it on Infinite Flight Email?

It will come to the API in a future update, but to see it for your own purposes just go to the logbook page from the left hand side of the Home Screen in the app.

1 Like

Ok, Thanks for the answer Kai! 😉

@KaiM

Thanks for the update. I’m going to look into what this means for the v2 API this weekend so I can update ifc2 and the v2 docs I wrote.

I’m sure I’ll answer my questions just by looking at the manifest and experimenting but I’ll ask anyway:

  1. Does this change in any way change the actual state names for the various flight plan states in the v2 API? i.e.:
aircraft/0/flightplan
aircraft/0/flightplan/coordinates
aircraft/0/flightplan/eta_dest
aircraft/0/flightplan/eta_next
aircraft/0/flightplan/full_info
aircraft/0/flightplan/last_update_time
aircraft/0/flightplan/next_waypoint_index
aircraft/0/flightplan/next_waypoint_name
aircraft/0/flightplan/route
  1. Assuming the state names are all the same, does it mean only aircraft/0/flightplan returns a JSON string? If so, have the other states changed the format/data returned? What about aircraft/0/flightplan/full_info?

  2. I assume this now implies that for any app using the v2 API it will now be needed to check the version of IF and handle flight plan states accordingly?

Thanks!

All state names have remained the same as far as I know. As for the actual content of states, the best way to check those is through experimentation. And yes, I would absolutely check your app for issues.

1 Like

Following on my own question, it looks like for the v2 API only aircraft/0/flightplan/full_info is impacted. Is that right? From my quick tests, it looks like the other flight plans states aren’t JSON and haven’t changed.

Thanks.

That sounds about right

1 Like

I’ve been playing with this feature further in the v2 Connect API via aircraft/0/flightplan/full_info and have hit a challenge.

I have set up a flight from KSFO to KSAN and entered a flight plan. While still sitting on the runway before takeoff I fetch the flight plan and get back results that include the following entry:

"ETEToNext":NaN

But, this can’t be parsed to JSON using JSON.parse() in JavaScript:

SyntaxError: Unexpected token N in JSON at position ...

If I replace the value with null or 0 that works fine. I assume that because the speed of the aircraft is zero somewhere in generating the JSON a distance is divided by speed to generate this value and this leads to a divide-by-zero which generates the NaN. But, wouldn’t it be better to return null rather than NaN so that the string can be parsed to JSON without first doing some form of transformation on the string itself? Right now, I need to search and replace in the string to remove the NaN before using the string.

Also, what’s odd is that I would have expected ETEToDestination would also be NaN by the same logic but it isn’t:

"ETEToDestination":5.197206E+09

So, it seems this is inconsistent as well unless I am not understanding what’s going on.

Anyway, sharing this in case it is of value.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.