REST API turn on reporting site collection feature

%3CLINGO-SUB%20id%3D%22lingo-sub-1517811%22%20slang%3D%22en-US%22%3EREST%20API%20turn%20on%20reporting%20site%20collection%20feature%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1517811%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20can%20turn%20this%20feature%20on%20via%20PowerShell%20PnP%2C%20but%20need%20to%20do%20it%20via%20PowerAutomate%20REST%20API%20call.%3C%2FP%3E%3CP%3EI%20have%20the%20following...see%20attached%20image...for%20our%20FLOW%20REST%20API%20call.%3C%2FP%3E%3CP%3EWhen%20I%20run%20the%20FLOW%20I%20get%3A%3C%2FP%3E%3CDIV%20class%3D%22fl-LabeledText-label%22%3EError%3C%2FDIV%3E%3CDIV%20class%3D%22fl-LabeledText-text%22%3EAction%20'Send_an_HTTP_request_to_SharePoint'%20failed%3CBR%20%2F%3E%3CBR%20%2F%3EInvalid%20request.%3CBR%20%2F%3EclientRequestId%3A%20690efeb4-ddce-49a2-b5d7-58e5e06db54a%3CBR%20%2F%3EserviceRequestId%3A%2094ea649f-80ce-b000-973f-9686227e5f12%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1517811%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

We can turn this feature on via PowerShell PnP, but need to do it via PowerAutomate REST API call.

I have the following...see attached image...for our FLOW REST API call.

When I run the FLOW I get:

Error
Action 'Send_an_HTTP_request_to_SharePoint' failed

Invalid request.
clientRequestId: 690efeb4-ddce-49a2-b5d7-58e5e06db54a
serviceRequestId: 94ea649f-80ce-b000-973f-9686227e5f12
1 Reply
Highlighted

@Chip Cooper I think you are missing /feature/add.

 

See here

 

Excerpt:

// Enables site collection feature (Site scoped feature)  
function EnableSiteCollectionFeature(){  
    var featuresURI = sitecollectionURL + "/_api/site/features/add('151d22d9-95a8-4904-a0a3-22e4db85d1e0')"; // Cross-Site Collection Publishing Feature ID  
    $.ajax({  
        url: featuresURI,  
        method: 'POST',  
        headers: {   
            "Accept": "application/json;odata=verbose",  
            "X-RequestDigest": $("#__REQUESTDIGEST").val()   
        },  
        success: function (data) {  
            console.log("Feature Activated");  
        },  
        error: function(data) {  
            console.log(data.responseJSON.error.message.value);  
        }  
    });  
}