This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bulk change of privacy settings for past activities

If I change my privacy settings for activities from public to private or vice versa, and want to also change the setting for past activities, there is no easy way to do it. When I select Quick Edit on Activities, there's a Privacy column, with a tick at the top to select all activities in the column, but the only way to change the privacy setting for all activities is to click on each individual activity padlock icon in turn and change them one by one. It would be very useful to be able to change all of them with one click.
  • OK, it works now. If you replace lines 236 to 269 from the script above with lines 219 to 257 from this script (that seems more updated): https://pastebin.com/m48rwsae it works perfectly. I have tried and I could change last two months of activity privacy for me.

    Thanks this script is super helpful!!! I wish I could do similar things with python Slight smile

  • As you got it working, it's good.

    Anyway it's also possible to use similar script in web-browser console (F12 key), so here is my script, tested in Firefox. Edit the search link to filter activities you want to change - and change typeKey to privacy level you need.

    Below it's limit=1 for testing if it works as wanted, it will change only first latest activity to private.

    It's normal search link from Connect Web, so it accepts all filters visible on the website, if you need more filters just check them on the website and add them by &.

    jQuery.getJSON(
        'https://connect.garmin.com/modern/proxy/activitylist-service/activities/search/activities?limit=1',
        function(act_list)
        {
            act_list.forEach(
            function(act)
                {
                    fetch('https://connect.garmin.com/modern/proxy/activity-service/activity/' + act['activityId'],
                    {
                        'headers': { 'Content-Type': 'application/json', 'NK': 'NT', 'X-HTTP-Method-Override': 'PUT' },
    
                        'body': '{"accessControlRuleDTO":{"typeKey":"private"},"activityId":' + act['activityId'] + '}',
    
                        'method': 'POST'
                    });
                    console.dir(act['activityId'], act['activityName'], act['startTimeLocal']);
                }
            );
        }
    );

    Parameters:

    typeKey: private, subscribers, groups, public
    ?limit= number of activities to change, starting from latest
    &start= start from nth+1 activity, counting from latest
    &activityType= running, cycling, fitness_equipment, walking, other
    &startDate= YEAR-MM-DD
    &endDate= YEAR-MM-DD
    &minDistance= in meters
    &maxDistance= in meters

    Example:

    .../search/activities?limit=200&start=200&activityType=running

  • Hi Travis. The links to your script seem to have disappeared from the thread.

    Is it still available somewhere?

    TIA!

  • Hey, is there any chance this or something similar would work for courses? Friends have been asking me to share my routes with them, but this has to be done one by one and I have so many...

  • Any chance of getting a simple tool for chrome? (Like an extension)

  • The script posted above by  does work in Chrome. Just press F12, and enter the code into the console

  • This is gold! Amazing stuff, thanks  !!

  • Hey, WillNorthYork, 2 years later and I found great your idea. I don't know why didnt worked for me, could you help me?

  • I'm getting the same error.  It would be sweet if we could get this working.

  • Updated with your tip and working https://pastebin.com/Tnhi8YWj

    Thanks