• Resolved samblis

    (@samblis)


    I am getting the following error. I have remote image sellected as a yes.

    There has been an error with the API:
    INVALID_DOCUMENT – “text” was “” should be not (null or an empty string) (keyPath components->1->components->35->text)
    INVALID_DOCUMENT – no components defined for role=body (keyPath components->1->components->35)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    Can you please send over the JSON for the article in question via a pastebin.com link? You can get the JSON for the article by clicking on Apple News in the WordPress sidebar, then finding the article and clicking the Download link.

    Thread Starter samblis

    (@samblis)

    Hi,

    Thanks for the help. Here is the paste bin link https://pastebin.com/6uiApVWZ

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    The issue is this part of the JSON:

    {"role":"body","text":"<p> <\/p>","format":"html","textStyle":"default-body","layout":"body-layout"}

    That’s an empty paragraph which gets evaluated as an empty string in Apple News and results in an error. It looks like the image that appears above this empty paragraph has three non-breaking spaces after it which is introducing this issue: &nbsp;&nbsp;&nbsp;. Removing those would fix the error.

    After you fix that however, this article is still going to generate numerous other errors for small images. Apple News requires that images are 640px wide or greater to ensure that they display nicely on all devices. Many of your images included in this JSON file do not meet that minimum requirement.

    Thread Starter samblis

    (@samblis)

    I am looking at the code version of the article and it does not seem to have any &nbsp in it. Sorry.

    Should change the Json?

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    You can’t change the JSON without writing some custom code. We’re going to resolve this in the plugin as a top priority, though we don’t have an ETA at this time. You can track progress here: https://github.com/alleyinteractive/apple-news/issues/352

    Plugin Author Kevin Fodness

    (@kevinfodness)

    Closing this issue in favor of tracking progress on a fix via GitHub.

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

The topic ‘There has been an error with the API:’ is closed to new replies.