Direct messages

direct_messages.new(server_url, text, *, user_id=None, screen_name=None, username='', password='', oauth={})

Sends a new direct message to the specified user from the authenticating user.

Parameters:
  • server_url (str) – URL of the server
  • text (str) – text of your message
  • user_id (int) – (optional) the ID of the recipient
  • screen_name (str) – (optional) the handle of the recipient
  • username (str) – (optional) name of the authenticating user
  • password (str) – (optional) password of the authenticating user
  • oauth (dict) – (optional) OAuth dict
Return type:

dict

Returns:

Direct message dict

direct_messages.sent(server_url, *, since_id=None, max_id=None, count=20, username='', password='', oauth={})

Returns the 20 most recent direct messages sent by the authenticating user. You can request up to 200 direct messages per call, and only the most recent 200 DMs will be available using this endpoint.

Parameters:
  • server_url (str) – URL of the server
  • since_id (int) – (optional) returns direct messages with an ID greater than (that is, more recent than) the specified ID
  • max_id (int) – (optional) returns direct messages with an ID less than (that is, older than) or equal to the specified ID
  • count (int) – (optional) number of direct messages to try and retrieve
  • username (str) – (optional) name of the authenticating user
  • password (str) – (optional) password of the authenticating user
  • oauth (dict) – (optional) OAuth dict
Return type:

list

Returns:

a list of direct message dicts

direct_messages.received(server_url, *, since_id=None, max_id=None, count=20, username='', password='', oauth={})

Returns the 20 most recent direct messages sent to the authenticating user. You can request up to 200 direct messages per call, and only the most recent 200 DMs will be available using this endpoint.

Parameters:
  • server_url (str) – URL of the server
  • since_id (int) – (optional) returns direct messages with an ID greater than (that is, more recent than) the specified ID
  • max_id (int) – (optional) returns direct messages with an ID less than (that is, older than) or equal to the specified ID
  • count (int) – (optional) number of direct messages to try and retrieve
  • username (str) – (optional) name of the authenticating user
  • password (str) – (optional) password of the authenticating user
  • oauth (dict) – (optional) OAuth dict
Return type:

list

Returns:

a list of direct message dicts