Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use '/rest/adLibrary' endpoint with linkedin-api-python-client #64

Open
saurabhlalsaxena opened this issue Sep 29, 2024 · 0 comments

Comments

@saurabhlalsaxena
Copy link

saurabhlalsaxena commented Sep 29, 2024

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant