Information Systems:Infonet APIs

From uniWIKI
Revision as of 10:35, 16 January 2017 by Norwinu (talk | contribs)
Jump to navigation Jump to search

Overview

Work has been started on creating API functionality for Infonet. Features will be documented here.

What is an API?

An API (in this case a web API) allows commonly used functions to be grouped together in one program to be used by other programs, returning data in a consistent format. For example, in a theoretical "Orders" program displaying a list of customers and their orders, the customer names can be made into clickable links that bring up a popup box showing their contact info. Instead of having the back-end code to query customer information in this orders program, the program queries the API and receives back customer information, which it can then display in whatever format is desired. Other programs query the API in the same manner but may present the data differently.

Infonet API programs

All programs/functions return data in JSON unless otherwise noted.

IN2_SRVAPI.PGM

  • Customer info (customer number)
  • Session info (smurf ID)

IN2_APIWH.PGM

  • Warehouse transactions (item number, warehouse)
  • Location transactions (item number, warehouse)

Implementation

The calls to these API programs are currently all made with jQuery Ajax. For each IN2 program, there will most likely be a javascript file of the same name where the Ajax calls are contained. This code may be placed back into a WebSmart segment for more cohesive code, but currently it is easier to separate out javascript functionality into external scripts.