Knock.Users (Knock v0.4.18)

View Source

Knock resources for accessing users

Summary

Functions

Bulk deletes the list of users given. Can accept a maximum of 100 users at a time.

Bulk identifies the list of users given. Can accept a maximum of 100 users at a time.

Bulk sets the preferences given for the list of user ids. Will overwrite the any existing preferences for these users.

Issues a delete request against the user specified

Returns information about the user.

Returns all of the users preference sets

Returns user's channel data for the given channel id.

Returns a feed for the user with the given channel_id. Optionally supports all of the options for fetching the feed.

Returns paginated messages for the given user

Returns the preference set for the user.

Returns paginated schedules for the given user

Returns paginated subscriptions for the given user

Returns information about the user from the user_id given.

Upserts the user specified via the user_id with the given properties.

Returns paginated list of users

Merges the user specified with from_user_id into the user specified with user_id.

Upserts user's channel data for the given channel id.

Sets an entire preference set for the user. Will overwrite any existing data.

Sets the workflow preferences for the user.

Unsets the user's channel data for the given channel id.

Functions

bulk_delete(client, user_ids)

@spec bulk_delete(Knock.Client.t(), [String.t()]) :: Knock.Api.response()

Bulk deletes the list of users given. Can accept a maximum of 100 users at a time.

bulk_identify(client, users)

@spec bulk_identify(Knock.Client.t(), [map()]) :: Knock.Api.response()

Bulk identifies the list of users given. Can accept a maximum of 100 users at a time.

bulk_set_preferences(client, user_ids, preferences, options \\ [])

@spec bulk_set_preferences(Knock.Client.t(), [String.t()], map(), Keyword.t()) ::
  Knock.Api.response()

Bulk sets the preferences given for the list of user ids. Will overwrite the any existing preferences for these users.

delete(client, user_id)

@spec delete(Knock.Client.t(), String.t()) :: Knock.Api.response()

Issues a delete request against the user specified

get(client, user_id)

Returns information about the user.

get_all_preferences(client, user_id)

@spec get_all_preferences(Knock.Client.t(), String.t()) :: Knock.Api.response()

Returns all of the users preference sets

get_channel_data(client, user_id, channel_id)

@spec get_channel_data(Knock.Client.t(), String.t(), String.t()) ::
  Knock.Api.response()

Returns user's channel data for the given channel id.

get_feed(client, user_id, channel_id, options \\ [])

@spec get_feed(Knock.Client.t(), String.t(), String.t(), Keyword.t()) ::
  Knock.Api.response()

Returns a feed for the user with the given channel_id. Optionally supports all of the options for fetching the feed.

Available optional parameters:

#

- page_size: specify size of the page to be returned by the api. (max limit: 50)

- after: after cursor for pagination

- before: before cursor for pagination

- status: list of statuses to filter feed items with

- tenant: tenant_id to filter messages with

- has_tenant: optionally scope items by a tenant id or no tenant

- archived: scope items by a given archived status (defaults to "exclude")

- trigger_data: trigger payload to filter feed items with

get_messages(client, id, options \\ [])

@spec get_messages(Knock.Client.t(), String.t(), Keyword.t()) :: Knock.Api.response()

Returns paginated messages for the given user

Available optional parameters:

#

- page_size: specify size of the page to be returned by the api. (max limit: 50)

- after: after cursor for pagination

- before: before cursor for pagination

- status: list of statuses to filter messages with

- tenant: tenant_id to filter messages with

- channel_id: channel_id to filter messages with

- source: workflow key to filter messages with

- trigger_data: trigger payload to filter messages with

get_preferences(client, user_id, options \\ [])

@spec get_preferences(Knock.Client.t(), String.t(), Keyword.t()) ::
  Knock.Api.response()

Returns the preference set for the user.

get_schedules(client, id, options \\ [])

@spec get_schedules(Knock.Client.t(), String.t(), Keyword.t()) :: Knock.Api.response()

Returns paginated schedules for the given user

Available optional parameters:

#

- page_size: specify size of the page to be returned by the api. (max limit: 50)

- after: after cursor for pagination

- before: before cursor for pagination

- tenant: tenant_id to filter messages with

- workflow: workflow key to filter messages with

get_subscriptions(client, id, options \\ [])

@spec get_subscriptions(Knock.Client.t(), String.t(), Keyword.t()) ::
  Knock.Api.response()

Returns paginated subscriptions for the given user

Available optional parameters:

#

- page_size: specify size of the page to be returned by the api. (max limit: 50)

- after: after cursor for pagination

- before: before cursor for pagination

get_user(client, user_id)

This function is deprecated. Use get/2 instead.
@spec get_user(Knock.Client.t(), String.t()) :: Knock.Api.response()

Returns information about the user from the user_id given.

identify(client, user_id, properties)

@spec identify(Knock.Client.t(), String.t(), map()) :: Knock.Api.response()

Upserts the user specified via the user_id with the given properties.

list(client, options \\ [])

Returns paginated list of users

Available optional parameters:

#

- page_size: specify size of the page to be returned by the api. (max limit: 50)

- after: after cursor for pagination

- before: before cursor for pagination

merge(client, user_id, from_user_id)

Merges the user specified with from_user_id into the user specified with user_id.

set_categories_preferences(client, user_id, categories, options \\ [])

@spec set_categories_preferences(Knock.Client.t(), String.t(), map(), Keyword.t()) ::
  Knock.Api.response()

Sets the category preferences for the user.

set_category_preferences(client, user_id, category_key, setting, options \\ [])

@spec set_category_preferences(
  Knock.Client.t(),
  String.t(),
  String.t(),
  map() | boolean(),
  Keyword.t()
) :: Knock.Api.response()

Sets the category preference for the user.

set_channel_data(client, user_id, channel_id, channel_data)

@spec set_channel_data(Knock.Client.t(), String.t(), String.t(), map()) ::
  Knock.Api.response()

Upserts user's channel data for the given channel id.

set_channel_type_preferences(client, user_id, channel_type, setting, options \\ [])

@spec set_channel_type_preferences(
  Knock.Client.t(),
  String.t(),
  String.t(),
  boolean(),
  Keyword.t()
) ::
  Knock.Api.response()

Sets the channel type preference for the user.

set_channel_types_preferences(client, user_id, channel_types, options \\ [])

@spec set_channel_types_preferences(Knock.Client.t(), String.t(), map(), Keyword.t()) ::
  Knock.Api.response()

Sets the channel type preferences for the user.

set_preferences(client, user_id, preferences, options \\ [])

@spec set_preferences(Knock.Client.t(), String.t(), map(), Keyword.t()) ::
  Knock.Api.response()

Sets an entire preference set for the user. Will overwrite any existing data.

set_workflow_preferences(client, user_id, workflow_key, setting, options \\ [])

@spec set_workflow_preferences(
  Knock.Client.t(),
  String.t(),
  String.t(),
  map() | boolean(),
  Keyword.t()
) :: Knock.Api.response()

Sets the workflow preference for the user.

set_workflows_preferences(client, user_id, workflows, options \\ [])

@spec set_workflows_preferences(Knock.Client.t(), String.t(), map(), Keyword.t()) ::
  Knock.Api.response()

Sets the workflow preferences for the user.

unset_channel_data(client, user_id, channel_id)

@spec unset_channel_data(Knock.Client.t(), String.t(), String.t()) ::
  Knock.Api.response()

Unsets the user's channel data for the given channel id.