Getting Started with RestBook

This guide will help you get started with RestBook, from installation to your first playbook.

Installation

Install RestBook using pip:

pip install restbook

Quick Start Guide

Here’s a simple example of a RestBook playbook to get you started:

sessions:
  api:
    base_url: "https://api.example.com"
    auth:
      type: "bearer"
      credentials:
        token: ""  # Use environment variable

phases:
  - name: "Fetch Users"
    steps:
      - session: "api"
        request:
          method: GET
          endpoint: "/users"
          params:
            limit: 10
        store:
          - var: "users"
            jq: "."

  - name: "Process Users"
    steps:
      - session: "api"
        iterate: "user in users"
        parallel: true
        request:
          method: GET
          endpoint: "/users//details"
        store:
          - var: "user__details"
            jq: "."

Basic Concepts

Before diving deeper into RestBook, let’s understand the basic concepts:

Sessions

Sessions define the base configuration for your API connections, including:

Phases

Phases are top-level containers for steps. They can be:

Steps

Steps are individual API requests that can:

Variables and Templates

RestBook supports:

Next Steps

Now that you have the basics, you can:

  1. Learn more about Playbook Structure
  2. Explore Features in detail
  3. Check out Examples for common use cases
  4. Set up CI/CD Integration for your workflows