• Resolved doshisahil

    (@doshisahil)


    I am trying to access a server for a certain JSON Api. But I am getting the Empty API-answer: No JSON Recieved for the same.

    When I access that URL in the web browser by typing the url directly, it works.

    But it doesn’t work here.

    [jsoncontentimporter url=”https://103.224.247.200:7500/m/sahil” numberofdisplayeditems=””]

    • {file}[/jsoncontentimporter]

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    try
    [jsoncontentimporter url=https://103.224.247.200:7500/m/sahil]{file}[/jsoncontentimporter]

    The quotationmarks in your posting creat a invalid URL.

    see https://wptest.kux.de/103-224-247-2007500/

    Bernhard

    Thread Starter doshisahil

    (@doshisahil)

    Hi, I’m getting the same error. I changed the url inside the shortcode but it didn’t change the result

    Thread Starter doshisahil

    (@doshisahil)

    I even disabled all the themes and the plugins except the json content importer but it still didn’t work.

    Plugin Author berkux

    (@berkux)

    try to copypaste this:
    [jsoncontentimporter url=https://103.224.247.200:7500/m/sahil debugmode=10]{file}[/jsoncontentimporter]

    Can I then see the Page you using it?

    • This reply was modified 4 years, 9 months ago by berkux.
    Thread Starter doshisahil

    (@doshisahil)

    Hi,

    I have added this code. Please check out this page:

    https://www.agri10x.com/dummy-page

    It is showing a connection timed out error however, when you open this URL in the browser, it works. So, that is not an issue.

    Please sort this. Thanks

    Plugin Author berkux

    (@berkux)

    Hi,

    Try another url like https://worldtimeapi.org/api/timezone/Europe/Berlin
    If this works: maybe your serverhoster configured php to be unable to retrieve special urls, like the one on port 7500

    If thisis not working: has your hoster blockedall requests.

    Bernhard

    Thread Starter doshisahil

    (@doshisahil)

    It is being able to access other APIs. But just not this one. What settings could be a potential issue? Could you please check?

    Plugin Author berkux

    (@berkux)

    Ask your webserver-hoster if there are any security settings that forbid php-requests on port 7500

    Thread Starter doshisahil

    (@doshisahil)

    But how will that affect my api? The api is on the data server that I was calling. There is no authentication on that api and all ports are open where the data server is because I am able to access this api with a web browser

    Plugin Author berkux

    (@berkux)

    Access to an url via web browser and via php-wordpress-server might be very different.
    My guess is still: the php on the webserver can‘t load the url due to port 7500.
    To verify that you also can try a php script on your server using
    https://www.php.net/manual/de/function.file-get-contents.php

    Thread Starter doshisahil

    (@doshisahil)

    I tried out the PHP script. I get a blank page.

    Also, if a web browser is able to access the API, that means that there are no port issues because the connection between the browser and the server is happening. The JSON file is showing properly. So, I dont think it is the webserver issue at all.

    By webserver, you mean where the 103.224.247.200:7500 is right?

    Plugin Author berkux

    (@berkux)

    You might have a temp login to Your wordpress which you can post at
    https://jsoncontentimporter.freshdesk.com/widgets/feedback_widget/new?searchArea=no
    in private?

    << Also, if a web browser is able to access the API, that means that there are no port issues because the connection between the browser and the server is happening. >>
    this is true in 99,9% of all situations.
    But not always…
    In the end a browser creates an http-get request with his http-requestsoftware. When using wordpress, php, jci the request is done with other techniques.

    Thread Starter doshisahil

    (@doshisahil)

    I have sent my admin creds to access the backend wp-admin for this. Please feel free to check it out. I am using the file called agri10x.com/data-server.php to access the data servers API

    Thread Starter doshisahil

    (@doshisahil)

    Any luck?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Empty API-answer’ is closed to new replies.