Forum Discussion
Push Datasets - Datasets PostDataset 'The request could not be processed due to missing or invalid
- 5 months ago
Hi ejQap,
A 400 error on POST /datasets usually indicates that your JSON definition no longer passes schema validation or that the API has recently become more strict. It may also relate to authentication changes at tenant level. Validate the JSON structure carefully, test the request in the official API console, and confirm that your access token and permissions are still valid.Changes at tenant or Azure AD application level can cause:- expired or invalid tokens
- altered scopes
- loss of the Dataset.ReadWrite.All permission
In these cases, the service may return a 400 rather than a 403 due to the point at which validation fails.To confirm this, test a simple authorised request such as:If this also fails, the problem may relate to authentication rather than the payload.
Thanks for your reply. I can confirm that our authentication is working fine, since other endpoints are functioning as usual.
The reason I’m asking is that We've been using the same payload for a couple of years and we haven’t made any recent changes. I can only assume there may have been a change in the API schema validation, but I am not able to find any related information.
Another thing I’d like to point out is that even the “Try It” feature in the documentation (https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-post-dataset-in-group) no longer works when using the sample JSON payload.
I’m starting to lose direction on how to debug this, so I’ll go ahead and create a ticket. Thank you anyway.
I also tried to post the sample dataset given in the docs today, and still returning the same error.
It is the same error as when I post my own dataset. The status code is still 400 and the text is empty.
Traceback (most recent call last):
File "\.venv\Lib\site-packages\requests\models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "AppData\Local\Programs\Python\Python311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "powerbi_integration\main.py", line 471, in main
f"Dataset posted failed.details:{response.json()}",
^^^^^^^^^^^^^^^
File "\.venv\Lib\site-packages\requests\models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)