def checkKey(self, key=None):
<EOL>url = Client.ENDPOINT.format('<STR_LIT>')<EOL>if not key: key = self.apiKey<EOL>params = {<EOL>'<STR_LIT>': key or self.apiKey<EOL>}<EOL>returned = get(url, params=params)<EOL>self.checkResponse(returned)<EOL>root = ET.fromstring(returned.text)<EOL>if root.text == '<STR_LIT:OK>':<EOL><INDENT>return True<EOL><DEDENT>raise InvalidApiKey('<STR_LIT>'.format(key))<EOL>
Checks that an API key is valid.

:param str key: (optional) A key that you want to check the validity of. Defaults to the one provided on initialization.
:returns: If the key is valid, this method will return ``True``.
:rtype: `bool`
:raises: :class:`brickfront.errors.InvalidApiKey`