Skip to content

Commit

Permalink
Merge pull request #4 from railsware/CPL-14996/Bump-Linkedin-Ads-API-…
Browse files Browse the repository at this point in the history
…version-for-Video-Ads-and-Ad-Accounts

[CPL-14996]: Upgrade version
  • Loading branch information
akoikelov authored Jun 5, 2024
2 parents 7c3bf1b + 4379f7d commit ca44994
Show file tree
Hide file tree
Showing 12 changed files with 582 additions and 332 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tap_intercom/.vscode/settings.json
.DS_Store
test_configuration.py
tap_target_commands.sh
.idea/
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 2.3.1
* Fixes url encoding issue with `video_ads` stream pagination

## 2.3.0

### Features
- **API Updates**
- Bumped to API version `202304` ([#64](https://github.com/singer-io/tap-linkedin-ads/pull/69))
- Updated API endpoints for the following streams: `campaign_groups`, `campaigns`, `creatives`

- **Pagination Enhancements**
- Implemented cursor-based pagination for the following streams: `accounts`, `campaign_groups`, `campaigns`, `creatives`

- **API Query Param Adjustments**
- Removed unsupported `pivot` and `pivotValue` from `fields` query parameters in Analytics API requests
- Incorporated these values within the tap to ensure consistency with the previous tap version

- **Video Ads Stream**
- Added new fields ([#71](https://github.com/singer-io/tap-linkedin-ads/pull/71))

## 2.2.0
* Bump to API version `202304`

## 2.1.0
* Bump to API version `202302`
* Move and update `FIELDS_UNACCEPTED_BY_API`
Expand Down Expand Up @@ -29,7 +52,7 @@

## 1.2.5
* Auto access-token refresh [#41](https://github.com/singer-io/tap-linkedin-ads/pull/41)

## 1.2.4
* Add Request Timeout [#36](https://github.com/singer-io/tap-linkedin-ads/pull/36)
* Handling 4xx responses for adCampaignGroup [#28](https://github.com/singer-io/tap-linkedin-ads/pull/28)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ This tap:
- Transformations: Fields camelCase to snake_case. URNs to ids. Unix epoch millisecond integers to date-times. Audit date-times created_at and last_modified_at de-nested. String to decimal for total_budget field.
- Children: video_ads

[**video_ads**](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/advertising-targeting/create-and-manage-video#finders)
- Endpoint: https://api.linkedin.com/rest/adDirectSponsoredContents
[**video_ads**](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api?view=li-lms-2024-03&tabs=curl#find-posts-by-account)
- Endpoint: https://api.linkedin.com/rest/posts
- Primary key field: content_reference
- Foreign keys: account_id (accounts), owner_organization_id (organizations)
- Required scope - `r_organization_social`
- Replication strategy: Incremental (query all, filter results)
- Filter: account (from parent account) and owner (from parent account) (see NOTE below)
- Bookmark: last_modified_time (date-time)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, find_packages

setup(name='tap-linkedin-ads',
version='2.1.0',
version='2.3.1',
description='Singer.io tap for extracting data from the LinkedIn Marketing Ads API API 2.0',
author='[email protected]',
classifiers=['Programming Language :: Python :: 3 :: Only'],
Expand Down
5 changes: 2 additions & 3 deletions tap_linkedin_ads/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
BASE_URL = 'https://api.linkedin.com/rest'
LINKEDIN_TOKEN_URI = 'https://www.linkedin.com/oauth/v2/accessToken'
INTROSPECTION_URI = 'https://www.linkedin.com/oauth/v2/introspectToken'
LINKEDIN_VERSION = '202305'
LINKEDIN_VERSION = '202403'

# set default timeout of 300 seconds
REQUEST_TIMEOUT = 300
Expand Down Expand Up @@ -349,8 +349,7 @@ def request(self, method, url=None, path=None, **kwargs):
kwargs['headers'] = {}
kwargs['headers']['Authorization'] = 'Bearer {}'.format(self.__access_token)
kwargs['headers']['Accept'] = 'application/json'
if 'LinkedIn-Version' not in kwargs['headers']:
kwargs['headers']['LinkedIn-Version'] = LINKEDIN_VERSION
kwargs['headers']['LinkedIn-Version'] = LINKEDIN_VERSION
kwargs['headers']['Cache-Control'] = "no-cache"

if self.__user_agent:
Expand Down
180 changes: 180 additions & 0 deletions tap_linkedin_ads/schemas/video_ads.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,186 @@
"string"
]
},
"lifecycle_state": {
"type": [
"null",
"string"
]
},
"visibility": {
"type": [
"null",
"string"
]
},
"published_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"author": {
"type": [
"null",
"string"
]
},
"content_call_to_action_label": {
"type": [
"null",
"string"
]
},
"distribution": {
"type": [
"null",
"object"
],
"additionalProperties": false,
"properties": {
"feed_distribution": {
"type": [
"null",
"string"
]
},
"third_party_distribution_channels": {
"type": [
"null",
"array"
],
"items": {
"type": [
"null",
"string"
]
}
}
}
},
"content": {
"type": [
"null",
"object"
],
"additionalProperties": false,
"properties": {
"media": {
"type": [
"null",
"object"
],
"additionalProperties": false,
"properties": {
"title": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
}
}
}
}
},
"content_landing_page": {
"type": [
"null",
"string"
]
},
"lifecycle_state_info": {
"type": [
"null",
"object"
],
"additionalProperties": false,
"properties": {
"is_edited_by_author": {
"type": [
"null",
"boolean"
]
}
}
},
"is_reshare_disabled_by_author": {
"type": [
"null",
"boolean"
]
},
"created_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"last_modified_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"id": {
"type": [
"null",
"string"
]
},
"commentary": {
"type": [
"null",
"string"
]
},
"ad_context": {
"type": [
"null",
"object"
],
"additionalProperties": false,
"properties": {
"dsc_status": {
"type": [
"null",
"string"
]
},
"dsc_name": {
"type": [
"null",
"string"
]
},
"dsc_ad_type": {
"type": [
"null",
"string"
]
},
"is_dsc": {
"type": [
"null",
"boolean"
]
},
"dsc_ad_account": {
"type": [
"null",
"string"
]
}
}
},
"account_id": {
"type": [
"null",
Expand Down
Loading

0 comments on commit ca44994

Please sign in to comment.