Messages¶
The methods available in the Messages module give you the ability to list the messages in your global or user library, and to get a messages name, category, and ID.
List Messages¶
-
Messages.
list_messages
(library=None)¶ This method gets the all of the messages available to a user in a given library. Messages are defined based on the library (User-Deifined or Global) that they exist within. Thus, in order to list the messages availble to your user account, you need to specify the library that the api must look within. There can exist several different categories of messages. These include, ‘invite’, ‘inactiveSurvey’, ‘reminder’, ‘thankYou’, ‘smsInvite’, ‘validation’, ‘emailSubject’, ‘general’, ‘lookAndFeel’, and ‘endOfSurvey’. This method returns all the types of these, if they exist.
- Parameters
library (str) – The (Global or User) Library ID which the messages are located within.
- Returns
A Pandas DataFrame
Example Implementation¶
Here is an example on how to implement the list_messages() method, which is a method that list all the messages available to a user within a specified library. Here we call the list_messages method and pass in either a global or user library as an argument to the library parameter.
#Setup your Credentials, if not already done.
#You only have to do this once.
#Import the module
from QualtricsAPI.Library import Messages
#Create an instance
m = Messages()
#Call the method
m.list_messages(library="GR_ThisIsaFakeID!!")
This will return a Pandas DataFrame like the one below.
MessageID MessageDescription MessageCategory LibraryID
0 MS_ThisIsMSFakeID1 Survey-Invite invite GR_ThisIsaFakeID!!
1 MS_ThisIsMSFakeID2 Survey-Reminder invite GR_ThisIsaFakeID!!
Get a Message¶
-
Messages.
get_message
(library=None, message=None)¶ This method gets the messages available to a user in a given library. Messages are defined based on the library (User-Deifined or Global) that they exist within. Thus, in order to query the correct message we must pass the associated libraryID into the library parameter, along with the MessageID into the message parameter. There can exist several different categories of messages. These include, ‘invite’, ‘inactiveSurvey’, ‘reminder’, ‘thankYou’, ‘smsInvite’, ‘validation’, ‘emailSubject’, ‘general’, ‘lookAndFeel’, and ‘endOfSurvey’. This method returns any type of these, if they exist.
- Parameters
library (str) – The (Global or User) Library ID which the messages are located within.
message (str) – The Message ID corresponding specific message.
- Returns
A tuple containing the MessageID, MessageCategory, and MessageDescription
Example Implementation¶
Here is an example on how to implement the get_message() method, which is returns three pieces of information about a given message.
#Setup your Credentials, if not already done.
#You only have to do this once.
#Import the module
from QualtricsAPI.Library import Messages
#Create an instance
m = Messages()
#Call the method
m.get_message(library="GR_ThisIsaFakeID!!", message="MS_ThisIsMSFakeID2")
Calling this method will return a tuple containing three pieces of information about the message. It contains the message ID, the Message Category (invite, reminder, etc.), and the Message Name.
(MS_ThisIsMSFakeID2, reminder, Survey-Reminder)