hey guys I'm using tap-tiktok-business and modifie...
# troubleshooting
h
hey guys I'm using tap-tiktok-business and modified the tap code to use the APIs version 1.3 as the tap is outdated and uses version 1.2. Now in the output it gives me a response to the API saying that business_id is missing although it is definitely included in the config. Anybody able to help out with this? I've included a screenshot of the output I am receiving when running "meltano run tap-tiktok-business target-jsonl"
r
Can you share what you changed? Were there any breaking API changes between
1.2
and
1.3
?
h
I changed the rest_method in streams.py to GET from POST, and the path in VideosStream to /video/list/ I also changed the url base to the latest ("https://business-api.tiktok.com/open_api/v1.3/business")
I realised now that I am taking parameters for a POST request and was wondering what I would need to change to make the functions in client.py take URL parameters for a GET request over a payload which was used when it was a POST request
h
I think I've managed to get it working now. I changed the get_url_params to only accept the fields necessary when running VideosStream (as it is the only stream that requires url parameters). Also turns out the path and REST method for CommentsStream were also outdated. Is there a way of requesting to provide the original tap creator with these changes I've made? I think it could be helpful to anyone using the tap in the future. Thanks for your help!
r
Last update was over 2 years ago so good luck!
h
ye I'll send it anyways just in case 😅
In the mean time, is there a way I can use my modified repo that's on my github account? I tried using "-e ../tap-tiktok-business" but the configuration doesn't work the same and I'm unable to select attributes
r
That local path should work fine, just make sure you
meltano install --clean
after you change it. If you want to reference your fork instead, you can do
Copy code
pip_url: git+<https://github.com/><username>/tap-tiktok-business.git
h
I've done that but it still doesn't let me configure things the same way as when I regularly add the tap to my project (using "meltano add extractor tap-tiktok-business"). How do I make it so the sensitive data gets stored in a .env file as it did before? The first screenshot is when I clone the repo directly from the github repo (original) and the second is when I use meltano add.
r
Can you share the
meltano.yml
entry for that plugin?
h
also using the pip_url as you suggested says using the configuration has no settings so unfortunately that didn't change anything 😞
yep
version: 1
send_anonymous_usage_stats: true
project_id: 84ef0d85-4664-4c83-8c0a-427892996390
plugins:
extractors:
- name: tap-tiktok-business
namespace: tap_tiktok_business
pip_url: -e .
capabilities:
- state
- catalog
- discover
settings:
- name: client_id
type: string
- name: client_secret
type: string
- name: access_token
description: Your TikTok access token
type: string
- name: refresh_token
description: Your TikTok refresh token
type: string
- name: business_ids
kind: array
description: Your TikTok business ID
- name: start_date
value: '2010-01-01T00:00:00Z'
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
- name: target-bigquery
variant: adswerve
pip_url: git+<https://github.com/adswerve/target-bigquery.git@0.12.1>
config:
project_id: nymag-analytics-157315
add_metadata_columns: true
table_prefix: src_
merge_state_messages: false
r
The sensitive settings need to be marked as
sensitive: true
.
This is pretty similar to https://meltano.slack.com/archives/C068YBV6KEK/p1721176501212389?thread_ts=1721162601.389529&cid=C068YBV6KEK, where you probably want to reuse/extend an existing plugin definition from Meltano Hub as a custom plugin.
tap-tiktok-business
will define those settings as
sensitive
in its
.lock
file, which is sourced from https://github.com/meltano/hub/blob/18d67bac63620d9ead466cef895e7379c0213756/_data/meltano/extractors/tap-tiktok-business/hkuffel.yml#L25
h
ah awesome, I'll take a look and see how it goes
👍 1
I tried the steps above and it worked flawlessly! Thanks so much for your help :D
r
No problem :)