Hi community,
I am trying to work with the LinkedIn API to retrieve details about UGC posts (i.e. engagements, clicks, etc.). This information is not part of the LinkedIn Marketing Solutions CDATA connector, so I am using the CDATA provider for REST 2022.
I first made a call to the posts API to ‘Find Posts by Account’: Posts API - LinkedIn | Microsoft Learn. After that I need to pass each Post ID into the Organizational Entity Share Statistics API to ‘Retrieve Statistics for Specific UGC Posts’: Organization Share Statistics - LinkedIn | Microsoft Learn.
The problem I am facing is that the Posts API returns two types of posts (which cannot be filtered in the API): shares and UcgPosts. Each of those types of posts needs a different URL format in the ‘Organizational Share Statistics’ API. So, I need a way to only pass one type of post into the second API. UCG posts are posts where the ID starts with 'urnugcPost:'
The file RSD 1.txt works, until the first ID from the Posts API is a UcgPost, instead of a share. The first Ucg post that gets passed into the second API returns the following error from the API:
{"message":"Array parameter 'shares' value 'urnugcPost:7071823186039828482' is invalid. Reason: Deserializing output 'urnugcPost:7071823186039828482' failed","status":400}
So I tried to create a case statement in RSD 2.txt , but to no avail. It does not seem to be doing anything different:
Does anyone have any experience with a filter or case statement between two tables in a nested API call like this?
Kind regards,
Andrew - E-mergo