class Odesk::Api::Routers::Mc
Constants
- ENTRY_POINT
Public Class Methods
new(client)
click to toggle source
Init
Arguments:
client: (Client)
# File lib/odesk/api/routers/mc.rb, line 24 def initialize(client) @client = client @client.epoint = ENTRY_POINT end
Public Instance Methods
get_thread_by_context(username, job_key, application_id, context = 'Interviews')
click to toggle source
Get a specific thread by context
Arguments:
username: (String) job_key: (String) application_id: (String) context: (String)
# File lib/odesk/api/routers/mc.rb, line 62 def get_thread_by_context(username, job_key, application_id, context = 'Interviews') $LOG.i "running " + __method__.to_s @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id end
get_thread_by_context_last_posts(username, job_key, application_id, context = 'Interviews')
click to toggle source
Get a specific thread by context (last message content)
Arguments:
username: (String) job_key: (String) application_id: (String) context: (String)
# File lib/odesk/api/routers/mc.rb, line 74 def get_thread_by_context_last_posts(username, job_key, application_id, context = 'Interviews') $LOG.i "running " + __method__.to_s @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id + '/last_posts' end
get_thread_details(username, thread_id)
click to toggle source
List thread details based on thread id
Arguments:
username: (String) thread_id: (String)
# File lib/odesk/api/routers/mc.rb, line 50 def get_thread_details(username, thread_id) $LOG.i "running " + __method__.to_s @client.get '/mc/v1/threads/' + username + '/' + thread_id end
get_tray_by_type(username, type)
click to toggle source
Get tray by type
Arguments:
username: (String) type: (String)
# File lib/odesk/api/routers/mc.rb, line 40 def get_tray_by_type(username, type) $LOG.i "running " + __method__.to_s @client.get '/mc/v1/trays/' + username + '/' + type end
get_trays()
click to toggle source
Get trays
# File lib/odesk/api/routers/mc.rb, line 30 def get_trays $LOG.i "running " + __method__.to_s @client.get '/mc/v1/trays' end
mark_thread(username, thread_id, params = {})
click to toggle source
Update threads based on user actions
Arguments:
username: (String) thread_id: (String) params: (Hash)
# File lib/odesk/api/routers/mc.rb, line 106 def mark_thread(username, thread_id, params = {}) $LOG.i "running " + __method__.to_s @client.put '/mc/v1/threads/' + username + '/' + thread_id, params end
reply_to_thread(username, thread_id, params = {})
click to toggle source
Reply to existent thread
Arguments:
username: (String) thread_id: (String) params: (Hash)
# File lib/odesk/api/routers/mc.rb, line 95 def reply_to_thread(username, thread_id, params = {}) $LOG.i "running " + __method__.to_s @client.post '/mc/v1/threads/' + username + '/' + thread_id, params end
start_new_thread(username, params = {})
click to toggle source
Send new message
Arguments:
username: (String) params: (Hash)
# File lib/odesk/api/routers/mc.rb, line 84 def start_new_thread(username, params = {}) $LOG.i "running " + __method__.to_s @client.post '/mc/v1/threads/' + username, params end