Code Monkey home page Code Monkey logo

Comments (10)

daveajones avatar daveajones commented on July 20, 2024

You must recalc the auth hash and set a new date header for each call. Are you doing that?

from docs-api.

walkero-gr avatar walkero-gr commented on July 20, 2024

@daveajones
Thank you so much for your fast reply.
I absolutely do that. Every time I do a new request to the api, I create the authorization with the new timestamp.
If anything else was the problem, should I get a different error message?
What would be helpful would be a way to see the actual request the API gets. Something like a requests log at the backend. With the headers and all the data, and the response code somewhere. Even if it was just a plain log file shown at a page. Is this possible?

from docs-api.

daveajones avatar daveajones commented on July 20, 2024

I put in some debug for this specific issue. Try it again. I'll look at giving back more detail once I get some other stuff off my plate.

from docs-api.

walkero-gr avatar walkero-gr commented on July 20, 2024

@daveajones
That is awesome. Here is the output I got on the request.
This Server time means that this is the one that is compared the request time to?

X-Auth-Date header value is not within the +/- 3 minute time window.  Please see: https://podcastindex-org.github.io/docs-api/#overview--authentication-details

Debug
  Server time: 1631642994

Headers Received
  X-Auth-Date: 1631646658
  X-Auth-Key: CWN8YHEYKJDRPRE6PQSH
  Authorization: 458c17b485e1e63931b7b020ae6821c051574115
  User-Agent: MediaVault/1.3 (AmigaOS)

from docs-api.

stevencrader avatar stevencrader commented on July 20, 2024

Is the time you are sending UTC or local time? I tried to look at your code but wasn't sure what now() returned.

from docs-api.

walkero-gr avatar walkero-gr commented on July 20, 2024

@stevencrader
Thank you so much for taking a look. Actually it doesn't take care of the timezone, and it is the time of user's machine. This is something I should take in account? It should be based on UTC or something else?

At the docs I see the following info:

The current unix epoch time as a string. 5 minute window.
This value is an integer; round down if needed. The value shall not include a decimal point.

from docs-api.

stevencrader avatar stevencrader commented on July 20, 2024

I believe the time needs to be UTC epoch time. You can compare the time reported in your app to the time reported here https://www.epochconverter.com/

from docs-api.

walkero-gr avatar walkero-gr commented on July 20, 2024

@stevencrader
That's great. At least now I can see what might be wrong. I will test it. and get back to you.

from docs-api.

walkero-gr avatar walkero-gr commented on July 20, 2024

@stevencrader I believe you are right. Changed my timestamp reducing by 1 hour, which is my timezone (UTC+1), and now I got data just fine.

I think that information must be added at the docs, for others to know.

Thank you both for your valuable help.

from docs-api.

daveajones avatar daveajones commented on July 20, 2024

Thanks guys.

from docs-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.