Class: Onlyfans::Resources::MassMessaging

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/mass_messaging.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MassMessaging

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 MassMessaging.

Parameters:



229
230
231
# File 'lib/onlyfans/resources/mass_messaging.rb', line 229

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(id, account:, request_options: {}) ⇒ Onlyfans::Models::MassMessagingDeleteResponse

Some parameter documentations has been truncated, see Models::MassMessagingDeleteParams for more details.

Unsend a recently sent mass message, or delete a scheduled/saved message. When unsending, purchased content will continue to be able to viewable.

Parameters:

  • id (String)

    The ID of the message queue item. Can be retrieved from the above store and list

  • account (String)

    The Account ID

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

Returns:

See Also:



122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/onlyfans/resources/mass_messaging.rb', line 122

def delete(id, params)
  parsed, options = Onlyfans::MassMessagingDeleteParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/mass-messaging/%2$s", , id],
    model: Onlyfans::Models::MassMessagingDeleteResponse,
    options: options
  )
end

#list(account, request_options: {}) ⇒ Onlyfans::Models::MassMessagingListResponse

List the pending or recently sent mass messages in the message queue.

Parameters:

Returns:

See Also:



96
97
98
99
100
101
102
103
# File 'lib/onlyfans/resources/mass_messaging.rb', line 96

def list(, params = {})
  @client.request(
    method: :get,
    path: ["api/%1$s/mass-messaging", ],
    model: Onlyfans::Models::MassMessagingListResponse,
    options: params[:request_options]
  )
end

#retrieve(id, account:, request_options: {}) ⇒ Onlyfans::Models::MassMessagingRetrieveResponse

Some parameter documentations has been truncated, see Models::MassMessagingRetrieveParams for more details.

Get the content of a mass message.

Parameters:

  • id (String)

    The ID of the message queue item. Can be retrieved from the above store and list

  • account (String)

    The Account ID

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

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/onlyfans/resources/mass_messaging.rb', line 22

def retrieve(id, params)
  parsed, options = Onlyfans::MassMessagingRetrieveParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/%1$s/mass-messaging/%2$s", , id],
    model: Onlyfans::Models::MassMessagingRetrieveResponse,
    options: options
  )
end

#retrieve_overview(account, end_date: nil, limit: nil, query: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::MassMessagingRetrieveOverviewResponse

Some parameter documentations has been truncated, see Models::MassMessagingRetrieveOverviewParams for more details.

Get an overview of mass messages, showing the send count and view count.

Parameters:

  • account (String)

    The Account ID

  • end_date (String)

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

  • limit (Integer)

    Number of mass messages to return (default = 10)

  • query (String)

    Optionally, find a mass message by the message text.

  • start_date (String)

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

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

Returns:

See Also:



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/onlyfans/resources/mass_messaging.rb', line 158

def retrieve_overview(, params = {})
  parsed, options = Onlyfans::MassMessagingRetrieveOverviewParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/mass-messaging/overview", ],
    query: query.transform_keys(end_date: "endDate", start_date: "startDate"),
    model: Onlyfans::Models::MassMessagingRetrieveOverviewResponse,
    options: options
  )
end

#send_(account, text:, excluded_lists: nil, giphy_id: nil, locked_text: nil, media_files: nil, previews: nil, price: nil, rf_guest: nil, rf_partner: nil, rf_tag: nil, save_for_later: nil, scheduled_date: nil, user_ids: nil, user_lists: nil, request_options: {}) ⇒ Onlyfans::Models::MassMessagingSendResponse

Some parameter documentations has been truncated, see Models::MassMessagingSendParams for more details.

Send a mass message to lists and/or users. You may use both the ‘userLists` and `userIds` parameters to send the same message to both lists and individual users.

**mediaFi

Parameters:

  • account (String)

    The Account ID

  • text (String)

    The message text content

  • excluded_lists (Array<String>)

    Array of user list IDs that the mass message will NOT be sent to.

  • giphy_id (String)

    The ID of the Giphy GIF to attach to the message. Get IDs from the Giphy listing

  • locked_text (Boolean)

    Whether the text should be shown or hidden

  • media_files (Array<Object>)

    Direct file uploads, OFAPI ‘ofapi_media_` IDs, or OF vault IDs. Will be hidden i

  • previews (Array<Object>)

    Direct file uploads, OFAPI ‘ofapi_media_` IDs, OF vault IDs, or integer indices

  • price (Integer)

    Price for paid content (0 or between 3-200). In case this is not zero,

  • rf_guest (String)

    Array of OnlyFans Release Form Guest IDs to tag in your mass message

  • rf_partner (String)

    Array of OnlyFans Release Form Partners IDs to tag in your mass message

  • rf_tag (String)

    Array of OnlyFans Creator User IDs to tag in your mass message

  • save_for_later (Boolean)

    Add your message to the “Saved for later” queue.

  • scheduled_date (String)

    Schedule the chat message in the future (UTC timezone).

  • user_ids (Array<String>)

    Array of user IDs that the mass message will be sent to.

  • user_lists (Array<String>)

    Array of user list IDs that the mass message will be sent to.

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

Returns:

See Also:



215
216
217
218
219
220
221
222
223
224
# File 'lib/onlyfans/resources/mass_messaging.rb', line 215

def send_(, params)
  parsed, options = Onlyfans::MassMessagingSendParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/%1$s/mass-messaging", ],
    body: parsed,
    model: Onlyfans::Models::MassMessagingSendResponse,
    options: options
  )
end

#update(id, account:, text:, giphy_id: nil, locked_text: nil, media_files: nil, previews: nil, price: nil, scheduled_date: nil, user_ids: nil, user_lists: nil, request_options: {}) ⇒ Onlyfans::Models::MassMessagingUpdateResponse

Some parameter documentations has been truncated, see Models::MassMessagingUpdateParams for more details.

Update a mass message.

Parameters:

  • id (String)

    Path param: The ID of the message queue item. Can be retrieved from the above st

  • account (String)

    Path param: The Account ID

  • text (String)

    Body param: The message text content

  • giphy_id (String)

    Body param: The ID of the Giphy GIF to attach to the message. Get IDs from the G

  • locked_text (Boolean)

    Body param: Whether the text should be shown or hidden

  • media_files (Array<String>)

    Body param: Array of media file upload prefixed_ids, or OF media IDs (required i

  • previews (Array<String>)

    Body param: Array of media file upload prefixed_ids, or OF media IDs (required i

  • price (Integer)

    Body param: Price for paid content (0 or between 3-200). In case this is not zer

  • scheduled_date (String)

    Body param: Schedule the chat message in the future (UTC timezone).

  • user_ids (Array<String>)

    Body param: Array of user IDs that the mass message will be sent to.

  • user_lists (Array<String>)

    Body param: Array of user list IDs that the mass message will be sent to.

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

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/onlyfans/resources/mass_messaging.rb', line 70

def update(id, params)
  parsed, options = Onlyfans::MassMessagingUpdateParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["api/%1$s/mass-messaging/%2$s", , id],
    body: parsed,
    model: Onlyfans::Models::MassMessagingUpdateResponse,
    options: options
  )
end