WILCO
  • 👩‍🎓User Manual
    • USER MANUAL
      • welcome page
        • create an account
        • login
          • login troubleshooting
        • logout
      • landing page
      • fleet dashboards
        • URL
        • fleet header
        • fleet
        • current alerts
        • map
      • aircraft timeline
        • overview
        • timeline header
          • calendar
          • warnings
          • show cleared
          • show hidden
        • tags
        • custom message
      • dashboards
        • overview
        • header
        • dashboard
        • parameters
          • search parameter
          • plot graph
          • trend chart
      • open a ticket
    • DESIGNER USER MANUAL
      • Manual post
        • copy text
        • upload file
          • CSV insertion
          • elasticsearch aggregation
      • Edit layouts
        • type of layouts
        • manage layouts and uplinks
        • create layout
          • report parser
          • web connector
        • IFT at Layout
      • Edit Fault codes
        • IFT at Fault Code
      • Edit parameters
        • IFT at Parameter
      • Edit Dashboards
        • create new dashboard
        • edit dashboard
        • Dashboards
          • Dashboard drawing tips
            • Illustrator
          • Dashboard rules
            • Libraries
            • Variables
            • Utils
            • Debugging the rules
            • Graphs
              • creation of the graph
              • Set the title of the graph
              • draw some zones
              • draw a serie (curve)
              • draw horizontal line
              • draw vertical line
              • draw circles
              • Example
            • WILCO.alertWarning
              • WILCO.alertInfo
            • WILCO.alertError
            • WILCO.api
            • WILCO.user
            • WILCO.getEventsForFwot
            • WILCO.getEventsForFwotMinMaxDate
            • WILCO.getSamplesForFwot
            • WILCO.getSamplesForFwotMinMaxDate
            • WILCO.getSampleTableForFwot
            • WILCO.getSamplesTableForFwotMinMaxDate
            • WILCO.getEventsStats
            • WILCO.dsv
            • WILCO.uplink
      • Edit Trends
        • create new trend
        • edit trend
        • Trends
          • Use the tags
          • Access to the surrounding values
      • Edit IFTs
        • edit IFT
        • create an IFT
        • IFT V2
          • moment
          • underscore
          • current Fwot
          • Samples
          • FW.api
          • FW.getWilcoUrls
          • FW.http
          • FW.getEvent
          • FW.getOtherEvent
          • FW.getEvents
          • FW.getFwot
          • FW.getFwots
          • FW.notify <deprecated>
          • FW.notifyWithTemplate <deprecated>
          • FW.email
          • FW.setFrom
          • FW.setTo
          • FW.setTitle
          • FW.setVisible
          • FW.setSeverity
          • FW.setComputedDate
          • FW.setStyle
          • FW.getSamples
          • FW.report
          • FW.reportInfo
          • FW.reportWarn
          • FW.reportFault
          • FW.reportError
          • FW.log
          • FW.updateProperties
          • FW.setFlightStatus
          • FW.setLoc
          • FW.uplink
          • FW.set
          • FW.updateSomeFwotProperty
          • FW.updateFwotProperty
          • FW.removeFwotProperty
          • FW.removeSomeFwotProperty
          • FW.tag
          • FW.untag
          • FW.postEvent
          • FW.reportFaultCode
          • FW.querySamples
          • FW.getRaw
          • FW.getBit
          • FW.csv
          • FW.machineLearningPredict
          • FW.webhook
          • FW.getPlugins()
          • FW.json
      • Show Uplinks
      • General Conf
        • Assets
          • Fwots
        • Configuration
          • Constants
          • Docs
          • Event tables
            • Tables
              • JSON structure
                • Title
                • filters
                • cols
                  • Fields of a column
                • Example
      • examples
        • flow of the data
        • use Constants
        • use Doc
        • use EventTable
        • use algorithm on trends
      • Code snippets
        • Get the last UPLINK message with filters
        • Automatically handle faultcodes according to a doc and a regex
        • Get the current airport
        • goto a page from a dashboard
        • get the samples and events over the 3 last legs
        • Webhooks: Get data from typeform and post it to ELK
        • Download a file from a SVG click
        • Clone a SVG template with D3
        • Cheat sheet
    • ADMIN USER MANUAL
      • General Conf
        • Access rights
          • API keys
          • Users
        • Assets
          • Airlines
          • Fwot types
          • Fwots
        • Configuration
          • App configs
            • UPLINK_ROUTING
            • SEND_MAIL
            • DO_UPLINK
            • UPLINK_PATH
            • MAX_DAYS_WITHOUT_EVENTS
            • ACARS_RECIPIENT
            • MAIL_TEMPLATE
            • USE_CURRENT_DATE
            • DO_UPLINK_AUTOMATIC_BLACKLIST
            • DO_UPLINK_MANUAL_BLACKLIST
            • UPLINK_EXPIRATION_MINUTES
          • Bookmarks
          • Constants
          • Docs
          • Event tables
          • Plugins
        • Swiss knife
      • Edit Plugins
        • Commit plugin
        • Deploy plugin
    • Q&A
  • 🔌Plugins
    • fw.ata49
      • Minimum requirements
      • Configuration
    • fw.fuelsave
      • Minimum requirements
      • Configuration
    • fw.opticooling
      • Minimum requirements
      • Configuration
    • fw.taxi
      • Minimum requirements
      • Configuration
    • fw.turnaround
