<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subscribe_registration_ids_to_topic(self, registration_ids, topic_name):
 """ Subscribes a list of registration ids to a topic Args: registration_ids (list):
 ids to be subscribed topic_name (str):
 name of topic Returns: True: if operation succeeded Raises: InvalidDataError: data sent to server was incorrectly formatted FCMError: an error occured on the server """

        url = 'https://iid.googleapis.com/iid/v1:batchAdd'
        payload = {
            'to': '/topics/' + topic_name,
            'registration_tokens': registration_ids,
        }
        response = self.requests_session.post(url, json=payload)
        if response.status_code == 200:
            return True
        elif response.status_code == 400:
            error = response.json()
            raise InvalidDataError(error['error'])
        else:
            raise FCMError()