Jump to content


Photo

What is API?


  • This topic is locked This topic is locked
No replies to this topic

#1 Staff

Staff

    Advanced Member

  • Staff
  • PipPipPip
  • 4479 posts

Posted 27 June 2013 - 03:02 PM

What is an API?


AirVPN application programming interface (API) allows our customers to access and control their accounts, using custom written software.

If you need some other kind of API please feel free to write in our forums.



API Syntax
https://airvpn.org/api/?format=<format>&key=<your_api_key>&service=<service_name>&<service_params>
  • <format> (optional, default 'web') is the output format:
    • web : Displays result as web-site page. Useful to understand.
    • json : JSON format.
    • xml : XML format.
    • php : PHP, function serialize() and unserialize().
    • text : Plain text, key=value for each rows. Nested result grouped with .dot notation in key field.
  • <key> is your API key. Generate a key from settings page.
  • <service> is the service name, look below for additional reference.
Any service returns a 'result' field with 'ok' if successful or an error message.

Dates are always in UTC.
Dates that end with "_date" are the dates in the MySql standard format, yyyy-mm-dd hh24:mi:ss.
Dates that end with "_unix" are the dates in UNIX timestamp (integer).


Do not send more than 600 requests every 10 minutes or we will ban your IP address.

Services


 
Service: userinfo

Details about yourself, including connection details.

Params:
None

Output:
  • user
    • login (login name)
    • register_date (date of registration on our website)
    • register_unix (date of registration on our website)
    • premium (boolean, if premium or not)
    • expiration_unix (date of expiration)
    • expiration_date (date of expiration)
    • expiration_days (days to the expiration)
    • last_attempt_unix (date of last attempt to connect to a VPN server)
    • posts (posts in forum)
    • credits (account credit)
    • last_post (date of last post in forum)
    • last_visit_unix (date of last visit on website)
    • last_activity_unix (date of last activity on website)
    • connected (boolean, if connected or not)
  • connection (only if connected)
    • vpn_ip (local IP address assigned, 10.*)
    • exit_ip (exit IP)
    • entry_ip (entry IP)
    • server_name (server name)
    • server_country (server country name)
    • server_country_code (server country code, ISO)
    • server_continent (server continent)
    • server_location (server location)
    • server_bw (server bandwidth: 100 for 100 Mbit/s, 1000 for 1 Gbit/s)
    • bytes_read (read bytes in the current session)
    • bytes_write (written bytes in the current session)
    • connected_since_unix (date of start of the current connection)
    • connected_since_date (date of start of the current connection)
    • speed_read (read bytes per second)
    • speed_write (written bytes per second)
 
Service: notification

Send a message to yourself.
Choose in the notifications options, under Air -> API, if you want to see it in the web site and/or in an e-mail.
Useful to write to yourself an event that needs attention, for example from a script.

Params:
  • subject
  • body
Output:
None



 
Service: disconnect

Requests a disconnection.

Params:
None

Output:
None





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Servers online.Servers online.
Users: 2744 - BW: 8994 Mbit/s
Not connectedNot connected.
Your current IP: 54.204.67.26
Guest Access.