Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Unable to make REST Web Service suiteql work in Python
Trying out a suiteql query through the rest service and it does not appear to be working. I am trying the example as per: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157909186990.html
url_q = "https://xxxxxx.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=10&offset=10"
header_q = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Bearer " + access_token,
"Prefer": "transient"
}
r = requests.post(url_q, headers=header_q, data={"q": "SELECT COUNT(*) as count FROM account"})
print(r.json())
This produces the below error code:
{'type': 'https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1', 'title': 'Bad Request', 'status': 400, 'o:errorDetails': [{'detail': 'Invalid content in the request body.', 'o:errorCode': 'INVALID_CONTENT'}]}