Class: Onlyfans::Resources::Engagement::Messages::MassMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/engagement/messages/mass_messages.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MassMessages

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MassMessages.

Parameters:



80
81
82
# File 'lib/onlyfans/resources/engagement/messages/mass_messages.rb', line 80

def initialize(client:)
  @client = client
end

Instance Method Details

#chart(account, end_date: nil, start_date: nil, with_total: nil, request_options: {}) ⇒ Onlyfans::Models::Engagement::Messages::MassMessageChartResponse

Get engagement chart metrics for mass messages: sent count and purchase amount over time.

Parameters:

  • account (String)

    The Account ID

  • end_date (String)

    End of the chart window in ‘Y-m-d H:i:s` format. Must be after `startDate`.

  • start_date (String)

    Start of the chart window in ‘Y-m-d H:i:s` format.

  • with_total (Boolean)

    Include ‘total` and `delta` aggregates in the response. Defaults to `true`.

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/onlyfans/resources/engagement/messages/mass_messages.rb', line 61

def chart(, params = {})
  parsed, options = Onlyfans::Engagement::Messages::MassMessageChartParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/engagement/messages/mass-messages/chart", ],
    query: query.transform_keys(
      end_date: "endDate",
      start_date: "startDate",
      with_total: "withTotal"
    ),
    model: Onlyfans::Models::Engagement::Messages::MassMessageChartResponse,
    options: options
  )
end

#list(account, end_date: nil, limit: nil, query: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::Engagement::Messages::MassMessageListResponse

Some parameter documentations has been truncated, see Models::Engagement::Messages::MassMessageListParams for more details.

List sent mass messages with engagement stats (sent, viewed, purchased, etc.).

Parameters:

  • account (String)

    The Account ID

  • end_date (String)

    The latest message to retrieve. Keep empty to get all. MUST BE DATE AFTER ‘start

  • limit (Integer)

    Number of messages to return (default = 10)

  • query (String)

    Optionally, filter by message text.

  • start_date (String)

    The earliest message to retrieve. Keep empty to get all.

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/onlyfans/resources/engagement/messages/mass_messages.rb', line 31

def list(, params = {})
  parsed, options = Onlyfans::Engagement::Messages::MassMessageListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/engagement/messages/mass-messages", ],
    query: query.transform_keys(end_date: "endDate", start_date: "startDate"),
    model: Onlyfans::Models::Engagement::Messages::MassMessageListResponse,
    options: options
  )
end