• Resolved WPChina

    (@wordpresschina)


    I am getting this error and cannot either automatically or manually publish to Apple News. All my API is running fine:

    There has been an error with the API: DATE_NOT_RECENT
    If you need assistance, please reach out for support on ww.wp.xz.cn or GitHub.

    I am using Version 1.3.0 of the plugin. ANy ideas what is happening?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter WPChina

    (@wordpresschina)

    I do see this thread:
    https://ww.wp.xz.cn/support/topic/there-has-been-an-error-with-the-api-date_not_recent/

    And I double-checked and my server and PHP times are aligned and working fine.

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    Unfortunately if you’re seeing that error, something has to be out of alignment. The current time is added to the signature for the request and if it’s off, even slightly, the request will fail. This is entirely out of the hands of the plugin and has to do with the handshake between your server and the Apple News API.

    Even if your server time is off by a minute, it would create an invalid signature on the request. I would double check this and if you’re still experiencing the error, you’ll have to follow up directly with Apple News support. This is unfortunately out of the hands of the plugin.

    Plugin Author Kevin Fodness

    (@kevinfodness)

    Specifically, the date needs to be within 5 minutes of the server time at Apple News, and we’re calculating the date via date( 'c' ). I’d recommend following up with your hosting provider to synchronize the server time with an atomic clock (e.g., time.nist.gov).

    Thread Starter WPChina

    (@wordpresschina)

    Yes I control our box and both server and PHP are set to nist, so accurate within a few seconds. However, we offset to our local +X GMT. Could the offset be the problem? If so, that’s tough to change as the offset is important for many other server-side functions.

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    Just to be clear, this isn’t a function of the plugin but how the Apple News API itself works. You’ll need to ensure that your requests are being signed with the correct local time that matches what the API is expecting for this to work.

    More info is here: https://developer.apple.com/library/content/documentation/General/Conceptual/News_API_Ref/Security.html#//apple_ref/doc/uid/TP40015409-CH5-SW1

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘“API: DATE_NOT_RECENT” error’ is closed to new replies.