View Source ExPipedrive.Followers (ex_pipedrive v0.2.0)

API v2 client for followers on deals, persons, and organizations.

Followers moved from v1 to v2 for these three entities (see Pipedrive's /v1 to /v2 migration guide). Each entity exposes the identical shape:

  • GET /api/v2/{entity}/:id/followers — cursor-paginated list
  • POST /api/v2/{entity}/:id/followers — add (user_id body param)
  • DELETE /api/v2/{entity}/:id/followers/:follower_id — remove

list_page/4 and add/4 / delete/4 take an entity atom (:deal, :person, or :organization); per-entity convenience wrappers (list_deal_followers/3, add_person_follower/3, …) are provided below.

Example

{:ok, page} = ExPipedrive.Followers.list_deal_followers(client, deal_id)
{:ok, follower} = ExPipedrive.Followers.add_deal_follower(client, deal_id, user_id)
{:ok, _} = ExPipedrive.Followers.delete_deal_follower(client, deal_id, follower.id)

Summary

Functions

Adds a user as a follower via POST /api/v2/{entity}/:id/followers.

Adds a follower to a deal. See add/4.

Adds a follower to an organization. See add/4.

Adds a follower to a person. See add/4.

Removes a follower via DELETE /api/v2/{entity}/:id/followers/:follower_id.

Removes a follower from a deal. See delete/4.

Removes a follower from an organization. See delete/4.

Removes a follower from a person. See delete/4.

Lists followers of an organization. See list_page/4.

Lists one cursor page of followers via GET /api/v2/{entity}/:id/followers.

Lazily streams followers across all cursor pages. See Cursor.stream/2.

Streams followers of an organization. See stream/4.

Types

@type entity() :: :deal | :person | :organization

Functions

Link to this function

add(client, entity, entity_id, user_id)

View Source
@spec add(Tesla.Client.t(), entity(), term(), pos_integer()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Adds a user as a follower via POST /api/v2/{entity}/:id/followers.

Link to this function

add_deal_follower(client, deal_id, user_id)

View Source
@spec add_deal_follower(Tesla.Client.t(), term(), pos_integer()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Adds a follower to a deal. See add/4.

Link to this function

add_organization_follower(client, org_id, user_id)

View Source
@spec add_organization_follower(Tesla.Client.t(), term(), pos_integer()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Adds a follower to an organization. See add/4.

Link to this function

add_person_follower(client, person_id, user_id)

View Source
@spec add_person_follower(Tesla.Client.t(), term(), pos_integer()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Adds a follower to a person. See add/4.

Link to this function

delete(client, entity, entity_id, follower_id)

View Source
@spec delete(Tesla.Client.t(), entity(), term(), term()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Removes a follower via DELETE /api/v2/{entity}/:id/followers/:follower_id.

Link to this function

delete_deal_follower(client, deal_id, follower_id)

View Source
@spec delete_deal_follower(Tesla.Client.t(), term(), term()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Removes a follower from a deal. See delete/4.

Link to this function

delete_organization_follower(client, org_id, follower_id)

View Source
@spec delete_organization_follower(Tesla.Client.t(), term(), term()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Removes a follower from an organization. See delete/4.

Link to this function

delete_person_follower(client, person_id, follower_id)

View Source
@spec delete_person_follower(Tesla.Client.t(), term(), term()) ::
  {:ok, ExPipedrive.Follower.t()} | {:error, ExPipedrive.Error.t()}

Removes a follower from a person. See delete/4.

Link to this function

list_deal_followers(client, deal_id, opts \\ [])

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

Lists followers of a deal. See list_page/4.

Link to this function

list_organization_followers(client, org_id, opts \\ [])

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

Lists followers of an organization. See list_page/4.

Link to this function

list_page(client, entity, entity_id, opts \\ [])

View Source
@spec list_page(Tesla.Client.t(), entity(), term(), keyword()) ::
  {:ok, ExPipedrive.Page.t()} | {:error, ExPipedrive.Error.t()}

Lists one cursor page of followers via GET /api/v2/{entity}/:id/followers.

Options: :cursor, :limit (clamped to ExPipedrive.Cursor.max_limit/0).

Link to this function

list_person_followers(client, person_id, opts \\ [])

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

Lists followers of a person. See list_page/4.

Link to this function

stream(client, entity, entity_id, opts \\ [])

View Source
@spec stream(Tesla.Client.t(), entity(), term(), keyword()) :: Enumerable.t()

Lazily streams followers across all cursor pages. See Cursor.stream/2.

Link to this function

stream_deal_followers(client, deal_id, opts \\ [])

View Source
@spec stream_deal_followers(Tesla.Client.t(), term(), keyword()) :: Enumerable.t()

Streams followers of a deal. See stream/4.

Link to this function

stream_organization_followers(client, org_id, opts \\ [])

View Source
@spec stream_organization_followers(Tesla.Client.t(), term(), keyword()) ::
  Enumerable.t()

Streams followers of an organization. See stream/4.

Link to this function

stream_person_followers(client, person_id, opts \\ [])

View Source
@spec stream_person_followers(Tesla.Client.t(), term(), keyword()) :: Enumerable.t()

Streams followers of a person. See stream/4.