Skip to content
Notifications
Clear all

Breaking: API v2 is out. Migration looks messy.

3 Posts
3 Users
0 Reactions
2 Views
(@data_pipeline_newbie_42)
Estimable Member
Joined: 4 months ago
Posts: 81
Topic starter   [#7856]

Hey everyone. Just saw the announcement for WellSaid Labs API v2. I'm in the middle of building an ingestion pipeline to pull audio metadata into BigQuery, and this timing is... stressful 😅.

I was using v1 with Airbyte's custom connector. The v2 changelog has some big shifts:
* Authentication changed from API keys to OAuth.
* Several endpoint structures are different.
* The rate limiting headers seem to have new parameters.

My main questions:
* Has anyone started migrating a data pipeline yet?
* Is there a formal deprecation timeline for v1? I can't find it.
* For a simple sync of `projects` and `voices`, would you rebuild the connector or switch to a direct Python script for now?

My v1 config was roughly:
```python
# Old v1 style
headers = {"X-API-Key": API_KEY}
response = requests.get(f"{BASE_URL}/v1/projects", headers=headers)
```

But v2 looks like it needs a token flow first. Any pointers would be a huge help.



   
Quote
(@infra_auditor_nina)
Reputable Member
Joined: 4 months ago
Posts: 159
 

No deprecation timeline in the announcement? That's a red flag. They'll probably sunset v1 with 30 days' notice once they think adoption is high enough.

OAuth for a machine-to-machine pipeline is a hassle, but at least you'll get proper audit logs. I'd skip rebuilding a connector for now and go with a direct script. You'll have to manage token refresh, but it's about a dozen extra lines.

For a simple sync, just get the token once and reuse it until expiry. Something like:
```python
# Basic v2 token fetch
auth = (CLIENT_ID, CLIENT_SECRET)
resp = requests.post(TOKEN_URL, data={'grant_type': 'client_credentials'}, auth=auth)
token = resp.json()['access_token']
```
Then slap that `token` in an Authorization header. Keep an eye on the rate limit headers though - they're probably counting against your client ID now, not an API key.


- Nina


   
ReplyQuote
(@infra_architect_rebel)
Estimable Member
Joined: 3 months ago
Posts: 122
 

Don't rebuild the Airbyte connector yet.

For your simple sync, a direct Python script is less overhead than adapting a whole connector framework. The OAuth token refresh for client credentials is trivial for a batch job.

Example: fetch token at start of script, use it for the session. It'll last hours.

```python
import requests
s = requests.Session()
s.headers.update({'Authorization': f'Bearer {get_token()}'})
# Then just s.get(f"{BASE_URL}/v2/projects")
```
Check their docs for the exact rate limit header names. They probably changed.


Simplicity is the ultimate sophistication


   
ReplyQuote