CampaignFlow.Client.Request (CampaignFlow Client v2.0.0)

View Source

Handles HTTP requests to the Campaign Flow API using Req.

This module provides low-level request functionality with automatic authentication and error handling.

Summary

Functions

Makes a DELETE request.

Makes a GET request.

Makes a PATCH request.

Makes a POST request.

Makes a PUT request.

Makes an authenticated HTTP request to the API.

Types

http_method()

@type http_method() :: :get | :post | :put | :patch | :delete

response()

@type response() :: {:ok, map() | list()} | {:error, term()}

Functions

delete(client, path, opts \\ [])

@spec delete(CampaignFlow.Client.t(), String.t(), keyword()) :: response()

Makes a DELETE request.

get(client, path, opts \\ [])

Makes a GET request.

patch(client, path, opts \\ [])

@spec patch(CampaignFlow.Client.t(), String.t(), keyword()) :: response()

Makes a PATCH request.

post(client, path, opts \\ [])

@spec post(CampaignFlow.Client.t(), String.t(), keyword()) :: response()

Makes a POST request.

put(client, path, opts \\ [])

Makes a PUT request.

request(client, method, path, opts \\ [])

@spec request(CampaignFlow.Client.t(), http_method(), String.t(), keyword()) ::
  response()

Makes an authenticated HTTP request to the API.

Automatically retrieves a valid token from the TokenManager.