• Resolved rwk2019

    (@rwk2019)


    See below error output,
    I am getting this when I click submit.

    I created a very very basic form and a very basic API, and it already throws this error.

    what is wrong in my setup?

    2022-10-31 14:01:48.939667 [NOTICE] [524884] [212.57.58.2:3829-Q:A1A1405E0B4CAAE1-0#www.domain.com] [STDERR] PHP Fatal error:  Uncaught Error: Cannot use object of type WP_Error as array in /home/sites/www.domain.com/web/wp-content/plugins/contact-form-to-any-api/admin/class-cf7-to-any-api-admin.php:410
    Stack trace:
    #0 /home/sites/www.domain.com/web/wp-content/plugins/contact-form-to-any-api/admin/class-cf7-to-any-api-admin.php(312): Cf7_To_Any_Api_Admin::cf7anyapi_send_lead()
    #1 /home/sites/www.domain.com/web/wp-includes/class-wp-hook.php(307): Cf7_To_Any_Api_Admin::cf7_to_any_api_send_data_to_api()
    #2 /home/sites/www.domain.com/web/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 /home/sites/www.domain.com/web/wp-includes/plugin.php(476): WP_Hook->do_action()
    #4 /home/sites/www.domain.com/web/wp-content/plugins/contact-form-7/includes/submission.php(117): do_action()
    #5 /home/sites/www.domain.com/web/wp-content/plugins/contact-form-7/includes/submission.php(33): WPCF7_Submission->proceed()
    #6 /home/sites/www.domain.com/web/wp-content/plugins/contact-form-7/includes/contact-form.php(1047): WPCF7_Submission::get_instance()
    #7 /home/sites/www.domain.com/web/wp-content/plugins/contact-form-7/includes/rest-api.php(357): WPCF7_ContactForm->submit()
    #8 /home/sites/www.domain.com/web/wp-includes/rest-api/class-wp-rest-server.php(1143): WPCF7_REST_Controller->create_feedback()
    #9 /home/sites/www.domain.com/web/wp-includes/rest-api/class-wp-rest-server.php(990): WP_REST_Server->respond_to_request()
    #10 /home/sites/www.domain.com/web/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Server->dispatch()
    #11 /home/sites/www.domain.com/web/wp-includes/rest-api.php(394): WP_REST_Server->serve_request()
    #12 /home/sites/www.domain.com/web/wp-includes/class-wp-hook.php(307): rest_api_loaded()
    #13 /home/sites/www.domain.com/web/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #14 /home/sites/www.domain.com/web/wp-includes/plugin.php(524): WP_Hook->do_action()
    #15 /home/sites/www.domain.com/web/wp-includes/class-wp.php(398): do_action_ref_array()
    #16 /home/sites/www.domain.com/web/wp-i
    2022-10-31 14:01:48.939720 [NOTICE] [524884] [212.57.58.2:3829-Q:A1A1405E0B4CAAE1-0#www.domain.com] [STDERR] ncludes/class-wp.php(770): WP->parse_request()
    #17 /home/sites/www.domain.com/web/wp-includes/functions.php(1330): WP->main()
    #18 /home/sites/www.domain.com/web/wp-blog-header.php(16): wp()
    #19 /home/sites/www.domain.com/web/index.php(17): require('...')
    #20 {main}
      thrown in /home/sites/www.domain.com/web/wp-content/plugins/contact-form-to-any-api/admin/class-cf7-to-any-api-admin.php on line 410
Viewing 5 replies - 1 through 5 (of 5 total)
  • Vicky Makwana

    (@vickymakwana1111)

    Hello @rwk2019

    Thank you for using our plugin we would love to assist you.

    Can you please describe more? Like, when you are getting errors? It would be great if you provide a video or screenshot.
    or
    Try our latest version hopefully it will fix your issue.

    Thanks

    Thread Starter rwk2019

    (@rwk2019)

    Actually, I wanted to try again and we reinstalled the plugin,
    but now it seems that the CUSTOM JSON field is gone?
    Have you updated the patch, not allowing me to build my own custom JSON anymore?

    (when input type = json)

    Vicky Makwana

    (@vickymakwana1111)

    Hello @rwk2019
    Thanks for using our plugin

    We don’t have custom JSON input in our plugin. we used a predefined JSON format.

    When You select the form using the dropdown, all the fields created in that form are displayed below in the “Map your Fields” with your form field name.

    In the text field, you have to map your API key parameter with the form field name.

    Then we programmatically created JSON format, like the below format.

    {"Your API Key Parameter":"Your Form Field Data when user submit ","Your API Key Parameter":"Your Form Field Data when user submit"}

    Example –
    {"firstname":"your-first-name","lastname":"your-last-name", "email":"your-email"}

    And the “Header Request” Field you have to set your API Platform needed all your header parameters over there.

    Example –
    Authorization: MY_API_KEY
    Authorization : Bearer xxxxxxx
    Authorization : Basic xxxxxx
    Content-Type: application/json

    for more information, you can check the documentation link of our plugin.
    Let us know if that helps you.
    Thanks

    Thread Starter rwk2019

    (@rwk2019)

    Hi

    in some other scripts, you have the possibility to make NESTED JSON.
    So, like:

    {
       "service":"_Signup",
       "method":"validate_customer",
          "valid":true,
          "customer_info":{
             "number":"24412042",
             "name":[your-name]
          }
       },
       "realm":"isAdmin",
       "i_env":1
    }

    Could you perhaps please make that too? Some text input box.
    I thought your script had this too.
    That would be awesome. I would even be willing to pay for a Pro version, if you got this to work.

    Plugin Author IT Path Solutions

    (@itpathsolutions)

    Hi @rwk2019

    Thanks for choosing our service. We are happy to help you on it.
    Please contact with [email protected] or Skype: itpathsolutions

    We will establish a connection and will share updated version with you to achieve your requirements.

    Looking forward from you to hear back.
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CF7 to API throws error’ is closed to new replies.