Discussions
SuiteWorld is the largest annual gathering of the NetSuite community! It will be held in Las Vegas on October 6-9, 2025. Our customers and partners look forward to SuiteWorld every year as a place to hear the latest from NetSuite, get hands-on learning, and connect with each other. Register now!
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'}]}