REST API/Request Format

Request Format

Understanding how to structure API requests with parameters, headers, and request bodies

Request Components

API requests can include parameters in four different locations: path parameters, query parameters, headers, and request body. Understanding where to place each type of parameter is essential for successful API integration.

Path Parameters

Path parameters are part of the URL path and identify specific resources. They are required and appear in curly braces in the API Reference:

Path Parameters
Always required and cannot be omitted
Must be URL-encoded if containing special characters
Typically used for resource identifiers (IDs, slugs)

Query Parameters

Query parameters are appended to the URL after a question mark (?) and separated by ampersands (&). They are typically optional and used for filtering, pagination, and sorting:

Query Parameters
Usually optional with default values
Must be URL-encoded (spaces become %20)
Best for simple filtering and pagination

Request Headers

Headers provide metadata about the request, including authentication credentials, content type, and custom tracking information:

Request Headers

Required Headers

  • Authorization— Your API Key in Bearer token format
  • Content-Type— Must be application/json for POST/PUT requests

Optional Headers

  • Accept— Preferred response format (default: application/json)
  • X-Request-ID— Custom identifier for request tracking and debugging

Request Body

The request body contains the main data payload for POST and PUT requests. It must be valid JSON and include all required fields:

Request Body (JSON)
Must be valid JSON format
Used for complex queries and data structures
Supports nested objects and arrays

Best Practices

  • Always validate JSON before sending requests
  • URL-encode path and query parameters containing special characters
  • Include X-Request-ID for easier debugging
  • Use request bodies for complex queries instead of long query strings