Responsible for authenticating users against the Yammer API.
The OAuth2 authentication process involves several steps:
Initializes a new Authenticator. The client_id and client_secret identify your application, you acquire them when registering your application with Yammer. See http://www.yammer.com/client_applications
Keyword arguments can be used to modify the URLs generated in this class, e.g. to avoid hitting the live API from a client application’s test suite. Pass None to use the default URLs.
Returns the URL the user needs to visit to grant your application access to their Yammer account. When they are done they will be redirected to the redirect_uri you provide with a code that can be exchanged for an access token.
Returns the complete response from the Yammer API access token request. This is a dict with “user”, “network” and “access_token” keys.
You can access the token itself as: response.access_token.token
If you only intend to make use of the token, you can use the fetch_access_token method instead for convenience.
Convenience method to exchange a code for an access token, discarding the other user and network data that the Yammer API returns with the access token.
If you require user and network information, you should use the fetch_access_data method instead.
Main entry point for accessing the Yammer API.
Essentially this is just a Factory class that provides instances of various classes that interact directly with the API. For example, the messages method returns a MessagesAPI object.
Initialize a new Yammer instance.
Returns a yampy.client.Client object which can be used to make HTTP requests to any of the Yammer REST API endpoints.
You should use this if there isn’t a more specific interface available for the request you want to make, e.g. if you want to request users you should use the users method instead of the client method.
Returns a yampy.apis.MessagesAPI object which can be used to call the Yammer API’s message-related endpoints.
Returns a yampy.apis.UsersAPI object which can be used to call the Yammer API’s user-related endpoints.
Provides an interface for accessing the message related endpoints of the Yammer API. You should not instantiate this class directly; use the yampy.Yammer.messages() method instead.
Initializes a new MessagesAPI that will use the given client object to make HTTP requests.
Returns public messages from the current user’s network.
Customize the response using the keyword arguments:
Posts a new message to Yammer. Returns the new message in the same format as the various message listing methods (all(), sent(), etc.).
The following keyword arguments are supported:
group_id – Send this message to the group identified by group_id.
replied_to_id – This message is a reply to the message identified by replied_to_id.
direct_to_id – Send this as a direct message to the user identified by direct_to_id.
topics – A list of topics for the message. Topics should be given as strings. There cannot be more than 20 topics for one message.
broadcast – Set this to True to send a broadcast message. Only network admins have permission to send broadcast messages.
open_graph_object – A dict describing an open graph object to attach to the message. It supports the following keys:
- url (required)
- title
- image
- description
- object_type
- site_name
- fetch (set to True to derive other OG data from the URL)
- meta (for custom structured data)
Deletes the message identified by message_id.
Emails the message identified by message_id to the authenticated user.
Returns the message identified by the given message_id.
Returns messages from users the current user follows, or groups the current user belongs to.
See the all() method for a description of the keyword arguments.
Returns messages from the current user’s feed. This will either correspond to from_top_conversations() or from_followed_conversations() depending on the user’s settings.
See the all() method for a description of the keyword arguments.
Returns messages from the current user’s top conversations.
See the all() method for a description of the keyword arguments.
Returns messages that were posted by the user identified by user_id.
See the all() method for a description of the keyword arguments.
Returns messages that belong to the thread identified by thread_id.
See the all() method for a description of the keyword arguments.
The current user likes the message identified by message_id.
Returns of the private messages received by the current user.
See the all() method for a description of the keyword arguments.
Returns messages received by the current user.
See the all() method for a description of the keyword arguments.
Returns of the current user’s sent messages.
See the all() method for a description of the keyword arguments.
Removes the current user’s “like” from the message identified by message_id.
Provides an interface for accessing the user related endpoints of the Yammer API. You should not instantiate this class directly; use the yampy.Yammer.users() method instead.
Initializes a new UsersAPI that will use the given client object to make HTTP requests.
Returns all the users in the current user’s network.
Customize the response using the keyword arguments:
Creates a new user.
Most of the parameter names are self explanatory, and accept strings. A few expect specific formats:
Delete the user identified by user_id.
Returns the user identified by the given user_id.
Returns the user identified by the given email_address.
Returns the current user.
Returns all the users belonging to the group identified by the given group_id.
Use the page parameter to enable pagination and retrieve a specific page of users.
Suspend the user identified by user_id.
Updates the user identified by the given user_id.
For more information on parameter formats, see the create() method.
A client for the Yammer API.
Makes an HTTP DELETE request to the Yammer API.
The path should be the path of an API endpoint, e.g. “/messages/123”
Makes an HTTP GET request to the Yammer API. Any keyword arguments will be converted to query string parameters.
The path should be the path of an API endpoint, e.g. “/messages”
Makes an HTTP POST request to the Yammer API. Any keyword arguments will be sent as the body of the request.
The path should be the path of an API endpoint, e.g. “/messages”
Makes an HTTP PUT request to the Yammer API. Any keyword arguments will be sent as the body of the request.
The path should be the path of an API endpoint, e.g. “/users/123”
A dict subclass that provides access to its members as if they were attributes.
Note that an attribute that has the same name as one of dict’s existing method (keys, items, etc.) will not be accessible as an attribute.
Parses the given json_string, returning GenericModel instances instead of dicts.
Exception classes representing error responses from the Yammer API.
Raised when a request is made with an access token that has expired or has been revoked by the user.
Raised when creating a user with an education record that doesn’t include all of the requried information.
Super class for the various kinds of errors that can occur when creating a message.
Raised when an invalid Open Graph object is attached to a new message.
Raised when creating a user with a previous_companies record that doesn’t include all of the required fields.
Super class for the various kinds of errors that can occur when creating a user.
Raised when the Yammer API responds with an HTTP 404 Not Found error.
Raised when a request is rejected because the rate limit has been exceeded.
Raised when the Yammer API responds with an HTTP error, and there isn’t a more specific subclass that represents the situation.
Raised when a message cannot be created because too many topics have been specified.
Raised when the Yammer API responds with an HTTP 401 Unauthorized error. This may mean that the access token you are using is invalid.