Class: Vk::API::Secure

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/secure/level.rb,
lib/vk/api/secure/transaction.rb,
lib/vk/api/secure/token_checked.rb,
lib/vk/api/secure/sms_notification.rb,
lib/vk/api/secure/methods/check_token.rb,
lib/vk/api/secure/methods/set_counter.rb,
lib/vk/api/secure/methods/add_app_event.rb,
lib/vk/api/secure/methods/get_user_level.rb,
lib/vk/api/secure/methods/set_user_level.rb,
lib/vk/api/secure/methods/get_app_balance.rb,
lib/vk/api/secure/methods/get_sms_history.rb,
lib/vk/api/secure/methods/send_notification.rb,
lib/vk/api/secure/methods/send_sms_notification.rb,
lib/vk/api/secure/responses/check_token_response.rb,
lib/vk/api/secure/responses/set_counter_response.rb,
lib/vk/api/secure/methods/get_transactions_history.rb,
lib/vk/api/secure/responses/add_app_event_response.rb,
lib/vk/api/secure/responses/get_user_level_response.rb,
lib/vk/api/secure/responses/set_user_level_response.rb,
lib/vk/api/secure/responses/get_app_balance_response.rb,
lib/vk/api/secure/responses/get_sms_history_response.rb,
lib/vk/api/secure/responses/send_notification_response.rb,
lib/vk/api/secure/responses/send_sms_notification_response.rb,
lib/vk/api/secure/responses/get_transactions_history_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Level, SmsNotification, TokenChecked, Transaction

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

#add_app_event(arguments = {}) ⇒ Vk::API::Secure::Responses::AddAppEventResponse

Returns Adds user activity information to an application.

Parameters:

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

Options Hash (arguments):

  • :user_id (Integer)

    ID of a user to save the data

  • :activity_id (Integer)

    there are 2 default activities: ; * 1 – level. Works similar to ;; * 2 – points, saves points amount; Any other value is for saving completed missions

  • :value (Integer)

    depends on activity_id:; * 1 – number, current level number;; * 2 – number, current user's points amount; ; Any other value is ignored

Returns:

See Also:



1631
1632
1633
1634
1635
1636
1637
# File 'lib/vk/api/methods.rb', line 1631

def add_app_event(arguments = {})
  require "vk/api/secure/methods/add_app_event"
  method = Methods::AddAppEvent.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/add_app_event_response"
  Responses::AddAppEventResponse.new(response.deep_symbolize_keys)
end

#check_token(arguments = {}) ⇒ Vk::API::Secure::Responses::CheckTokenResponse

Returns Checks the user authentification in 'IFrame' and 'Flash' apps using the 'access_token' parameter.

Parameters:

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

Options Hash (arguments):

  • :token (String)

    client 'access_token'

  • :ip (String)

    user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is required to transmit the 'ipv6' address. ; If not transmitted, the address will not be checked.

Returns:

See Also:



1643
1644
1645
1646
1647
1648
1649
# File 'lib/vk/api/methods.rb', line 1643

def check_token(arguments = {})
  require "vk/api/secure/methods/check_token"
  method = Methods::CheckToken.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/check_token_response"
  Responses::CheckTokenResponse.new(response.deep_symbolize_keys)
end

#get_app_balance(arguments = {}) ⇒ Vk::API::Secure::Responses::GetAppBalanceResponse

Returns payment balance of the application in hundredth of a vote.

Parameters:

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

Returns:

See Also:



1532
1533
1534
1535
1536
1537
1538
# File 'lib/vk/api/methods.rb', line 1532

def get_app_balance(arguments = {})
  require "vk/api/secure/methods/get_app_balance"
  method = Methods::GetAppBalance.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/get_app_balance_response"
  Responses::GetAppBalanceResponse.new(response.deep_symbolize_keys)
end

#get_sms_history(arguments = {}) ⇒ Vk::API::Secure::Responses::GetSmsHistoryResponse

Returns Shows a list of SMS notifications sent by the application using method.

Parameters:

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

