Webhooks API

Webhooks can be setup on FSHub user accounts in addition to airline groups and is a great way of "pushing" data (using HTTP POST requests) to external websites and services in real-time when an action occurs on your account or for a virtual airline pilot's account.

FsHub has several webhook events that you can set-up on your account or for virtual airlines, this page details information about this feature.

Webhook events

Our platform will automatically attempt to send data to your webhook URL in real-time, if however your server(s) fail to respond with a successful HTTP response code, our platform will re-attempt delivery of the data every 4 minutes for a maximum number of 10 tries, after this time (your service failed to response for up to a total of 40 minutes), our platform will temporarily disable the affected webhook and email you to let you know that you may have a problem with your server.

Pilot profile updates (profile.updated)

This event is fired when a pilot edits' their profile information, the web hook payload contains a JSON object contain their new profile information.

An example of the hook content is as follows:

{
  "_variant": "User",
  "_type": "profile.updated",
  "_sent": 1510769757,
  "_data": {
    "id": 2,
    "name": "Bobby Allen",
    "email": "bobbyallen.uk@gmail.com",
    "profile": {
      "avatar_url": null,
      "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
    },
    "locations": {
      "base": "EGSS",
      "locale": "LOWS"
    },
    "handles": {
      "website": null,
      "twitter": "@allebb87",
      "facebook": "",
      "vatsim": "1167426",
      "ivao": "458562"
    },
    "timezone": "Europe\/London",
    "country": "GB"
  }
}
				

Flight departed (flight.departed)

The take-off information is sent as a JSON object to the endpoint consisting of the various types of information such as the pilot details, departure airport, aircraft type, wind speeds etc.

An example of the hook content is as follows:

{
  "_variant": "User",
  "_type": "flight.departed",
  "_sent": 1510770359,
  "_data": {
    "id": 163249,
    "user": {
      "id": 2,
      "name": "Bobby Allen",
      "email": "bobbyallen.uk@gmail.com",
      "profile": {
        "avatar_url": null,
        "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
      },
      "locations": {
        "base": "EGSS",
        "locale": "EGGW"
      },
      "handles": {
        "website": null,
        "twitter": "@allebb87",
        "facebook": "",
        "vatsim": "1167426",
        "ivao": "458562"
      },
      "timezone": "Europe\/London",
      "country": "GB"
    },
    "aircraft": {
      "icao": null,
      "name": "CARENADO PC12 1",
      "type": "Pilatus"
    },
    "airline": null,
    "airport": {
      "icao": "EGGW",
      "iata": "LTN",
      "name": "Luton",
      "locale": {
        "city": "London",
        "state": null,
        "country": "United Kingdom",
        "gps": {
          "lat": 51.874722,
          "lng": -0.368333
        }
      }
    },
    "pitch": -5,
    "bank": 0,
    "speed_tas": 97,
    "heading": {
      "true": 254,
      "magnetic": 256
    },
    "wind": {
      "speed": 10,
      "direction": 300
    },
    "weight": {
      "fuel": 1231,
      "zfw": 2622
    },
    "gps": {
      "lat": 51.875888,
      "lng": -0.361144
    },
    "departure_at": {
      "date": "2017-11-15 18:25:56.000000",
      "timezone_type": 3,
      "timezone": "UTC"
    }
  }
}
				

Flight arrived (flight.arrived)

The landing information is sent as a JSON object to the endpoint consisting of the various types of landing information such as the pilot details, arrival airport, aircraft type, landing rate, fuel remaining etc.

An example of the hook content is as follows:

{
  "_variant": "User",
  "_type": "flight.arrived",
  "_sent": 1510770840,
  "_data": {
    "id": 330913,
    "user": {
      "id": 2,
      "name": "Bobby Allen",
      "email": "bobbyallen.uk@gmail.com",
      "profile": {
        "avatar_url": null,
        "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
      },
      "locations": {
        "base": "EGSS",
        "locale": "EGGW"
      },
      "handles": {
        "website": null,
        "twitter": "@allebb87",
        "facebook": "",
        "vatsim": "1167426",
        "ivao": "458562"
      },
      "timezone": "Europe\/London",
      "country": "GB"
    },
    "aircraft": {
      "icao": null,
      "name": "CARENADO PC12 1",
      "type": "Pilatus"
    },
    "airline": null,
    "airport": {
      "icao": "EGGW",
      "iata": "LTN",
      "name": "Luton",
      "locale": {
        "city": "London",
        "state": null,
        "country": "United Kingdom",
        "gps": {
          "lat": 51.874722,
          "lng": -0.368333
        }
      }
    },
    "landing_rate": -32,
    "pitch": -1,
    "bank": 0,
    "speed_tas": 71,
    "heading": {
      "true": 254,
      "magnetic": 256
    },
    "wind": {
      "speed": 10,
      "direction": 302
    },
    "weight": {
      "fuel": 1201,
      "zfw": 2622
    },
    "gps": {
      "lat": 51.875926,
      "lng": -0.36063100000000003
    },
    "arrival_at": {
      "date": "2017-11-15 18:33:58.000000",
      "timezone_type": 3,
      "timezone": "UTC"
    }
  }
}
				

