ex_intercom v0.0.4 ExIntercom.User View Source

Users are the primary way of interacting with the ExIntercom API. If you know a user’s ID you can easily fetch their data.

{:ok, %ExIntercom.User{} = user} = ExIntercom.User.get("530370b477ad7120001d")

You can also look them up using the user_id your system assigned to them when creating the user record, or alternatively, via their email address.

{:ok, %ExIntercom.User{}} = ExIntercom.User.find({:user_id, 25})
{:ok, %ExIntercom.User{}} = ExIntercom.User.find({:email, "wash@serenity.io"})

If the user cannot be found you will get {:error, :not_found}. If your token doesn’t have sufficient permissions to access a resource the return value will be {:error, :not_authorised}.

Link to this section Summary

Functions

Look up a user by their assigned user ID or email address

Fetches a user by their ExIntercom ID

Link to this section Types

Link to this type result() View Source
result() ::
  {:ok, ExIntercom.User.t()} |
  {:error, :not_found} |
  {:error, :not_authorised} |
  {:error, any()}
Link to this type t() View Source
t() :: %ExIntercom.User{anonymous: term(), avatar: term(), companies: term(), created_at: term(), email: term(), id: term(), last_request_at: term(), last_seen_ip: term(), location: term(), name: term(), phone: term(), pseudonym: term(), segments: term(), session_count: term(), signed_up_at: term(), social_profiles: term(), tags: term(), type: term(), unsubscribed_from_emails: term(), updated_at: term(), user_agent_data: term(), user_id: term()}

Link to this section Functions

Link to this function find(arg) View Source
find({:user_id | :email, String.t()}) :: result()

Look up a user by their assigned user ID or email address.

Fetches a user by their ExIntercom ID.