Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.
PLEASE READ - Webmaster Support Forum
This forum will be retired in the near future. Please direct all queries to our dedicated GitHub support page https://github.com/vatsimnetwork/developer-info/discussions 
Here you can find documentation on our services and we are continuing to migrate pertinent information into the Wiki pages https://github.com/vatsimnetwork/developer-info/wiki

API Documentation?


Jeff Thomas
 Share

Recommended Posts

Jeff Thomas
Posted
Posted

Is there a website on VATSIM that docomeents its available APIs?

 

I've read these threads and it stated sometime 2016 a new API was being generated, but I can't seem to find an update?

 

Thanks,

Jeff Thomas

VP-IT

https://joinava.org

Link to comment
Share on other sites

Kieran Samuel Cross
Posted
Posted
Is there a website on VATSIM that docomeents its available APIs?

 

I've read these threads and it stated sometime 2016 a new API was being generated, but I can't seem to find an update?

 

Thanks,

 

 

By new API, I presume you'd be referring to CERT 2.0, which afaik has not yet been finished by Kieran Harden.

 

Many Regions/Divisions run their own API service (such as VATEUD), you could potentially hook onto those.

 

 

If you're looking for user data, without them logging in (SSO provides an amazing amount of data you could use), the following URLs could be of use:

 

  1. Certificate Status: https://cert.vatsim.net/vatsimnet/idstatus.php?cid=1298134
  2. Certificate Rating: https://cert.vatsim.net/vatsimnet/idstatusrat.php?cid=1298134
  3. Certificate Pilot Rating: https://cert.vatsim.net/vatsimnet/idstatusprat.php?cid=1298134
  4. Certificate Status (Int): https://cert.vatsim.net/vatsimnet/idstatusint.php?cid=1298134

 

 

 

If you're looking for data about who's online, this URL will be of use to you:

  1. VATSIM Status: http://status.vatsim.net

 

You'll want to randomly select data from the set of

url0=

values you find. You should note that you can only query this every two minutes minimum, according to the VATSIM regs. This updates every two minutes, so it's pointless to do it any quicker anyway.

 

 

You can find the current METARs for an ICAO (or partial ICAO) using this URL:

  1. VATSIM Metars: http://metar.vatsim.net/metar.php?id=EGGW

 

You'll notice, with the above URL, if you don't provide a full URL, you'll get results for the rest of that partial URL. This can be handy for some things, let's say you want to pull METARs for the whole of an FIR.

 

 

 

 

 

If none of this helps, I'd suggest waiting for CERT 2.0 to be released; whenever than happens.

Kind Regards,

Kieran Cross,

 

28.png

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

I made a short list, but Kieran above has beaten me to it with a lot more detail. Just to add further things not mentioned:

 

  • Full member data for all division/region members, plus rating change, is available for regions/divisions only (details from VP Web)
  • Docomeentation for the SSO authentication system is in the SSO forum
  • Pilot rating integration (public and private APIs, mostly of interest to pilot ATOs) at ptd.vatsim.net

Link to comment
Share on other sites

Kieran Samuel Cross
Posted
Posted (edited)
I made a short list, but Kieran above has beaten me to it with a lot more detail. Just to add further things not mentioned:

 

  • Full member data for all division/region members, plus rating change, is available for regions/divisions only (details from VP Web)
  • Docomeentation for the SSO authentication system is in the SSO forum
  • Pilot rating integration (public and private APIs, mostly of interest to pilot ATOs) at ptd.vatsim.net

 

Aaah Jamie,

 

By the looks of it, you might need to get some practice at typing faster .

 

Those are some very valuable points. Would it be a good idea, if yourself or VP made a stickied post with this kind of information in - it'd be very useful for those who are not familiar with what it out there and available to use.

Edited by Guest

Kind Regards,

Kieran Cross,

 

28.png

Link to comment
Share on other sites

Jeff Thomas
Posted
Posted

Thanks guys.

 

So I guess the answer to my first question is no and the answer to my second question is the new API has not been released.

 

Thanks for links again, but they still dump XML with no JSON option which is not viable for my needs at this time.

 

 

FYI if you're interested, I've created a Gitlab project to start docomeenting these examples and perhaps provide a wiki source for some of the common functions that are outlined in these pages.

 

You can find it here: https://gitlab.com/dev-joinava-org/vatsim-api

 

Not much in it yet. I started it a long time ago, when I think I asked this question last time

Jeff Thomas

VP-IT

https://joinava.org

Link to comment
Share on other sites

Kieran Samuel Cross
Posted
Posted

Thanks for links again, but they still dump XML with no JSON option which is not viable for my needs at this time.

 

XML can be converted to JSON, and accessed in the same way.

Kind Regards,

Kieran Cross,

 

28.png

Link to comment
Share on other sites

Jeff Thomas
Posted
Posted

Yeah, but best practice is to have the service deliver in the format you require thus saving you the overhead of doing the conversion, handling errors, and bloating your code with a conversion library.

Jeff Thomas

