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 listPOST /api/v2/{entity}/:id/followers— add (user_idbody 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 a deal. See list_page/4.
Lists followers of an organization. See list_page/4.
Lists one cursor page of followers via GET /api/v2/{entity}/:id/followers.
Lists followers of a person. See list_page/4.
Lazily streams followers across all cursor pages. See Cursor.stream/2.
Streams followers of a deal. See stream/4.
Streams followers of an organization. See stream/4.
Streams followers of a person. See stream/4.
Types
@type entity() :: :deal | :person | :organization
Functions
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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).
@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.
@spec stream(Tesla.Client.t(), entity(), term(), keyword()) :: Enumerable.t()
Lazily streams followers across all cursor pages. See Cursor.stream/2.
@spec stream_deal_followers(Tesla.Client.t(), term(), keyword()) :: Enumerable.t()
Streams followers of a deal. See stream/4.
@spec stream_organization_followers(Tesla.Client.t(), term(), keyword()) :: Enumerable.t()
Streams followers of an organization. See stream/4.
@spec stream_person_followers(Tesla.Client.t(), term(), keyword()) :: Enumerable.t()
Streams followers of a person. See stream/4.