REST API Basics

Understanding REST APIs for use with API Mapper

REST API Basics

This guide covers the fundamentals of REST APIs to help you work effectively with API Mapper.

What is a REST API?

A REST (Representational State Transfer) API is a standardized way for applications to communicate over HTTP. When you use API Mapper, you're essentially telling it:

  1. Where to get data (the URL)
  2. How to authenticate (API key, token, etc.)
  3. What data to extract (field mapping)

Anatomy of an API Request

Base URL

The root address of the API:

https://api.example.com

Endpoint

The specific resource path:

/products
/users/123
/posts?category=news

Full URL

Base URL + Endpoint:

https://api.example.com/products

HTTP Methods

MethodPurposeExample
GETRetrieve dataGet list of products
POSTCreate dataCreate a new order
PUTUpdate dataUpdate user profile
DELETERemove dataDelete a comment

API Mapper primarily uses GET requests to fetch data.

Understanding JSON Responses

APIs return data in JSON format:

{
  "status": "success",
  "data": {
    "products": [
      {
        "id": 1,
        "name": "Widget",
        "price": 29.99,
        "image": "https://example.com/widget.jpg"
      },
      {
        "id": 2,
        "name": "Gadget",
        "price": 49.99,
        "image": "https://example.com/gadget.jpg"
      }
    ],
    "total": 2
  }
}

To access the products in API Mapper:

  • Path to list: data.products
  • Product name: name
  • Product price: price

Common Response Patterns

Array at Root

[
  {"id": 1, "name": "Item 1"},
  {"id": 2, "name": "Item 2"}
]

Path: Leave empty or use []

Nested in Data Object

{
  "data": [
    {"id": 1, "name": "Item 1"}
  ]
}

Path: data

Paginated Response

{
  "items": [...],
  "page": 1,
  "total_pages": 5
}

Path: items

Query Parameters

Many APIs accept parameters to filter or customize results:

/products?category=electronics&limit=10&sort=price

In API Mapper, add these in the Query Parameters section:

  • category = electronics
  • limit = 10
  • sort = price

API Documentation

Before connecting an API, always check its documentation for:

  1. Base URL - Often listed as "API Base URL" or "Endpoint"
  2. Authentication - How to authenticate requests
  3. Endpoints - Available data resources
  4. Response format - Structure of returned data
  5. Rate limits - How many requests you can make

Finding Public APIs

Practice with these free, no-auth APIs:

APIURLData
JSONPlaceholderjsonplaceholder.typicode.comPosts, users, comments
REST Countriesrestcountries.com/v3.1Country data
Open Libraryopenlibrary.orgBook data
PokéAPIpokeapi.co/api/v2Pokémon data

Next Steps

Was this page helpful?

On this page