Class: Vk::API::Leads

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/leads/lead.rb,
lib/vk/api/leads/entry.rb,
lib/vk/api/leads/start.rb,
lib/vk/api/leads/checked.rb,
lib/vk/api/leads/complete.rb,
lib/vk/api/leads/methods/start.rb,
lib/vk/api/leads/methods/complete.rb,
lib/vk/api/leads/methods/get_stats.rb,
lib/vk/api/leads/methods/get_users.rb,
lib/vk/api/leads/methods/check_user.rb,
lib/vk/api/leads/methods/metric_hit.rb,
lib/vk/api/leads/responses/start_response.rb,
lib/vk/api/leads/responses/complete_response.rb,
lib/vk/api/leads/responses/get_stats_response.rb,
lib/vk/api/leads/responses/get_users_response.rb,
lib/vk/api/leads/responses/check_user_response.rb,
lib/vk/api/leads/responses/metric_hit_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Checked, Complete, Entry, Lead, Start

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#check_user(arguments = {}) ⇒ Vk::API::Leads::Responses::CheckUserResponse

Returns Checks if the user can start the lead.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :lead_id (Integer)

    Lead ID.

  • :test_result (Integer)

    Value to be return in 'result' field when test mode is used.

  • :age (Integer)

    User age.

  • :country (String)

    User country code.

Returns:

See Also:



2173
2174
2175
2176
2177
2178
2179
# File 'lib/vk/api/methods.rb', line 2173

def check_user(arguments = {})
  require "vk/api/leads/methods/check_user"
  method = Methods::CheckUser.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/check_user_response"
  Responses::CheckUserResponse.new(response.deep_symbolize_keys)
end

#complete(arguments = {}) ⇒ Vk::API::Leads::Responses::CompleteResponse

Returns Completes the lead started by user.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :vk_sid (String)

    Session obtained as GET parameter when session started.

  • :secret (String)

    Secret key from the lead testing interface.

  • :comment (String)

    Comment text.

Returns:

See Also:



2117
2118
2119
2120
2121
2122
2123
# File 'lib/vk/api/methods.rb', line 2117

def complete(arguments = {})
  require "vk/api/leads/methods/complete"
  method = Methods::Complete.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/complete_response"
  Responses::CompleteResponse.new(response.deep_symbolize_keys)
end

#get_stats(arguments = {}) ⇒ Vk::API::Leads::Responses::GetStatsResponse

Returns lead stats data.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :lead_id (Integer)

    Lead ID.

  • :secret (String)

    Secret key obtained from the lead testing interface.

  • :date_start (String)

    Day to start stats from (YYYY_MM_DD, e.g.2011-09-17).

  • :date_end (String)

    Day to finish stats (YYYY_MM_DD, e.g.2011-09-17).

Returns:

See Also:



2143
2144
2145
2146
2147
2148
2149
# File 'lib/vk/api/methods.rb', line 2143

def get_stats(arguments = {})
  require "vk/api/leads/methods/get_stats"
  method = Methods::GetStats.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/get_stats_response"
  Responses::GetStatsResponse.new(response.deep_symbolize_keys)
end

#get_users(arguments = {}) ⇒ Vk::API::Leads::Responses::GetUsersResponse

Returns a list of last user actions for the offer.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :offer_id (Integer)

    Offer ID.

  • :secret (String)

    Secret key obtained in the lead testing interface.

  • :offset (Integer)

    Offset needed to return a specific subset of results.

  • :count (Integer) — default: 100

    Number of results to return.

  • :status (Integer)

    Action type. Possible values:; *'0' — start;; *'1' — finish;; *'2' — blocking users;; *'3' — start in a test mode;; *'4' — finish in a test mode.;

  • :reverse (Boolean)

    Sort order. Possible values:; *'1' — chronological;; *'0' — reverse chronological.

Returns:

See Also:



2159
2160
2161
2162
2163
2164
2165
# File 'lib/vk/api/methods.rb', line 2159

def get_users(arguments = {})
  require "vk/api/leads/methods/get_users"
  method = Methods::GetUsers.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/get_users_response"
  Responses::GetUsersResponse.new(response.deep_symbolize_keys)
end

#metric_hit(arguments = {}) ⇒ Vk::API::Leads::Responses::MetricHitResponse

Returns Counts the metric event.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :data (String)

    Metric data obtained in the lead interface.

Returns:

See Also:



2184
2185
2186
2187
2188
2189
2190
# File 'lib/vk/api/methods.rb', line 2184

def metric_hit(arguments = {})
  require "vk/api/leads/methods/metric_hit"
  method = Methods::MetricHit.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/metric_hit_response"
  Responses::MetricHitResponse.new(response.deep_symbolize_keys)
end

#start(arguments = {}) ⇒ Vk::API::Leads::Responses::StartResponse

Returns Creates new session for the user passing the offer.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :lead_id (Integer)

    Lead ID.

  • :secret (String)

    Secret key from the lead testing interface.

Returns:

See Also:



2129
2130
2131
2132
2133
2134
2135
# File 'lib/vk/api/methods.rb', line 2129

def start(arguments = {})
  require "vk/api/leads/methods/start"
  method = Methods::Start.new(arguments)
  response = method.call(@client)
  require "vk/api/leads/responses/start_response"
  Responses::StartResponse.new(response.deep_symbolize_keys)
end