function activatePageReferences(spacekey)
clc

service    = ConfluenceSoapServiceService;
token      = login(service, 'Mark van Koningsveld', 'mark123');

pages                = getPages(service, token, spacekey);        % to test if a page is already available
pagetitles           = {pages.title};

for i = 1:size(pagetitles,2)
    service    = ConfluenceSoapServiceService;
    token      = login(service, 'Mark van Koningsveld', 'mark123');

    page = getPage(service, token, spacekey, pagetitles{i});
    if ~strcmp(page.title,'Home')
        activatePageReference(service, token, spacekey, page, pagetitles);
    end
end