Flight completed (flight.completed)

Similar to that of the above two hook types, this hook content provides the overall flight details as well as the arrival and departure information as a JSON object to the endpoint.

An example of the hook content is as follows:

{
  "_variant": "User",
  "_type": "flight.completed",
  "_sent": 1510770843,
  "_data": {
    "id": 325510,
    "user": {
      "id": 2,
      "name": "Bobby Allen",
      "email": "bobbyallen.uk@gmail.com",
      "profile": {
        "avatar_url": null,
        "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
      },
      "locations": {
        "base": "EGSS",
        "locale": "EGGW"
      },
      "handles": {
        "website": null,
        "twitter": "@allebb87",
        "facebook": "",
        "vatsim": "1167426",
        "ivao": "458562"
      },
      "timezone": "Europe\/London",
      "country": "GB"
    },
    "aircraft": {
      "icao": null,
      "name": "CARENADO PC12 1",
      "type": "Pilatus"
    },
    "airline": null,
    "departure": {
      "id": 163249,
      "user": {
        "id": 2,
        "name": "Bobby Allen",
        "email": "bobbyallen.uk@gmail.com",
        "profile": {
          "avatar_url": null,
          "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
        },
        "locations": {
          "base": "EGSS",
          "locale": "EGGW"
        },
        "handles": {
          "website": null,
          "twitter": "@allebb87",
          "facebook": "",
          "vatsim": "1167426",
          "ivao": "458562"
        },
        "timezone": "Europe\/London",
        "country": "GB"
      },
      "aircraft": {
        "icao": null,
        "name": "CARENADO PC12 1",
        "type": "Pilatus"
      },
      "airline": null,
      "airport": {
        "icao": "EGGW",
        "iata": "LTN",
        "name": "Luton",
        "locale": {
          "city": "London",
          "state": null,
          "country": "United Kingdom",
          "gps": {
            "lat": 51.874722,
            "lng": -0.368333
          }
        }
      },
      "pitch": -5,
      "bank": 0,
      "speed_tas": 97,
      "heading": {
        "true": 254,
        "magnetic": 256
      },
      "wind": {
        "speed": 10,
        "direction": 300
      },
      "weight": {
        "fuel": 1231,
        "zfw": 2622
      },
      "gps": {
        "lat": 51.875888,
        "lng": -0.361144
      },
      "departure_at": {
        "date": "2017-11-15 18:25:56.000000",
        "timezone_type": 3,
        "timezone": "UTC"
      }
    },
    "arrival": {
      "id": 330913,
      "user": {
        "id": 2,
        "name": "Bobby Allen",
        "email": "bobbyallen.uk@gmail.com",
        "profile": {
          "avatar_url": null,
          "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
        },
        "locations": {
          "base": "EGSS",
          "locale": "EGGW"
        },
        "handles": {
          "website": null,
          "twitter": "@allebb87",
          "facebook": "",
          "vatsim": "1167426",
          "ivao": "458562"
        },
        "timezone": "Europe\/London",
        "country": "GB"
      },
      "aircraft": {
        "icao": null,
        "name": "CARENADO PC12 1",
        "type": "Pilatus"
      },
      "airline": null,
      "airport": {
        "icao": "EGGW",
        "iata": "LTN",
        "name": "Luton",
        "locale": {
          "city": "London",
          "state": null,
          "country": "United Kingdom",
          "gps": {
            "lat": 51.874722,
            "lng": -0.368333
          }
        }
      },
      "landing_rate": -32,
      "pitch": -1,
      "bank": 0,
      "speed_tas": 71,
      "heading": {
        "true": 254,
        "magnetic": 256
      },
      "wind": {
        "speed": 10,
        "direction": 302
      },
      "weight": {
        "fuel": 1201,
        "zfw": 2622
      },
      "gps": {
        "lat": 51.875926,
        "lng": -0.36063100000000003
      },
      "arrival_at": {
        "date": "2017-11-15 18:33:58.000000",
        "timezone_type": 3,
        "timezone": "UTC"
      }
    },
    "distance": {
      "nm": 19,
      "km": 36
    },
    "max": {
      "alt": 2874,
      "spd": 200
    },
    "fuel_burnt": 30,
    "remarks":null,
    "tags":null
  }
}
				

