I’m working with the LinkedIn Marketing API and trying to fetch ad campaigns for a given account using the search parameter to filter by status.
According to the docs, the endpoint should look like this:LinkedIn Marketing API
GET https://api.linkedin.com/rest/adAccounts/{account_id}/adCampaigns
I’ve been trying Strategy A with a parenthesized search clause:
GET https://api.linkedin.com/rest/adAccounts/11111111/adCampaigns
?q=search
&search=(status%3A(values%3AList(ACTIVE,DRAFT,PAUSED,ARCHIVED)))
&fields=id,name,type
&count=100
But this consistently returns:
Status: 400
Body: {"status":400,"code":"ILLEGAL_ARGUMENT","message":"Invalid query parameters passed to request"}
I also retried with fully-encoded search values, e.g. encoding parentheses/commas as well, but then I get:
{"errorDetails":{"inputErrors":[{"description":"Invalid value for param; wrong type or other syntax error",
"input":{"inputPath":{"fieldPath":"search"}},"code":"PARAM_INVALID"}]}}
Things I’ve tried so far:
- Encoding colons as
%3Awhile leaving parentheses/commas unescaped. - Encoding the whole thing strictly (everything encoded).
- Switching
values:List(...)tovalues:(...). - Double-checking against LinkedIn’s Rest.li query DSL.
All fail with the same 400 errors.
My Question:
Has anyone actually managed to get parenthesized search=(...) form) to work with adCampaigns? If so, what exact query string and encoding worked for you? Or is the only working approach the dotted form (search.status.values[0]=ACTIVE) and LinkedIn has silently dropped support for the parenthesized variant?