REST APIs for Beginners

If you're new to REST (Representative State Transfer), you'll find abundant material across the web explaining the underlying concepts. But you don't need to understand all the theory and details behind REST just to use the Pax8 API.

REST isn't a technology or even a specification -- it's a design pattern that ensures your client and the API platform remain loosely coupled.

The API is language independent; meaning, you can develop your client in a preferred language. Most languages offer libraries specifically aimed at helping to manage and send HTTP requests.

What do API requests do?

Saying an API is RESTful implies a few simple things:

  • API calls perform CRUD functions
    Your client interacts with the API as it would a database, with simple CRUD (Create, Read, Update, Delete) operations.
  • API calls are made via HTTP requests
    Those CRUD operations are implemented in the Pax8 API as simple HTTP requests (GET, POST, PUT, and DELETE) your client makes to a specified, published URL
  • Really, REST is just CRUD
    Like a database, the API just lets you read, write, update, and delete data. (Using those HTTP requests). Those are the basics.

Like a database, the server maintains no state information about your client or user interface. But that doesn't mean there's no logic on the server side, only that your client doesn't need to worry about it. A good example of this is when you create an order (using POST with the orders endpoint). For your client-side code, that's just like creating an order record in the database. The server handles all the logistics of provisioning based on the parameters you sent.

How do I format requests?

The API Resource Reference below provides the necessary information to make HTTP requests -- the request verb to use (GET, PUT etc.), the URL (endpoint) to use, and the data parameters you must send to return the data you want back -- orders, product info, subscriptions, and so on.