Flight updated (flight.updated)

This hook is simular to the profile.updated hook, it sends the flight information when a user updates a flight report (typically when they add flight remarks and/or tags).

An example of the hook content is as follows:

{
  "_variant": "User",
  "_type": "flight.updated",
  "_sent": 1510771067,
  "_data": {
    "id": 325510,
    "user": {
      "id": 2,
      "name": "Bobby Allen",
      "email": "bobbyallen.uk@gmail.com",
      "profile": {
        "avatar_url": null,
        "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
      },
      "locations": {
        "base": "EGSS",
        "locale": "EGGW"
      },
      "handles": {
        "website": null,
        "twitter": "@allebb87",
        "facebook": "",
        "vatsim": "1167426",
        "ivao": "458562"
      },
      "timezone": "Europe\/London",
      "country": "GB"
    },
    "aircraft": {
      "icao": null,
      "name": "CARENADO PC12 1",
      "type": "Pilatus"
    },
    "airline": null,
    "departure": {
      "id": 163249,
      "user": {
        "id": 2,
        "name": "Bobby Allen",
        "email": "bobbyallen.uk@gmail.com",
        "profile": {
          "avatar_url": null,
          "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
        },
        "locations": {
          "base": "EGSS",
          "locale": "EGGW"
        },
        "handles": {
          "website": null,
          "twitter": "@allebb87",
          "facebook": "",
          "vatsim": "1167426",
          "ivao": "458562"
        },
        "timezone": "Europe\/London",
        "country": "GB"
      },
      "aircraft": {
        "icao": null,
        "name": "CARENADO PC12 1",
        "type": "Pilatus"
      },
      "airline": null,
      "airport": {
        "icao": "EGGW",
        "iata": "LTN",
        "name": "Luton",
        "locale": {
          "city": "London",
          "state": null,
          "country": "United Kingdom",
          "gps": {
            "lat": 51.874722,
            "lng": -0.368333
          }
        }
      },
      "pitch": -5,
      "bank": 0,
      "speed_tas": 97,
      "heading": {
        "true": 254,
        "magnetic": 256
      },
      "wind": {
        "speed": 10,
        "direction": 300
      },
      "weight": {
        "fuel": 1231,
        "zfw": 2622
      },
      "gps": {
        "lat": 51.875888,
        "lng": -0.361144
      },
      "departure_at": {
        "date": "2017-11-15 18:25:56.000000",
        "timezone_type": 3,
        "timezone": "UTC"
      }
    },
    "arrival": {
      "id": 330913,
      "user": {
        "id": 2,
        "name": "Bobby Allen",
        "email": "bobbyallen.uk@gmail.com",
        "profile": {
          "avatar_url": null,
          "bio": "Developer of LRMLive and the LRM Client. Airbus A320 and GA virtual pilot!"
        },
        "locations": {
          "base": "EGSS",
          "locale": "EGGW"
        },
        "handles": {
          "website": null,
          "twitter": "@allebb87",
          "facebook": "",
          "vatsim": "1167426",
          "ivao": "458562"
        },
        "timezone": "Europe\/London",
        "country": "GB"
      },
      "aircraft": {
        "icao": null,
        "name": "CARENADO PC12 1",
        "type": "Pilatus"
      },
      "airline": null,
      "airport": {
        "icao": "EGGW",
        "iata": "LTN",
        "name": "Luton",
        "locale": {
          "city": "London",
          "state": null,
          "country": "United Kingdom",
          "gps": {
            "lat": 51.874722,
            "lng": -0.368333
          }
        }
      },
      "landing_rate": -32,
      "pitch": -1,
      "bank": 0,
      "speed_tas": 71,
      "heading": {
        "true": 254,
        "magnetic": 256
      },
      "wind": {
        "speed": 10,
        "direction": 302
      },
      "weight": {
        "fuel": 1201,
        "zfw": 2622
      },
      "gps": {
        "lat": 51.875926,
        "lng": -0.36063100000000003
      },
      "arrival_at": {
        "date": "2017-11-15 18:33:58.000000",
        "timezone_type": 3,
        "timezone": "UTC"
      }
    },
    "distance": {
      "nm": 19,
      "km": 36
    },
    "max": {
      "alt": 2874,
      "spd": 200
    },
    "fuel_burnt": 30,
    "remarks": "This was a quick test flight for purposes of generating some web hooks whilst documenting the platform.",
    "tags": "#testflight, #documentation"
  }
}