Code Guy
Code Guy

Reputation: 3198

Encoding issue with ageRange URL in linked in

I am fetching the audiene count

https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Acountry%3Aal))))),exclude:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AageRange:List(urn%3Ali%3AageRange%3A(18%2C24)))),(or:(urn%3Ali%3AadTargetingFacet%3Adegrees:List(urn%3Ali%3Adegree%3A2049))))))

As per ref: https://learn.microsoft.com/en-us/linkedin/shared/references/v2/ads/targeting-criteria-facet-urns The Values for Age Range allowed are : urn:li:ageRange:(18,24) urn:li:ageRange:(25,34) urn:li:ageRange:(35,54) urn:li:ageRange:(55, 2147483647)

I am getting a 400 error

{
    "serviceErrorCode": 0,
    "message": "Invalid query parameters passed to request",
    "status": 400
}

Could you help me whether the encoding for date range in the query is correct or wrong?

Upvotes: 0

Views: 398

Answers (1)

Michael Keane Galloway
Michael Keane Galloway

Reputation: 106

In the documentation to, it states: enter image description here

You're attempting to use age range in an exclude, and it can only be used in the include portion of targeting.

Upvotes: 0

Related Questions