Powered by GitBook
On this page

Was this helpful?

  1. User Manual
  2. DESIGNER USER MANUAL
  3. Edit Dashboards
  4. Dashboards
  5. Dashboard rules

WILCO.api

root of the APIV3 end-point

PreviousWILCO.alertErrorNextWILCO.user

Last updated 4 years ago

Was this helpful?

WILCO.api allows you to get, post, put, delete... on the server using the APIV3 endpoint. It always return promises and are async.

The credentials are injected according to the person that is logged in

#gets all the TECHLOG tagged events between 2 dates
try {
  const events = await WILCO.api.get(`events?tag=TECHLOG&from=${stats.timespan[0]}&to=${stats.timespan[1]}`);
} catch (e){}

APIV3 is a field that holds the URL root of the APIV3 end-point. APIV3 has the form: WILCO.APIV3: "https://<my--deployment>.flightwatching.com/fleet/apiv3/"

//definition of main calls
const get = await WILCO.api.get(url, options);
const post = await WILCO.api.post(url, data, options)
const put = await WILCO.api.put(url, data, options)
const delete = await WILCO.api.delete(url, data, options)

Options

  • params – {Object.<string|Object>} – Map of strings or objects which will be serialized with the paramSerializer and appended as GET parameters.

  • headers – {Object} – Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. Functions accept a config object as an argument.

  • eventHandlers - {Object} - Event listeners to be bound to the XMLHttpRequest object. To bind events to the XMLHttpRequest upload object, use uploadEventHandlers. The handler will be called in the context of a $apply block.

  • uploadEventHandlers - {Object} - Event listeners to be bound to the XMLHttpRequest upload object. To bind events to the XMLHttpRequest object, use eventHandlers. The handler will be called in the context of a $apply block.

  • xsrfHeaderName – {string} – Name of HTTP header to populate with the XSRF token.

  • xsrfCookieName – {string} – Name of cookie containing the XSRF token.

  • transformRequest – {function(data, headersGetter)|Array.<function(data, headersGetter)>} – transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version. See

  • transformResponse – {function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>} – transform function or an array of such functions. The transform function takes the http response body, headers and status and returns its transformed (typically deserialized) version. See

  • paramSerializer - {string|function(Object<string,string>):string} - A function used to prepare the string representation of request parameters (specified as an object). If specified as string, it is interpreted as function registered with the , which means you can create your own serializer by registering it as a . The default serializer is the ; alternatively, you can use the

  • cache – {boolean|Object} – A boolean value or object created with to enable or disable caching of the HTTP response. See for more information.

  • timeout – {number|Promise} – timeout in milliseconds, or that should abort the request when resolved.

    A numerical timeout or a promise returned from , will set the xhrStatus in the to "timeout", and any other resolved promise will set it to "abort", following standard XMLHttpRequest behavior.

  • withCredentials - {boolean} - whether to set the withCredentials flag on the XHR object. See for more information.

  • responseType - {string} - see .

👩‍🎓
Overriding the Default Transformations
Overriding the Default Transformations
$injector
service
$httpParamSerializer
$httpParamSerializerJQLike
$cacheFactory
$http Caching
promise
$timeout
response
requests with credentials
XMLHttpRequest.responseType