thetvdb / v4-api

Founded in 2006, TheTVDB is one of the longest-running community-driven TV and Movie databases. With content metadata across hundreds of thousands of TV series and movies, TheTVDB powers many of the largest media centers in the market. Developers across the world build and rely upon TheTVDB's APIs to power their apps, utilities, and projects, generating millions of API calls per day. In our GitHub repository you will find all of the necessary support and v4 API documentation to make use of TheTVDB's metadata. Come and join us!
135 stars 13 forks source link

Auth v4 api key failed #303

Closed kirinse closed 7 months ago

kirinse commented 1 year ago

got same issue. i have v4 apikey but pin. Thanks for the response, I've gone and tried again and the error has indeed changed:

image

Originally posted by @samhorrigan in https://github.com/thetvdb/v4-api/issues/288#issuecomment-1513712665

antheaezzell commented 1 year ago

Are you trying to use a legacy API key for v4? Or a v4 API? You should be able to tell from your dashboard @kirinse

kirinse commented 1 year ago

Are you trying to use a legacy API key for v4? Or a v4 API? You should be able to tell from your dashboard @kirinse

thank you for your quick reply. i'm using v4 api key.

kirinse commented 1 year ago

@antheaezzell still 400 response while try /login

{
  "status": "failure",
  "message": "InvalidValueType: pin required",
  "data": null
}
antheaezzell commented 1 year ago

Here are additional auth instructions @kirinse :

In order to make use of the v4 API, you need to login using https://api4.thetvdb.com/v4/login with your credentials (apikey and PIN if needed) and obtain a JWT token. Then, use the JWT token as the bearer authorization. Make sure you are NOT sending your API key as the bearer token or you will receive an unauthorized response. Instead, use the API key in the /login endpoint and then use the JWT that returns as the bearer for calls to the rest of the endpoints.

kirinse commented 1 year ago

@antheaezzell I tried exactly what you say, post

{"apikey": "MY-V4-KEY"}

to https://api4.thetvdb.com/v4/login, but still got pin required error.

I'm stuck at obtain JWT token.

kirinse commented 1 year ago

ping @antheaezzell

antheaezzell commented 1 year ago

@kirinse you either need to send your PIN like this or sign up for a non-PIN API key.

{"apikey": "your-api-key", "pin": "your-pin"}

ghost commented 1 year ago

FYI: The PIN is your* Subscriber PIN' which, once logged into TVDB, can be found under Your Account, Dashboard, Account, Subscription

I revisited the API having been away for about 6 months and it took me an age to workout that I needed a PIN where to find it. For some reason I had noted the API key but never noted the PIN or that I needed one so assumed I just need the API key.

Not sure if there are other types of PIN a developer can obtain (I've subscribed tot he API) so might be elsewhere for you @kirinse.

webriddler commented 10 months ago

I am still having

{ "status": "failure", "message": "InvalidAPIKey: apikey invalid", "data": null }

I don't know why it's not accepting the correct API key

webriddler commented 10 months ago

@antheaezzell I am using v4 API without Pin

antheaezzell commented 10 months ago

Are you authenticating using these instructions @webriddler

In order to make use of the v4 API, you need to login using https://api4.thetvdb.com/v4/login with your credentials (apikey and PIN if needed) and obtain a JWT token. Then, use the JWT token as the bearer authorization. Make sure you are NOT sending your API key as the bearer token or you will receive an unauthorized response. Instead, use the API key in the /login endpoint and then use the JWT that returns as the bearer for calls to the rest of the endpoints.

webriddler commented 10 months ago

I am doing the same as per instructions but, nothing works except Invalid Api key response.

Although my API key is Active.

szsori commented 10 months ago

Hi @webriddler, can you email us at support@thetvdb.com with the API key you're using? Or provide the last 4 characters of it here? I want to see how the key is configured and test authentication with it.

webriddler commented 10 months ago

My API Key: **4790