Module: AngellistApi::Client::Messages

Included in:
AngellistApi::Client
Defined in:
lib/angellist_api/client/messages.rb

Overview

Defines methods related to URLs

Instance Method Summary collapse

Instance Method Details

#get_messages(options = {}) ⇒ Object

Returns threads that the authenticated user is involved in. A “thread” is a conversation between two users, where each message is tagged with the same thread_id. If the authenticated user has any unread messages in the thread, the viewed attribute will be false. Requires scope “message”.

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :view (String)

    One of inbox, unread or sent. Defaults to inbox. The inbox view returns all threads in which the user has received at least one message. The unread view is a subset of the inbox view which only includes threads with an unread message. The sent view returns all threads in which the user has sent at least one message.

  • :thread_id (Integer)

    Returns the messages for the given thread that the authenticated user is involved in. The viewed attribute will be present for messages that were sent to the authenticated user. Messages are paginated and ordered by message timestamp descending. Requires scope “message”.



27
28
29
# File 'lib/angellist_api/client/messages.rb', line 27

def get_messages(options={})
  get("1/messages", options)
end

#post_messages(options = {}) ⇒ Object

Creates a new message from the authenticated user to the other participant of the given thread. Returns the new message on success. Requires scope “message”.

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :recipient_id (Integer)

    The id of the user receiving the message

  • :thread_id (Integer)

    The id of the thread that you want the message to be attached to.

  • :body (String)

    The body of the message.



41
42
43
# File 'lib/angellist_api/client/messages.rb', line 41

def post_messages(options={})
  post("1/messages", options)
end