Class: Onlyfans::Resources::SmartLinks
- Inherits:
-
Object
- Object
- Onlyfans::Resources::SmartLinks
- Defined in:
- lib/onlyfans/resources/smart_links.rb
Overview
APIs for managing Smart Links (Free Trial Links and Tracking Links with pooled inventory)
Instance Method Summary collapse
-
#create(account_id:, link_type:, name:, free_trial_days: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkCreateResponse
Some parameter documentations has been truncated, see Models::SmartLinkCreateParams for more details.
-
#delete(smart_link_id, request_options: {}) ⇒ Onlyfans::Models::SmartLinkDeleteResponse
Delete a Smart Link by its ID.
-
#initialize(client:) ⇒ SmartLinks
constructor
private
A new instance of SmartLinks.
-
#list(account_ids: nil, limit: nil, meta_pixel_ids: nil, name: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListResponse
Some parameter documentations has been truncated, see Models::SmartLinkListParams for more details.
-
#list_clicks(smart_link_id, date_end: nil, date_start: nil, include_bots: nil, include_duplicates: nil, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListClicksResponse
Query smart link clicks in a date range with optional bot/duplicate filtering.
-
#list_conversions(smart_link_id, conversion_type: nil, date_end: nil, date_start: nil, include_bots: nil, include_duplicates: nil, limit: nil, offset: nil, onlyfans_user_id: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListConversionsResponse
Query smart link conversions in a date range with optional bot/duplicate and conversion type filtering.
-
#list_fans(smart_link_id, has_messages: nil, limit: nil, min_messages_sent_by_fan: nil, min_revenue_net: nil, min_tips_net: nil, offset: nil, sort: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListFansResponse
Query attributed Smart Link fans with aggregate fan metrics and subscriber attribution metadata.
-
#list_spenders(smart_link_id, limit: nil, min_spend: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListSpendersResponse
Compatibility endpoint returning fans with attributed spend through a Smart Link.
-
#retrieve(smart_link_id, request_options: {}) ⇒ Onlyfans::Models::SmartLinkRetrieveResponse
Get a specific Smart Link by its ID.
-
#retrieve_cohort_arps(smart_link_id, acquisition_end: nil, acquisition_start: nil, revenue_basis: nil, request_options: {}) ⇒ nil
Get per-link time-to-profit cohort ARPS windows for a specific Smart Link.
-
#retrieve_stats(smart_link_id, date_end: nil, date_start: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkRetrieveStatsResponse
Get dashboard-style summary plus daily and monthly metrics for a specific Smart Link on the current team.
Constructor Details
#initialize(client:) ⇒ SmartLinks
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 SmartLinks.
316 317 318 |
# File 'lib/onlyfans/resources/smart_links.rb', line 316 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id:, link_type:, name:, free_trial_days: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkCreateResponse
Some parameter documentations has been truncated, see Models::SmartLinkCreateParams for more details.
Create a new Smart Link for the account. Smart Links are pooled Free Trial or Tracking links that rotate inventory automatically.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/onlyfans/resources/smart_links.rb', line 29 def create(params) parsed, = Onlyfans::SmartLinkCreateParams.dump_request(params) @client.request( method: :post, path: "api/smart-links", body: parsed, model: Onlyfans::Models::SmartLinkCreateResponse, options: ) end |
#delete(smart_link_id, request_options: {}) ⇒ Onlyfans::Models::SmartLinkDeleteResponse
Delete a Smart Link by its ID
105 106 107 108 109 110 111 112 |
# File 'lib/onlyfans/resources/smart_links.rb', line 105 def delete(smart_link_id, params = {}) @client.request( method: :delete, path: ["api/smart-links/%1$s", smart_link_id], model: Onlyfans::Models::SmartLinkDeleteResponse, options: params[:request_options] ) end |
#list(account_ids: nil, limit: nil, meta_pixel_ids: nil, name: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListResponse
Some parameter documentations has been truncated, see Models::SmartLinkListParams for more details.
List all Smart Links
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/onlyfans/resources/smart_links.rb', line 82 def list(params = {}) parsed, = Onlyfans::SmartLinkListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/smart-links", query: query, model: Onlyfans::Models::SmartLinkListResponse, options: ) end |
#list_clicks(smart_link_id, date_end: nil, date_start: nil, include_bots: nil, include_duplicates: nil, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListClicksResponse
Query smart link clicks in a date range with optional bot/duplicate filtering
137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/onlyfans/resources/smart_links.rb', line 137 def list_clicks(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkListClicksParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/clicks", smart_link_id], query: query, model: Onlyfans::Models::SmartLinkListClicksResponse, options: ) end |
#list_conversions(smart_link_id, conversion_type: nil, date_end: nil, date_start: nil, include_bots: nil, include_duplicates: nil, limit: nil, offset: nil, onlyfans_user_id: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListConversionsResponse
Query smart link conversions in a date range with optional bot/duplicate and conversion type filtering
177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/onlyfans/resources/smart_links.rb', line 177 def list_conversions(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkListConversionsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/conversions", smart_link_id], query: query, model: Onlyfans::Models::SmartLinkListConversionsResponse, options: ) end |
#list_fans(smart_link_id, has_messages: nil, limit: nil, min_messages_sent_by_fan: nil, min_revenue_net: nil, min_tips_net: nil, offset: nil, sort: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListFansResponse
Query attributed Smart Link fans with aggregate fan metrics and subscriber attribution metadata
215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/onlyfans/resources/smart_links.rb', line 215 def list_fans(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkListFansParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/fans", smart_link_id], query: query, model: Onlyfans::Models::SmartLinkListFansResponse, options: ) end |
#list_spenders(smart_link_id, limit: nil, min_spend: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkListSpendersResponse
Compatibility endpoint returning fans with attributed spend through a Smart Link
244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/onlyfans/resources/smart_links.rb', line 244 def list_spenders(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkListSpendersParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/spenders", smart_link_id], query: query.transform_keys(min_spend: "minSpend"), model: Onlyfans::Models::SmartLinkListSpendersResponse, options: ) end |
#retrieve(smart_link_id, request_options: {}) ⇒ Onlyfans::Models::SmartLinkRetrieveResponse
Get a specific Smart Link by its ID
51 52 53 54 55 56 57 58 |
# File 'lib/onlyfans/resources/smart_links.rb', line 51 def retrieve(smart_link_id, params = {}) @client.request( method: :get, path: ["api/smart-links/%1$s", smart_link_id], model: Onlyfans::Models::SmartLinkRetrieveResponse, options: params[:request_options] ) end |
#retrieve_cohort_arps(smart_link_id, acquisition_end: nil, acquisition_start: nil, revenue_basis: nil, request_options: {}) ⇒ nil
Get per-link time-to-profit cohort ARPS windows for a specific Smart Link
273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/onlyfans/resources/smart_links.rb', line 273 def retrieve_cohort_arps(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkRetrieveCohortArpsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/cohort-arps", smart_link_id], query: query, model: NilClass, options: ) end |
#retrieve_stats(smart_link_id, date_end: nil, date_start: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkRetrieveStatsResponse
Get dashboard-style summary plus daily and monthly metrics for a specific Smart Link on the current team
301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/onlyfans/resources/smart_links.rb', line 301 def retrieve_stats(smart_link_id, params = {}) parsed, = Onlyfans::SmartLinkRetrieveStatsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/smart-links/%1$s/stats", smart_link_id], query: query, model: Onlyfans::Models::SmartLinkRetrieveStatsResponse, options: ) end |