def api_representation(self, content_type):
payload = dict(Subject=self.subject, Body=dict(ContentType=content_type, Content=self.body))<EOL>if self.sender is not None:<EOL><INDENT>payload.update(From=self.sender.api_representation())<EOL><DEDENT>if any(isinstance(item, str) for item in self.to):<EOL><INDENT>self.to = [Contact(email=email) for email in self.to]<EOL><DEDENT>recipients = [contact.api_representation() for contact in self.to]<EOL>payload.update(ToRecipients=recipients)<EOL>if self.cc:<EOL><INDENT>if any(isinstance(email, str) for email in self.cc):<EOL><INDENT>self.cc = [Contact(email) for email in self.cc]<EOL><DEDENT>cc_recipients = [contact.api_representation() for contact in self.cc]<EOL>payload.update(CcRecipients=cc_recipients)<EOL><DEDENT>if self.bcc:<EOL><INDENT>if any(isinstance(email, str) for email in self.bcc):<EOL><INDENT>self.bcc = [Contact(email) for email in self.bcc]<EOL><DEDENT>bcc_recipients = [contact.api_representation() for contact in self.bcc]<EOL>payload.update(BccRecipients=bcc_recipients)<EOL><DEDENT>if self._attachments:<EOL><INDENT>payload.update(Attachments=[attachment.api_representation() for attachment in self._attachments])<EOL><DEDENT>payload.update(Importance=str(self.importance))<EOL>return dict(Message=payload)<EOL>
Returns the JSON representation of this message required for making requests to the API.

        Args:
            content_type (str): Either 'HTML' or 'Text'