It's hard for me to read all of these arguments. Can you use a map for them first and then serialize them to be urlparams? ie

    var urlparams = {
      id: 368,
      format: 'ics',
      ...
    };

    url += someUrlParamSerializer.serialize(urlparams);