View Source ExPipedrive.Raw (ex_pipedrive v0.1.0)

Escape hatch for Pipedrive endpoints without a first-class module.

Requests still go through the authenticated Tesla client (auth, JSON) and ExPipedrive.Response / ExPipedrive.Error normalization. Prefer resource modules when they exist; use this for unsupported or experimental paths.

Path forms

  • Resource segment (versioned via :api_version, default :v2): "dealFields"
  • Absolute API path: "/api/v1/dealFields" or "/api/v2/itemSearch"

Example

{:ok, body} =
  ExPipedrive.Raw.request(client, :get, "dealFields",
    api_version: :v1,
    query: [limit: 100]
  )

{:ok, body} =
  ExPipedrive.Raw.request(client, :post, "/api/v2/deals",
    body: %{title: "From raw", value: 100, currency: "USD"}
  )

Summary

Functions

Performs a raw HTTP request against Pipedrive.

Types

@type method() :: :get | :post | :put | :patch | :delete
@type path() :: String.t() | atom()

Functions

Link to this function

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

View Source
@spec request(Tesla.Client.t(), method(), path(), keyword()) ::
  {:ok, term()} | {:error, ExPipedrive.Error.t()}

Performs a raw HTTP request against Pipedrive.

Options

  • :query — query string keyword list or map
  • :body — JSON-encodable body (POST / PUT / PATCH)
  • :headers — extra request headers as [{binary, binary}]
  • :api_version:v1 or :v2 when path is a resource segment (ignored when path is already an absolute /api/v… path)
  • :success_statuses — HTTP statuses treated as success (default [200, 201, 204])
  • :opts — Tesla request opts (e.g. path_params: [id: 1])

Returns {:ok, body} with the decoded response body, or {:error, %ExPipedrive.Error{}}.