VATSIM PTD Documentation

Table of contents

How to issue a certification

certification

How to add additional instructors

ins

API

Read-only public API

Public endpoints are available for pulling ATOs, Instructors and Certifications data in JSON, XML or CSV formats

ATOs

Example:

http://ptd.vatsim.net/api/atos.json  #=> returns active ATOs listing in JSON format
http://ptd.vatsim.net/api/atos.xml   #=> returns active ATOs listing in XML format
http://ptd.vatsim.net/api/atos.csv   #=> returns active ATOs listing in CSV format
http://ptd.vatsim.net/atos           #=> returns active ATOs listing as HTML (part of the web frontend)

Instructors

Example:

http://ptd.vatsim.net/api/instructors.json  #=> returns instructors listing in JSON format
http://ptd.vatsim.net/api/instructors.xml   #=> returns instructors listing in XML format
http://ptd.vatsim.net/api/instructors.csv   #=> returns instructors listing in CSV format
http://ptd.vatsim.net/instructors           #=> returns instructors listing as HTML (part of the web frontend)

Certifications

Example:

http://ptd.vatsim.net/api/certifications.json  #=> returns certifications listing in JSON format
http://ptd.vatsim.net/api/certifications.xml   #=> returns certifications listing in XML format
http://ptd.vatsim.net/certifications           #=> returns certifications listing as HTML (part of the web frontend)

Caching

All read-only APIs are rebuilt on a 12 hours cache

Authenitcated certifications API

The PTD application provides an API for programmatically issuing pilot rating certifications. You can hook this to your own ATO application in order to authomate the process of issuing pilot ratings and to avoid the manual labour of using the backend web interface.

In order to create an pilot certification, you send an HTTP POST request to http://ptd.vatsim.net/certifications with the JSON details of the new certification and with your ATO API key (sent as a HEADER along with the request).

The following parameters need to be sent with the request:

The API key for your ATO will be provided to you by the PTD staff.

Example:

# The following request will create a P2 rating certification for VATSIM user with cid 1175035
# issued from instructor with the VATSIM cid of 1111111. The ATO issuing the certification will
# be identified and included based on the supplied API key.

curl -X POST -H "Content-Type: application/json" -d '{"cid": "1175035","instructor":"1111111", "rating":"2"}' http://ptd.vatsim.net/certifications -H 'Authorization: Token token="your-ato-api-key"'

Notes:

Instructor accounts

User Permissions

Superadmin

can :manage, :all
cannot :create, Trainee
cannot :destroy, [Trainee, Ato, User]

Admin

can :read, :all
can :history, :all
can :export, :all

can :manage, [ApiKey, Ato, User, Trainee, Certificate, Certification]
cannot :destroy, [Ato, User, Trainee, Certification]
cannot :create, Trainee
cannot :export, Trainee

CFI

can :read, :all
cannot :read, ApiKey

can :history, [Ato, Certificate, Certification]
can :create, Certification
can :edit, Certification, :ato => {id: user.ato.id}
can :create, User, :ato_id => user.ato_id

Instructor

can :read, :all
cannot :read, ApiKey

can :history, [Ato, Certificate, Certification]
can :create, Certification
can :edit, Certification, :ato => {id: user.ato.id}