LinkedIn Ads API - Can't find and get ad campaign through api

3 weeks ago 32
ARTICLE AD BOX

I'm in the process of trying to set up some api calls for fetching ad data from LinkedIn, specifically with regards to the ad campaigns (primarily: what is the campaign's budget, how much has been spent so far in this month, the name of the campaign, etc). Thus far, I have been able to successfully retrieve data for an ad account, but I haven't been able to retrieve any data for an ad campaign.

This is my current api call in JavaScript:

const res = await fetch(`https://api.linkedin.com/rest/adAccounts/${process.env.LINKEDIN_ADS_ACCOUNT_ID}/adCampaigns/${process.env.LINKEDIN_CAMPAIGN_ONE_ID}`, { method: "GET", headers: { "X-Restli-Protocol": "2.0.0", "Linkedin-Version": "202601", "Authorization": `Bearer ${process.env.LINKEDIN_ACCESS_TOKEN}`, } });

This is the message that I receive afterwards:

{ "code": "NOT_FOUND", "message": "Not Found.", "status": 404 }

To be honest, I'm really not sure what I'm doing wrong. When I look in the LinkedIn Ads Campaign Manager, I can see the campaign I'm trying to the data of is there, and does exist. Granted, it isn't running/delivering ads, nor does it have any ad sets, but it is there, so I'm left confused when LinkedIn says that the campaign apparently isn't found. I would appreciate help, as well as some guidance on what I should be doing to get the kind of data I need.

Read Entire Article