Class: Vk::API::Wall::Methods::Post

Inherits:
Schema::Method show all
Defined in:
lib/vk/api/wall/methods/post.rb

Overview

Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts.

Arguments collapse

Instance Method Summary collapse

Methods inherited from Schema::Method

#call, #method, #to_hash

Constructor Details

#initialize(arguments) ⇒ Wall::Methods::Post

Parameters:

  • arguments (Hash)

Options Hash (arguments):

  • :owner_id (Integer)

    User ID or community ID. Use a negative value to designate a community ID.

  • :friends_only (Boolean)

    '1' — post will be available to friends only; '0' — post will be available to all users (default)

  • :from_group (Boolean)

    For a community:; '1' — post will be published by the community; '0' — post will be published by the user (default)

  • :message (String) — default: Required if 'attachments' is not set.

    Text of the post.

  • :attachments (Array) — default: Required if 'message' is not set.

    List of objects attached to the post, in the following format:; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; 'page' — wiki-page; 'note' — note; 'poll' — poll; 'album' — photo album; '' — ID of the media application owner. ; '' — Media application ID.; ; Example:; "photo100172_166443618,photo66748_265827614"; May contain a link to an external page to include in the post. Example:; "photo66748_265827614,http://habrahabr.ru"; "NOTE: If more than one link is being attached, an error will be thrown."

  • :services (String, 'facebook')

    List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'.

  • :signed (Boolean)

    Only for posts in communities with 'from_group' set to '1':; '1' — post will be signed with the name of the posting user; '0' — post will not be signed (default)

  • :publish_date (Integer)

    Publication date (in Unix time). If used, posting will be delayed until the set time.

  • :lat (Number)

    Geographical latitude of a check-in, in degrees (from -90 to 90).

  • :long (Number)

    Geographical longitude of a check-in, in degrees (from -180 to 180).

  • :place_id (Integer)

    ID of the location where the user was tagged.

  • :post_id (Integer)

    Post ID. Used for publishing of scheduled and suggested posts.

  • :guid (String)
  • :mark_as_ads (Boolean)

# File 'lib/vk/api/wall/methods/post.rb', line 15

Instance Method Details

#attachmentsArray

Returns (Required if 'message' is not set.) List of objects attached to the post, in the following format:; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; 'page' — wiki-page; 'note' — note; 'poll' — poll; 'album' — photo album; '' — ID of the media application owner. ; '' — Media application ID.; ; Example:; "photo100172_166443618,photo66748_265827614"; May contain a link to an external page to include in the post. Example:; "photo66748_265827614,http://habrahabr.ru"; "NOTE: If more than one link is being attached, an error will be thrown.".

Returns:

  • (Array)

    (Required if 'message' is not set.) List of objects attached to the post, in the following format:; ","; '' — Type of media attachment:; 'photo' — photo; 'video' — video; 'audio' — audio; 'doc' — document; 'page' — wiki-page; 'note' — note; 'poll' — poll; 'album' — photo album; '' — ID of the media application owner. ; '' — Media application ID.; ; Example:; "photo100172_166443618,photo66748_265827614"; May contain a link to an external page to include in the post. Example:; "photo66748_265827614,http://habrahabr.ru"; "NOTE: If more than one link is being attached, an error will be thrown."


44
# File 'lib/vk/api/wall/methods/post.rb', line 44

attribute :attachments, API::Types::Coercible::Array.member(API::Types::Coercible::String).optional.default(nil)

#friends_onlyBoolean

Returns '1' — post will be available to friends only; '0' — post will be available to all users (default).

Returns:

  • (Boolean)

    '1' — post will be available to friends only; '0' — post will be available to all users (default)


38
# File 'lib/vk/api/wall/methods/post.rb', line 38

attribute :friends_only, API::Types::Form::Bool.optional.default(nil)

#from_groupBoolean

Returns For a community:; '1' — post will be published by the community; '0' — post will be published by the user (default).

Returns:

  • (Boolean)

    For a community:; '1' — post will be published by the community; '0' — post will be published by the user (default)


40
# File 'lib/vk/api/wall/methods/post.rb', line 40

attribute :from_group, API::Types::Form::Bool.optional.default(nil)

#guidString


60
# File 'lib/vk/api/wall/methods/post.rb', line 60

attribute :guid, API::Types::Coercible::String.optional.default(nil)

#latNumber

Returns Geographical latitude of a check-in, in degrees (from -90 to 90).

Returns:

  • (Number)

    Geographical latitude of a check-in, in degrees (from -90 to 90).


52
# File 'lib/vk/api/wall/methods/post.rb', line 52

attribute :lat, API::Types::Coercible::Int.optional.default(nil)

#longNumber

Returns Geographical longitude of a check-in, in degrees (from -180 to 180).

Returns:

  • (Number)

    Geographical longitude of a check-in, in degrees (from -180 to 180).


54
# File 'lib/vk/api/wall/methods/post.rb', line 54

attribute :long, API::Types::Coercible::Int.optional.default(nil)

#mark_as_adsBoolean


62
# File 'lib/vk/api/wall/methods/post.rb', line 62

attribute :mark_as_ads, API::Types::Form::Bool.optional.default(false)

#messageString

Returns (Required if 'attachments' is not set.) Text of the post.

Returns:

  • (String)

    (Required if 'attachments' is not set.) Text of the post.


42
# File 'lib/vk/api/wall/methods/post.rb', line 42

attribute :message, API::Types::Coercible::String.optional.default(nil)

#owner_idInteger

Returns User ID or community ID. Use a negative value to designate a community ID.

Returns:

  • (Integer)

    User ID or community ID. Use a negative value to designate a community ID.


36
# File 'lib/vk/api/wall/methods/post.rb', line 36

attribute :owner_id, API::Types::Coercible::Int.optional.default(nil)

#place_idInteger

Returns ID of the location where the user was tagged.

Returns:

  • (Integer)

    ID of the location where the user was tagged.


56
# File 'lib/vk/api/wall/methods/post.rb', line 56

attribute :place_id, API::Types::Coercible::Int.optional.default(nil)

#post_idInteger

Returns Post ID. Used for publishing of scheduled and suggested posts.

Returns:

  • (Integer)

    Post ID. Used for publishing of scheduled and suggested posts.


58
# File 'lib/vk/api/wall/methods/post.rb', line 58

attribute :post_id, API::Types::Coercible::Int.optional.default(nil)

#publish_dateInteger

Returns Publication date (in Unix time). If used, posting will be delayed until the set time.

Returns:

  • (Integer)

    Publication date (in Unix time). If used, posting will be delayed until the set time.


50
# File 'lib/vk/api/wall/methods/post.rb', line 50

attribute :publish_date, API::Types::Coercible::Int.optional.default(nil)

#servicesString, 'facebook'

Returns List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'.

Returns:

  • (String, 'facebook')

    List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'.


46
# File 'lib/vk/api/wall/methods/post.rb', line 46

attribute :services, API::Types::Coercible::String.optional.default(nil)

#signedBoolean

Returns Only for posts in communities with 'from_group' set to '1':; '1' — post will be signed with the name of the posting user; '0' — post will not be signed (default).

Returns:

  • (Boolean)

    Only for posts in communities with 'from_group' set to '1':; '1' — post will be signed with the name of the posting user; '0' — post will not be signed (default)


48
# File 'lib/vk/api/wall/methods/post.rb', line 48

attribute :signed, API::Types::Form::Bool.optional.default(nil)