Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Getting Response Code 202 and SG-Captcha Challenge #294

@javieralcantara

Description

@javieralcantara

I am calling your API from a gcloud-hosted Flast API service I developed. This has worked for 2 years and started failing this week. When I run the Flast API Server locally I have no issues. However, when I use the gcloud-hosted one I only get a few requests in correctly and I then start getting this response from Woocomcerce's /orders endpoint:

Response Headers: {'Server': 'nginx', 'Date': 'Fri, 15 Nov 2024 18:45:57 GMT', 'Content-Type': 'text/html', 'Content-Length': '261', 'Connection': 'keep-alive', 'SG-Captcha': 'challenge', 'X-Robots-Tag': 'noindex', 'Set-Cookie': 'nevercache-b39818=Y;Max-Age=-1', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Cache-Control': 'no-store,no-cache,max-age=0', 'Host-Header': '8441280b0c35cbc1147f8ba998a563a7', 'X-Proxy-Cache-Info': 'DT:1'}

Response Status: 202

Response Body: <html><head><link rel="icon" href="data:;"><meta http-equiv="refresh" content="0;/.well-known/sgcaptcha/?r=%2Fwp-json%2Fwc%2Fv3%2Forders%3Fper_page%3D100%26page%3D1%26after%3D2024-11-05T18%3A45%3A57.877865&y=ipr:34.96.41.48:1731696357.967"></meta></head></html>

My code is nothing fancy, but if interested:

...
      two_week_ago = datetime.now() - timedelta(days=10)
      orders = totalOrders = []

      filter = {
          "per_page": 100,
          "page": 1,
          "after": two_week_ago.isoformat(),
      }
      response = wcapi.get('orders', params=filter)
      try:
          orders = response.json()
          totalOrders.extend(orders)
      except Exception as e:
          print(f"Error getting initial list of orders on page {filter['page']}")
          print(f"Response Status: {response.status_code}")
          print(f"Response Headers: {response.headers}")
          print(f"Response Body: {response.text}")
          print(e)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions