def get_session_id(result):
    """Returns the Session ID for an API result.

    When there's no Session ID, returns None.
    """
    try:
        return result["header"]["header"]["SessionId"]
    except TypeError:
        return None