I'trying to get some reports urls trough Python endpoint API but I keep getting this message
> b'{"code":400,"status":"BadRequest","error":"InvalidRequest","errorCode":1071,"errorMessage":"Invalid JSON in request","errorHash":"7a38e6552fcba244116c028ea9ba90bb","errorDetails":{"ValidationError":["Invalid JSON primitive: ReportName."]}}'
However, the report name comes from a valid report (as shown in attachment) and according to the docs, `ReportName` is a valid and required field.
This is the piece of code that I'm using:
data = dict() data["ReportName"] = report_name data["Year"] = date.year data["Month"] = date.month data["Day"] = date.day header = dict() header["Content-Type"] = "application/json" header["X-SecretKey"] = self.config.get("playfab", "token") try: r = requests.post(self.config.get("playfab", "endpoint"), data=data, headers=header) r = r.json() # OTHER STUFF else: self.info.exception("Empty response from PlayFab endpoint.") except Exception as exc: self.logger.exception("Error accessing PlayFab endpoint.")
`data` look like this:
<class 'dict'>: {'ReportName': 'Thirty Day Retention Report', 'Year': 2018, 'Month': 11, 'Day': 26}
I can't figure it out what is wrong.
,
I'trying to get some reports urls trough Python endpoint API but I keep getting this message
> b'{"code":400,"status":"BadRequest","error":"InvalidRequest","errorCode":1071,"errorMessage":"Invalid JSON in request","errorHash":"7a38e6552fcba244116c028ea9ba90bb","errorDetails":{"ValidationError":["Invalid JSON primitive: ReportName."]}}'
However, the report name comes from a valid report (as shown in attachment) and according to the docs, `ReportName` is a valid and required field.
This is the piece of code that I'm using:
data = dict() data["ReportName"] = report_name data["Year"] = date.year data["Month"] = date.month data["Day"] = date.day header = dict() header["Content-Type"] = "application/json" header["X-SecretKey"] = self.config.get("playfab", "token") try: r = requests.post(self.config.get("playfab", "endpoint"), data=data, headers=header) r = r.json() # OTHER STUFF else: self.info.exception("Empty response from PlayFab endpoint.") except Exception as exc: self.logger.exception("Error accessing PlayFab endpoint.")
`data` look like this:
<class 'dict'>: {'ReportName': 'Thirty Day Retention Report', 'Year': 2018, 'Month': 11, 'Day': 26}
I can't figure it out what is wrong.