API: "euOnly => 1" as return value

  • lpiguet
    Asked on May 20, 2016 at 8:50 AM

    (I thought I submitted this already, but I can't find it on the system, so I am resubmitting)

    try {
      require_once ('jotform-api-php-master/JotForm.php');

      $api_key = 'XXX';
      $form_id = 'YYY';

      $jotformAPI = new JotForm($api_key, 'json', true);
      var_dump ($jotformAPI);
      $submissions = $jotformAPI->getFormSubmissions($form_id);

      echo '<pre>';
      var_dump($submissions);
      echo '</pre>';
    }
    catch (Exception $e) {
      var_dump($e->getMessage());
    }

    When I run this code (with the proper API key and form ID), I receive the following response:

    array 'euOnly' => int 1


    What is the problem?
    Thank you
  • Welvin Support Team Lead
    Replied on May 20, 2016 at 10:22 AM

    I think this is related to the account settings. You have opted to store your form data to our EU servers. Unfortunately, the support team has a limited knowledge with regards to our API so please contact our API team instead, api@jotform.com

  • lpiguet
    Replied on May 20, 2016 at 10:33 AM

    Actually, for some reason, I had already submitted this question, and received an answer on that thread (sorry for the duplication).

    The answer is:

    For EU users, you have to use https://eu-api.jotform.com as your API endpoint in order to retrieve your form data.

    To do that, open the JotForm.php file and find https://api.jotform.com (it is found on top, line 12) and replace it with https://eu-api.jotform.com

    (I'm guessing a similar fix applies to other languages/architectures)

    Thanks

  • Boris
    Replied on May 20, 2016 at 11:43 AM

    We have two API endpoints. One is for EU only, and the other is for the rest of the world. For EU, you should use:

    https://eu-api.jotform.com/

    For the rest of the world, you should use:

    https://api.jotform.com/

    We do not have any other region-specific API endpoints, only these two - the main one, and the EU one. You can read more about why the EU one had to be created here:

    https://www.jotform.com/blog/eu-safe-harbor/

    If you need further assistance, please let us know.