I have a LinkedIn Developer App connected to a company page with an approved 'Marketing Developer Platform' product. I'm trying to call any of the organization endpoints ("organizationPageStatistics", "organizationalEntityFollowerStatistics", etc.) from a Google Sheets script and I have the 'rw_organization_admin' permission and the token is valid for that permission. Each time I get a 404 response with 'does not exist' in the message.
Here is an example of the URL I'm using;
https://api.linkedin.com/v2/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn%3Ali%3Aorganisation%3A{appId}&oauth2_access_token={access_token}
This is what I have in the Google Sheets script;
var data = {"X-Restli-Protocol-Version":"2.0.0"};
var options = {'method' : 'post',
'contentType': 'application/json',
'payload' : JSON.stringify(data)
};
var LIData = UrlFetchApp.fetch("https://api.linkedin.com/v2/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity="+LINKEDIN_COMPANY_URN_URLENCODED+"&oauth2_access_token="+LINKEDIN_ACCESS_TOKEN, options);
Logger.log(JSON.parse(LIData));
Any help is greatly appreciated.