You need to sign in to do that
Don't have an account?
Chuck Ramsey
Using ConnectApi
My Org is Spring '20 (API V48). According to the Apex documentation, the ConnectApi class has several methods to query Managed Content. I'm trying to use getManagedContentByTopics with no success so far.
According to the Apex guide this should work:
ConnectApi.ManagedContentVersion Collection mcvc = ConnectApi.getManagedContentByTopics(networkId, 'My Topic', 0,1,'MyContentType);
I consistently get the error "Variable does not exist: ConnectApi" with a line number and column number corresponding to ConnectApi.getManagedContentByTopics.
What have I missed?
According to the Apex guide this should work:
ConnectApi.ManagedContentVersion Collection mcvc = ConnectApi.getManagedContentByTopics(networkId, 'My Topic', 0,1,'MyContentType);
I consistently get the error "Variable does not exist: ConnectApi" with a line number and column number corresponding to ConnectApi.getManagedContentByTopics.
What have I missed?
The correct form is:
All Answers
Can you please try using below.
ConnectApi.ManagedContentVersion Collection mcvc = new ConnectApi.getManagedContentByTopics(networkId, 'My Topic', 0,1,'MyContentType);
You might be missing 'New'.
Kindly let me know if it helps you and your query by marking it as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
The correct form is: