Class: Onlyfans::Resources::SharedTrackingLinks

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/shared_tracking_links.rb,
lib/onlyfans/resources/shared_tracking_links/tags.rb,
sig/onlyfans/resources/shared_tracking_links.rbs,
sig/onlyfans/resources/shared_tracking_links/tags.rbs

Overview

APIs for Tracking Links (campaigns) that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared campaigns.

Defined Under Namespace

Classes: Tags

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SharedTrackingLinks

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

Parameters:



79
80
81
82
# File 'lib/onlyfans/resources/shared_tracking_links.rb', line 79

def initialize(client:)
  @client = client
  @tags = Onlyfans::Resources::SharedTrackingLinks::Tags.new(client: client)
end

Instance Attribute Details

#tags ⇒ Onlyfans::Resources::SharedTrackingLinks::Tags (readonly)

APIs for Tracking Links (campaigns) that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared campaigns.



11
12
13
# File 'lib/onlyfans/resources/shared_tracking_links.rb', line 11

def tags
  @tags
end

Instance Method Details

#list(account, limit: nil, offset: nil, synchronous: nil, request_options: {}) ⇒ Onlyfans::Models::SharedTrackingLinkListResponse

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

List all Tracking Links (campaigns) shared with the account by other OF creators. Calls OnlyFans live and syncs to our cache.

background. *

Parameters:

  • account (String) —

    The Account ID

  • limit (Integer) —

    The number of shared tracking links to return. Default 10

  • offset (Integer) —

    The offset used for pagination. Default 0

  • synchronous (Boolean, nil) —

    Wait for the database sync to finish, instead of running it in the

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

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/onlyfans/resources/shared_tracking_links.rb', line 35

def list(, params = {})
  parsed, options = Onlyfans::SharedTrackingLinkListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/shared-tracking-links", ],
    query: query,
    model: Onlyfans::Models::SharedTrackingLinkListResponse,
    options: options
  )
end

#revoke_access(shared_tracking_link_id, account:, request_options: {}) ⇒ Onlyfans::Models::SharedTrackingLinkRevokeAccessResponse

Revoke the account's access to a shared Tracking Link (campaign). Calls OnlyFans DELETE /campaigns/share-access, then removes the local cache row. The owner keeps the link.

Parameters:

  • shared_tracking_link_id (Integer) —

    The OnlyFans-side ID of the shared tracking link

  • account (String) —

    The Account ID

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

Returns:

See Also:



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

def revoke_access(shared_tracking_link_id, params)
  parsed, options = Onlyfans::SharedTrackingLinkRevokeAccessParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/shared-tracking-links/%2$s", , shared_tracking_link_id],
    model: Onlyfans::Models::SharedTrackingLinkRevokeAccessResponse,
    options: options
  )
end