VP-IT

https://joinava.org

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
Pilot rating integration (public and private APIs, mostly of interest to pilot ATOs) at ptd.vatsim.net

 

Is there a link to this? I'm interested in what is available.

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

The API docomeentation for the pilot training is available on the Help page at ptd.vatsim.net.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
The API docomeentation for the pilot training is available on the Help page at ptd.vatsim.net.

 

Awesome - that looks great! Who do I reach out to for an API key?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

The authenticated part of the API is to allow for authorised training organisations (ATOs) to integrate with the system and issue pilot ratings etc. API keys are available by logging into the control panel on ptd.vatsim.net.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
The authenticated part of the API is to allow for authorised training organisations (ATOs) to integrate with the system and issue pilot ratings etc. API keys are available by logging into the control panel on ptd.vatsim.net.

 

Thanks! I'll reach out to our CFI to get me added. Is there a sandbox for me to test the integration?

 

Cheers!

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

Unfortunately I don't think there's a sandbox system. It's a simple API though so it shouldn't be too much of a problem. The way I'd suggest would be to make a quick page that logs the request, and checks that everything is as specified in the docomeentation, then use that as your test system to make sure that nothing is going wrong. The most obvious thing to watch out for is to check the instructor is an approved instructor on the ATO account.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted

Out of curiosity, why does the list of certifications split the instructor name and CID, but not the pilot's?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

Good question; I'm afraid I can't help with this one. I don't suppose there was any particular reason. Unless the original developer happens to pop in here with an answer, this will have to remain a mystery.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted

I'm getting a 406 error.

 

Can you revoke a cert if I eventually get this working?

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Jamie Fox 811029
Posted
Posted

Revoking a certification would have to be done manually, so this is better to be avoided if at all possible.

 

Could you post the relevant snippet of code that you're having problems with? Do you already have the read-only parts of the API working?

Link to comment
Share on other sites

Svilen Vassilev
Posted
Posted
Good question; I'm afraid I can't help with this one. I don't suppose there was any particular reason. Unless the original developer happens to pop in here with an answer, this will have to remain a mystery.

 

The original developer has no clue either and also no recollections of this code except that it was written long ago, in a rush and while being in a pretty bad mood He wouldn't mind adding the extra fields though if you're still deploying from the original git repository (otherwise we can coordinate).

 

Luke, regarding your 406 error: I have no server access so can't look at any logs and I'm not sure exactly what you're doing, but if you're trying to post some JSON, are you sending the correct MIME type headers?

C1/P2 | vaccbih.info

Link to comment
Share on other sites

Luke Kolin
Posted
Posted
The original developer has no clue either and also no recollections of this code except that it was written long ago, in a rush and while being in a pretty bad mood He wouldn't mind adding the extra fields though if you're still deploying from the original git repository (otherwise we can coordinate).

 

It's not critical for me, but it would probably help the next person.

 

Luke, regarding your 406 error: I have no server access so can't look at any logs and I'm not sure exactly what you're doing, but if you're trying to post some JSON, are you sending the correct MIME type headers?

 

Wasn't setting the header and the numeric fields weren't being sent as strings (?) but after fixing that I'm still getting the 406. It would be nice to have either a test environment or a setting to let one validate the input without writing to CERT; failing that I'll just write a JUnit test case and keep working until it succeeds. Then someone will need to revoke my P9.

 

Cheers!

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Luke Kolin
Posted
Posted

I kept getting a 406 error code. I had to add an accept header for application/json (which the docomeentation does NOT mention) and now I'm getting a 422. This is the JSON I'm posting:

 

{"instructor":"931991","rating":"9","cid":"837789"}

 

Cheers!

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

Svilen Vassilev
Posted
Posted
I kept getting a 406 error code. I had to add an accept header for application/json (which the docomeentation does NOT mention) and now I'm getting a 422. This is the JSON I'm posting:

 

{"instructor":"931991","rating":"9","cid":"837789"}

 

Cheers!

 

From the notes (https://ptd.vatsim.net/help):

 

- Use a header specifying the MIME type of the data being sent: in our case application/json.

 

I'm sorry I can't help concretely, as I have no server/log access, but:

 

a) verify the syntax of the authorization header

b) try with a raw command line curl call first until you get it going, before implementing programatically

c) do you get any json or plain text response at all?

 

The only thing I could do is test against my local dev copy, which works but that's not very helpful, I know.

C1/P2 | vaccbih.info

Link to comment
Share on other sites

Luke Kolin
Posted
Posted

I think I have it working. This was pretty much my fault - I extended a base cl[Mod - Happy Thoughts] that was already doing POSTs to Facebook's API but it was doing a few things behind the scenes that didn't play nicely with what VATSIM expected.

 

Thanks everyone.

 

Luke

... I spawn hundreds of children a day. They are daemons because they are easier to kill. The first four remain stubbornly alive despite my (and their) best efforts.

... Normal in my household makes you a member of a visible minority.

Link to comment
Share on other sites

 Share