Good morning #linkedin,
I am trying to extract data from Advertising API campaigns that my company has on LinkedIn Ads. The issue we are facing is that when making the API request, we are unable to retrieve a list of campaigns and instead receive the error “Resource not found.” Below you will find the code:
Obtain the access token with the necessary scopes
import urllib.parse
# Replace with your client_id and redirect_uri
scope = 'email openid profile r_ads' # You can add more scopes if necessary, separated by a space
client_id = 'XXXXXXXXXXXX'
redirect_uri = 'https://www.XXXXX.es'
# Authorization URL parameters
params = {
'response_type': 'code',
'client_id': client_id,
'redirect_uri': redirect_uri,
'scope': scope
}
# Build authorization URL
base_url = 'https://www.linkedin.com/oauth/v2/authorization'
authorization_url = f'{base_url}?{urllib.parse.urlencode(params)}'
print('Visit this URL in your browser to authorize the application:')
print(authorization_url)
Here's a brief summary:
Action: Attempted to extract campaign data from LinkedIn Ads API.
Expectation: Expected to receive a list of campaigns.
Result: Received an error message "Resource not found."
New contributor
Alvaro Villadangos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.