Class: Onlyfans::Resources::SmartLinkPostbacks

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

Overview

APIs for managing Smart Link postback destinations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SmartLinkPostbacks

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

Parameters:



129
130
131
# File 'lib/onlyfans/resources/smart_link_postbacks.rb', line 129

def initialize(client:)
  @client = client
end

Instance Method Details

#create(conversion_types:, smart_link_scope:, url:, smart_link_ids: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkPostbackCreateResponse

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

Create a postback that fires for selected Smart Link conversion types

Parameters:

  • conversion_types (Array<String>) —

    One or more Smart Link conversion types that should trigger this postback.

  • smart_link_scope (Symbol, Onlyfans::Models::SmartLinkPostbackCreateParams::SmartLinkScope) —

    global fires for all Smart Links. campaign_specific fires only for selected

  • url (String) —

    The destination URL. Variables such as {click_id}, {fbclid}, {gclid}, and

  • smart_link_ids (Array<String>) —

    Smart Link ULIDs. Required when smart_link_scope is campaign_specific.

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/onlyfans/resources/smart_link_postbacks.rb', line 27

def create(params)
  parsed, options = Onlyfans::SmartLinkPostbackCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/smart-link-postbacks",
    body: parsed,
    model: Onlyfans::Models::SmartLinkPostbackCreateResponse,
    options: options
  )
end

#delete(postback_id, request_options: {}) ⇒ Hash{Symbol=>Object}?

Delete a Smart Link postback

Parameters:

Returns:

  • (Hash{Symbol=>Object}, nil)

See Also:



117
118
119
120
121
122
123
124
# File 'lib/onlyfans/resources/smart_link_postbacks.rb', line 117

def delete(postback_id, params = {})
  @client.request(
    method: :delete,
    path: ["api/smart-link-postbacks/%1$s", postback_id],
    model: Onlyfans::Internal::Type::HashOf[Onlyfans::Internal::Type::Unknown],
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ Onlyfans::Models::SmartLinkPostbackListResponse

List all Smart Link postbacks configured for your Team

Parameters:

Returns:

See Also:



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

def list(params = {})
  @client.request(
    method: :get,
    path: "api/smart-link-postbacks",
    model: Onlyfans::Models::SmartLinkPostbackListResponse,
    options: params[:request_options]
  )
end

#retrieve(postback_id, request_options: {}) ⇒ Onlyfans::Models::SmartLinkPostbackRetrieveResponse

Retrieve a Smart Link postback by ID

Parameters:

Returns:

See Also:



49
50
51
52
53
54
55
56
# File 'lib/onlyfans/resources/smart_link_postbacks.rb', line 49

def retrieve(postback_id, params = {})
  @client.request(
    method: :get,
    path: ["api/smart-link-postbacks/%1$s", postback_id],
    model: Onlyfans::Models::SmartLinkPostbackRetrieveResponse,
    options: params[:request_options]
  )
end

#update(postback_id, conversion_types:, smart_link_scope:, url:, smart_link_ids: nil, request_options: {}) ⇒ Onlyfans::Models::SmartLinkPostbackUpdateResponse

Update a Smart Link postback configuration

Parameters:

  • postback_id (Integer) —

    The postback ID

  • conversion_types (Array<String>) —

    One or more Smart Link conversion types that should trigger this postback.

  • smart_link_scope (Symbol, Onlyfans::Models::SmartLinkPostbackUpdateParams::SmartLinkScope) —

    global or campaign_specific.

  • url (String) —

    The destination URL.

  • smart_link_ids (Array<String>) —

    Smart Link ULIDs. Required when smart_link_scope is campaign_specific.

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

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
# File 'lib/onlyfans/resources/smart_link_postbacks.rb', line 77

def update(postback_id, params)
  parsed, options = Onlyfans::SmartLinkPostbackUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/smart-link-postbacks/%1$s", postback_id],
    body: parsed,
    model: Onlyfans::Models::SmartLinkPostbackUpdateResponse,
    options: options
  )
end