Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
ribasman
Posts: 13
Joined: Thu Dec 22, 2011 9:16 pm

Infos/User response = 403 forbidden

Wed Oct 05, 2022 12:45 am

Hi,
Start migrating to the new API and everything runs smoothly except for the GET method in infos/user
After Login (which i get a token) immediately i'm trying without success to get the remaining_downloads integer. A key part in my app code:
The remote server returned an error: (403) Forbidden

Btw infos/formats and infos/languages are almost identical in terms of headers and are working flawless

On the other and i think it will be less intensive for server to respond at Login all major user details like the remaining_downloads

PS.i know and it's working after one download that i receive those remaining available downloads

Looking forward for your reply and thanks in advance

User avatar
oss
Site Admin
Posts: 5879
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Infos/User response = 403 forbidden

Wed Oct 05, 2022 9:30 am

Hi

yes remaining downloads will be implemented, on login response. Are you sending also JWT?:

User token created in the login endpoint to authorise opensubtitles.com user
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123

Please read https://opensubtitles.stoplight.io/docs ... formations

ribasman
Posts: 13
Joined: Thu Dec 22, 2011 9:16 pm

Re: Infos/User response = 403 forbidden

Fri Oct 07, 2022 10:15 pm

persists in error 403.

queryUrl = "https://api.opensubtitles.com/api/v1/infos/user"
Dim wClient1 As New WebClient
wClient1.Headers("Accept") = "*/*"
wClient1.Headers("ContentType") = "application/json"
wClient1.Headers("Authorization") = String.Format("Bearer {0}", openSubUser.token)
Dim jsonObject1 As Object = JObject.Parse(wClient1.DownloadString(queryUrl))

openSubUser.token=token from json response on Login endpoint
I've already turned to false that consumerApi under development check.

ribasman
Posts: 13
Joined: Thu Dec 22, 2011 9:16 pm

Re: Infos/User response = 403 forbidden

Fri Oct 07, 2022 10:32 pm

Figure it out already. Missing api-key header of course.

queryUrl = "https://api.opensubtitles.com/api/v1/infos/user"
Dim wClient1 As New WebClient
wClient1.Headers("ContentType") = "application/json"
wClient1.Headers("Authorization") = String.Format("Bearer {0}", openSubUser.token)
wClient1.Headers("Api-Key") = openSubUser.apiKey
Dim jsonObject1 As Object = JObject.Parse(wClient1.DownloadString(queryUrl))

User avatar
oss
Site Admin
Posts: 5879
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Infos/User response = 403 forbidden

Sat Oct 08, 2022 10:18 am

good one :) but glad you find it out.

Return to “Developing”

Who is online

Users browsing this forum: Ahrefs [Bot] and 34 guests