View Source ExPipedrive.OrganizationRelationships (ex_pipedrive v0.2.0)

API v1 client for Pipedrive organization relationships.

Organization relationships remain on /api/v1/organizationRelationships; there is no /api/v2 equivalent. All functions here explicitly route to api_version: :v1.

Example

{:ok, relationship} =
  ExPipedrive.OrganizationRelationships.create(client, %{
    type: "parent",
    rel_owner_org_id: 1,
    rel_linked_org_id: 2
  })

{:ok, relationships} = ExPipedrive.OrganizationRelationships.list(client, org_id)
{:ok, relationship} = ExPipedrive.OrganizationRelationships.get(client, relationship.id)
{:ok, :ok} = ExPipedrive.OrganizationRelationships.delete(client, relationship.id)

Summary

Functions

Creates an organization relationship via POST /api/v1/organizationRelationships.

Deletes an organization relationship via DELETE /api/v1/organizationRelationships/:id.

Fetches an organization relationship by id via GET /api/v1/organizationRelationships/:id.

Lists all relationships for an organization via GET /api/v1/organizationRelationships.

Updates an organization relationship via PUT /api/v1/organizationRelationships/:id.

Functions

@spec create(Tesla.Client.t(), map()) ::
  {:ok, ExPipedrive.OrganizationRelationship.t()}
  | {:error, ExPipedrive.Error.t()}

Creates an organization relationship via POST /api/v1/organizationRelationships.

Accepts a map with :type ("parent" or "related"), :rel_owner_org_id, :rel_linked_org_id, and optional :org_id.

@spec delete(Tesla.Client.t(), pos_integer()) ::
  {:ok, :ok} | {:error, ExPipedrive.Error.t()}

Deletes an organization relationship via DELETE /api/v1/organizationRelationships/:id.

Returns {:ok, :ok}.

Link to this function

get(client, id, org_id \\ nil)

View Source

Fetches an organization relationship by id via GET /api/v1/organizationRelationships/:id.

org_id is optional and scopes the calculated rel_* values to that organization's perspective.

Lists all relationships for an organization via GET /api/v1/organizationRelationships.

Link to this function

update(client, id, attrs)

View Source

Updates an organization relationship via PUT /api/v1/organizationRelationships/:id.