Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you start using APIs to query for data, you will run into situations where you have to choose which API to use .from different APIs that seem very similar to each other in name - for example, a GET /inventory/items

Some FOLIO modules provide different types of APIs that can appear to do similar things. You'll sometimes hear them referred to as storage APIs versus business logic APIs.

...

  • Storage modules abstract the storage technology. In other words, you don't need to know if your FOLIO is using Postgres or another type of database in order to query the data.
  • Storage modules .represent the source of truth for a record. For example, you may find copies of item information in other modules like mod-courses or mod-circulation-storage, but the source of truth for the item record is mod-inventory-storage.
  • Storage modules do not have dependencies on other FOLIO modules, but other FOLIO modules often have dependencies on them.
  • Storage modules tend to be the implementation module for batch APIs, when those are available.
  • Storage modules publish messages about record changes, when those workflows have been implemented.

...

  • Does the API exist? It's a basic question, but important - does the API you need to use exist? If it does, are there similar APIs in both the storage module and the business logic module? If you only find an API in one module, that is probably the one you should use.
  • Which API does FOLIO use in the user interface? If you are trying to replicate a transaction that happens in the FOLIO user interface,  you probably want to start with the API that the user interface uses. To figure that out, you would carry out the transaction in FOLIO while viewing the backend traffic with Chrome developer tools. In developer tools, you can find the query that's being used. Using Developer Tools definitely has a learning curve - we say that not to dissuade you, but to reassure you that if you start exploring it and are not sure what you are looking at,  you are definitely not alone.
  • Am I trying to get information that depends on FOLIO calculating or combining values and/or records ? For example, if you are wanting to use Postman to query for users with a certain amount of fines, you probably want to use business-logic APIs, since they will often be the APIs that FOLIO itself uses to make calculations. 
  • Experimentation: When in doubt, try either API and look at the results, and examine which better answers your question.
  • Experience: This is more of a statement than a question, but essentially, the more experience you have with FOLIO, the more confident you will get in figuring out which APIs are best for the information that you need. This is where we encourage you to ask for advice  - questions about which API to use are very appropriate for the #learning-apis Slack channel, where you will find many community members at various stages of learning who will be willing to help.