Web Service

From LINKS - Documentation
Jump to: navigation, search

It allows us to interact with LINKS via web, apps, scripts, or even another instance of LINKS on another machine. Endless possibilities.

  • Example URL: http://localhost:54657/?action=[Speak("web requests disable")]&key=1234ABC&request=disable&output=json
  • If WebAccess under settings is not enabled we use localhost for i.e. http://localhost:54657/?
  • If WebAccess under settings is enabled we can either use localhost or local IP address for i.e.
Note: We can find what IP is the web service running on from windows command prompt using this command: netstat -a | findstr 54657
  • Base URL: http://IP_OR_LOCALHOST:54657
  • For starting the web query: ? is used
  • For separating parameters: & is used
  • URL takes following parameters:
    • action: always required, you’ll need to find what commands can be called from here.
    • key: only needed if web access is enabled, located under LINKS settings.
    • request: can be used to enable or disable web request.
    • output: can be added to get json response or other formats.
    • Example:
      • action=[Speak("web requests disabled")]
      • key=1234ABC
      • request=disable
      • output=json
      • So if we put it together.. it will look like this:
        • http://localhost:54657/?action=[Speak("web requests disabled")]&key=1234ABC&request=disable&output=json
    • output parameter can have following values:
      • json: retrieves request, status, response, error as json.
      • plaintext: retrieves request, status, response, error as plain text.
      • xml: retrieves request, status, response, error as xml.
      • response: response field in plain text.
      • error: error field in plain text.
      • request: request field in plain text.
      • status: status field in plain text.