i try to use this API-endpoint using python request: https://api.bigparser.com/api-endpoints/#get-grid-search
I tried it with the following code:
queryTableURL = f"https://www.bigparser.com/api/v2/grid/{gridID}/search"
queryTableRequest = {}
requestHeaders = {'content-type': 'application/json', 'authId': authId}
response = requests.post(queryTableURL, headers=requestHeaders)
# response = requests.post(queryTableURL, data=json.dumps(queryTableRequest), headers=requestHeaders)
responseData = json.loads(response.text)
print(responseData)
But i only get this output: {'errorMessage': 'System error. Please contact admin.', 'otherDetails': {}, 'errorType': 'SYSTEMERROR', 'recoverable': False}
I tried it with both requests.posts above - one time with that one in the the line4 and also with the currently uncommented in line5 - both with the same error from above.
What i am doing wrong? How can i use this API-endpoint?
CodePudding user response:
With the following code it was finally working:
queryTableURL = f"https://www.bigparser.com/api/v2/grid/{gridID}/search"
queryTableRequest = {"query": {"pagination": {
"startRow": 1,
"rowCount": 500
},
}}
requestHeaders = {'content-type': 'application/json', 'authId': authId}
response = requests.post(queryTableURL, data=json.dumps(queryTableRequest), headers=requestHeaders)
responseData = json.loads(response.text)
print(response.status_code)
print(responseData["totalRowCount"])
