Module: YammerApi::Api::Feed

Includes:
Helper
Included in:
Client
Defined in:
lib/yammer_api/api/feed.rb

Instance Method Summary collapse

Methods included from Helper

#params

Instance Method Details

#about_topic(id, options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Messages that have the topic with given ID. Corresponds to the messages on a topic’s page on the website.

Examples:

Return the messages in topic with ID 1234567

Yammer.about_topic(1234567)

Parameters:

  • id (Integer)

    A topic ID

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



146
147
148
149
# File 'lib/yammer_api/api/feed.rb', line 146

def about_topic(id, options={})
  path = "/messages/about_topic/#{id}.json" + params(options).to_s
  get_and_parse_posts path, options
end

#direct_messages(options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Private Messages (aka Direct Messages) for the logged-in user. Corresponds to the “Direct Messages” section on the website.

Examples:

Return the 20 most recent private messages

Yammer.direct_messages

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



83
84
85
86
# File 'lib/yammer_api/api/feed.rb', line 83

def direct_messages(options={})
  path = "/messages/private.json" + params(options).to_s
  get_and_parse_dms path, options
end

#messages(options = {}) ⇒ Yammer::Post

Note:

Developers should note that a strict rate limit is applied to all API requests, so clients should never poll for new messages more frequently than every 30 seconds to ensure that the user is still able to use the API for posting messages, etc.

Returns the 20 most recent messages in this network. Corresponds to the “Company Feed” tab on the website.

Examples:

Return the 20 most recent messages in this network.

Yammer.messages

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



22
23
24
25
# File 'lib/yammer_api/api/feed.rb', line 22

def messages(options={})
  path = "/messages.json" + params(options).to_s
  get_and_parse_posts path, options
end

#messages_from(id, options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Messages sent by the user with the given ID. Corresponds to the messages on a user profile page on the website.

Examples:

Return the 20 most recent messages from the user

Yammer.messages_from("bruno")

Parameters:

  • id (Integer, String)

    A user ID or screen name.

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



125
126
127
128
# File 'lib/yammer_api/api/feed.rb', line 125

def messages_from(id, options={})
  path = "/messages/from_user/#{id}.json" + params(options).to_s
  get_and_parse_posts path, options
end

#messages_received(options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Messages received by the logged-in user. Corresponds to the “Received” tab on the website.

Examples:

Return the 20 most recent received messages

Yammer.messages_received

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



63
64
65
66
# File 'lib/yammer_api/api/feed.rb', line 63

def messages_received(options={})
  path = "/messages/received.json" + params(options).to_s
  get_and_parse_posts path, options
end

#messages_sent(options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Returns the 20 sent messages by the current logged in user. Alias for ‘/api/v1/messages/from_user/logged-in_user_id.format`. Corresponds to the “Sent” tab on the website.

Examples:

Return the 20 most recent sent messages

Yammer.messages_sent

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



43
44
45
46
# File 'lib/yammer_api/api/feed.rb', line 43

def messages_sent(options={})
  path = "/messages/sent.json" + params(options).to_s
  get_and_parse_posts path, options
end

#my_feed(options = {}) ⇒ Yammer::Post

Note:

Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.

Messages followed by the logged-in user. Corresponds to the “My Feed” tab on the website.

Examples:

Return the 20 most recent received messages in my feed

Yammer.my_feed

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :threaded (String)

    Accepts true or extended. When true, will only return the first message in each thread. This parameter is intended for applications which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on our website.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



103
104
105
106
107
# File 'lib/yammer_api/api/feed.rb', line 103

def my_feed(options={})
  #response = get('messages/following', options, :json)
  path = "/messages/following.json" + params(options).to_s
  get_and_parse_posts path, options
end

#thread(id, options = {}) ⇒ Yammer::Post

Note:

Does not accept the threaded parameter.

Messages in the thread with the given ID. Corresponds to the page you’d see when clicking on “in reply to” on the website.

Examples:

Return the messages in the thread with ID 1234567

Yammer.thread(1234567)

Parameters:

  • id (Integer)

    A thread ID

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

    A customizable set of options.

Options Hash (options):

  • :older_than (Integer)

    Returns only messages older than the message ID specified. This is useful for paginating messages.

  • :newer_than (Integer)

    Return only messages newer than the message ID specified. This should always be used when polling for new messages.

  • :limit (Integer)

    Return only the specified number of messages. Works for ‘threaded=true` and `threaded=extended`.

Returns:

  • (Yammer::Post)

See Also:



166
167
168
169
# File 'lib/yammer_api/api/feed.rb', line 166

def thread(id, options={})
  path = "/messages/in_thread/#{id}.json" + params(options).to_s
  get_and_parse_posts path, options
end