LinkedIn API v2两个广告账户获取接口的差异及优劣势对比
Awesome question—these two endpoints look similar at first glance, but they serve distinct purposes depending on what you need to pull from LinkedIn's API. Let’s break down their differences and strengths clearly:
v2/adAccountsV2?q=search : Focus on Ad Account Properties & Broad Search
- Core purpose: This endpoint is built for searching and filtering ad accounts based on specific criteria, not just those tied to the authenticated user. You can query by account name, ID, status (active/paused), parent company, currency, and more.
- Permissions required: Needs the
r_adaccountsscope, which grants access to all ad accounts you have permission to view (including those under your company’s umbrella, not just ones you’re directly linked to). - Returned data: Delivers deep details about the ad accounts themselves—like account ID, name, status, currency, associated company ID, creation timestamp, and billing settings. It won’t include any info about your role or relationship to the account.
- Key advantages:
- Perfect for bulk operations: If you need to pull all active ad accounts under your company, or find accounts matching a specific name/region, this is way more efficient.
- Ideal for reporting or analytics where you just need account-level metadata, not user-specific permissions.
v2/adAccountUsersV2?q=authenticatedUser : Focus on User-Account Relationships & Permissions
- Core purpose: This endpoint is strictly tied to the currently authenticated user—it returns only the ad accounts that the user is directly associated with, plus their exact role in each account.
- Permissions required: Needs the
r_adaccount_usersscope, which is focused specifically on the user’s connections to ad accounts, not the accounts themselves. - Returned data: Includes basic ad account details plus user-specific relationship fields: the user’s
role(e.g.,ADMINISTRATOR,EDITOR,VIEWER), when they were added to the account, and whether they’re the account creator. - Key advantages:
- Essential for building user-centric experiences: If you’re building a dashboard that shows a user only the accounts they can access, or need to restrict features based on their role (like hiding billing controls from non-admins), this is your go-to.
- Eliminates extra filtering: Since it only returns accounts tied to the authenticated user, you don’t have to sift through irrelevant accounts to find what the user can interact with.
Quick Decision Guide
- Use
adAccountsV2?q=searchwhen you need to query ad accounts independently of user roles (e.g., company-wide account audits, filtering accounts by currency). - Use
adAccountUsersV2?q=authenticatedUserwhen you need to know exactly what accounts the current user can access, and what they’re allowed to do in each.
内容的提问来源于stack exchange,提问作者Anushka Mehta
相关产品推荐
相关产品推荐

