I am trying to use the '/adLibrary' LinkedIn Ad Library endpoints using the linkedin-api-python-client but I am unable to get it to work. Keep getting a 404 response.
It is working with CURL but not with linkedin-api-python-client. Providing the code below:
curl -X GET 'https://api.linkedin.com/rest/adLibrary?q=criteria&keyword=linkedin&advertiser=linkedin' -H 'X-RestLi-Protocol-Version: 2.0.0' -H 'Linkedin-Version: 202408' -H 'Authorization: Bearer {INSERT_TOKEN}'
from linkedin_api.clients.restli.client import RestliClient
restli_client = RestliClient()
# Make the API request
response = restli_client.finder(
resource_path="/adLibrary",
finder_name = "criteria",
query_params={
"keyword": "linkedin",
"advertiser":"linkedin"
},
access_token=ACCESS_TOKEN
)
print(response.response)