Options Hash (arguments):

  • :user_id (Integer)
  • :date_from (Integer)

    filter by start date. It is set as UNIX-time.

  • :date_to (Integer)

    filter by end date. It is set as UNIX-time.

  • :limit (Integer) — default: 1000

    number of returned posts. By default — 1000.

Returns:

See Also:



1556
1557
1558
1559
1560
1561
1562
# File 'lib/vk/api/methods.rb', line 1556

def get_sms_history(arguments = {})
  require "vk/api/secure/methods/get_sms_history"
  method = Methods::GetSmsHistory.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/get_sms_history_response"
  Responses::GetSmsHistoryResponse.new(response.deep_symbolize_keys)
end

#get_transactions_history(arguments = {}) ⇒ Vk::API::Secure::Responses::GetTransactionsHistoryResponse

Returns Shows history of votes transaction between users and the application.

Parameters:

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

Returns:

See Also:



1542
1543
1544
1545
1546
1547
1548
# File 'lib/vk/api/methods.rb', line 1542

def get_transactions_history(arguments = {})
  require "vk/api/secure/methods/get_transactions_history"
  method = Methods::GetTransactionsHistory.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/get_transactions_history_response"
  Responses::GetTransactionsHistoryResponse.new(response.deep_symbolize_keys)
end

#get_user_level(arguments = {}) ⇒ Vk::API::Secure::Responses::GetUserLevelResponse

Returns one of the previously set game levels of one or more users in the application.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1618
1619
1620
1621
1622
1623
1624
# File 'lib/vk/api/methods.rb', line 1618

def get_user_level(arguments = {})
  require "vk/api/secure/methods/get_user_level"
  method = Methods::GetUserLevel.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/get_user_level_response"
  Responses::GetUserLevelResponse.new(response.deep_symbolize_keys)
end

#send_notification(arguments = {}) ⇒ Vk::API::Secure::Responses::SendNotificationResponse

Returns Sends notification to the user.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1581
1582
1583
1584
1585
1586
1587
# File 'lib/vk/api/methods.rb', line 1581

def send_notification(arguments = {})
  require "vk/api/secure/methods/send_notification"
  method = Methods::SendNotification.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/send_notification_response"
  Responses::SendNotificationResponse.new(response.deep_symbolize_keys)
end

#send_sms_notification(arguments = {}) ⇒ Vk::API::Secure::Responses::SendSmsNotificationResponse

Returns Sends 'SMS' notification to a user's mobile device.

Parameters:

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

Options Hash (arguments):

  • :user_id (Integer)

    ID of the user to whom SMS notification is sent. The user shall allow the application to send him/her notifications (, +1).

  • :message (String)

    'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are allowed. Maximum size is '160' characters.

Returns:

See Also:



1568
1569
1570
1571
1572
1573
1574
# File 'lib/vk/api/methods.rb', line 1568

def send_sms_notification(arguments = {})
  require "vk/api/secure/methods/send_sms_notification"
  method = Methods::SendSmsNotification.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/send_sms_notification_response"
  Responses::SendSmsNotificationResponse.new(response.deep_symbolize_keys)
end

#set_counter(arguments = {}) ⇒ Vk::API::Secure::Responses::SetCounterResponse

Returns Sets a counter which is shown to the user in bold in the left menu.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1594
1595
1596
1597
1598
1599
1600
# File 'lib/vk/api/methods.rb', line 1594

def set_counter(arguments = {})
  require "vk/api/secure/methods/set_counter"
  method = Methods::SetCounter.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/set_counter_response"
  Responses::SetCounterResponse.new(response.deep_symbolize_keys)
end

#set_user_level(arguments = {}) ⇒ Vk::API::Secure::Responses::SetUserLevelResponse

Returns Sets user game level in the application which can be seen by his/her friends.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1607
1608
1609
1610
1611
1612
1613
# File 'lib/vk/api/methods.rb', line 1607

def set_user_level(arguments = {})
  require "vk/api/secure/methods/set_user_level"
  method = Methods::SetUserLevel.new(arguments)
  response = method.call(@client)
  require "vk/api/secure/responses/set_user_level_response"
  Responses::SetUserLevelResponse.new(response.deep_symbolize_keys)
end