• Resolved kiruba92

    (@kiruba92)


    We updated the woo commerce plugin latest version as 3.4 in local and test server.

    Woo Rest API is not getting value properly. It is getting an empty value.

    when we print the JSON value and it is getting below error in woo commerce.

    ex:
    res=wcapi.get(“orders/18647”)
    print res.json()

    raise ValueError(“No JSON object could be decoded”)
    ValueError: No JSON object could be decoded

    Code:

    wcapi = API(
       url="https://www.example.com/",
       consumer_key="xxxx",
       consumer_secret="yyyy",
       wp_api=True,
       version="wc/v2",
       query_string_auth= True,
    )
    if(wcapi):
    	print(wcapi)
    res=wcapi.get("")
    print res
    print res.status_code
    print res.headers['content-type']
    if(res.text==""):
    	print "Empty data "
    else:
    	print res.text

    Output:

    <woocommerce.api.API object at 0x7f27860e66d0>
    <Response [200]>
    200
    application/json; charset=UTF-8
    Empty data
    2.7.12

    • This topic was modified 6 years, 10 months ago by kiruba92.
    • This topic was modified 6 years, 10 months ago by kiruba92.
    • This topic was modified 6 years, 10 months ago by kiruba92.
    • This topic was modified 6 years, 10 months ago by kiruba92.
    • This topic was modified 6 years, 10 months ago by kiruba92.
    • This topic was modified 6 years, 10 months ago by kiruba92.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:
    * WooCommerce Slack Community: https://woocommerce.com/community-slack/
    * Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Thread Starter kiruba92

    (@kiruba92)

    We resolved the issue. The customer has updated the password protected plugin in WordPress. In this plugin, Setting page inside, They do not enable the Allow REST API Access field. We checked and enabled on it. It is getting the correct API access.

    • This reply was modified 6 years, 9 months ago by kiruba92.
    • This reply was modified 6 years, 9 months ago by kiruba92.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘why woocommerce REST api is returning empty value’ is closed to new replies.