Forum Discussion
C# 5.1 API SDK missing error object from exports
- 1 month ago
Hi zaxbysdt
Thank you for sharing the detailed comparison.
From what you've posted, it appears you're observing a discrepancy between the REST API response and the Microsoft.PowerBI.Api 5.1.0 .NET SDK.
Your Postman response clearly includes an error object when the export status is Failed:
"status": "Failed",
"error": {
"code": "...",
"message": "...",
"details": []
}
However, the Export model in Microsoft.PowerBI.Api 5.1.0 does not expose an Error property, which means the SDK cannot surface these failure details through its strongly typed model.
Additionally, the current Microsoft Learn documentation for Get Export To File Status defines the Export object without an error property, even though the REST service appears to return one in failure scenarios. This suggests there is currently a mismatch between the service behavior, the SDK model, and the published documentation.
As a workaround, you could:
- Call the REST endpoint directly and inspect the raw JSON response.
- Deserialize the response yourself instead of relying solely on the SDK model if you need the failure details.
- If you're using the SDK, inspect the underlying HTTP response (if available) to capture the additional JSON payload.
Based on the evidence you've provided, this looks like a potential SDK or documentation issue rather than expected behavior.
For Reference:
Get Export To File Status (REST API)
Best Regards,
Abdul Rafi - 1 month ago
Hi zaxbysdt,
Good catch - I can repro this on 5.1.0. The Export model is definitely missing the Error property even though the REST API returns it.
**Workaround until fixed:**
You can deserialize to a custom class or use `dynamic`/`JObject` to access the error:
```csharp
var json = await response.Content.ReadAsStringAsync();
var exportWithError = JsonSerializer.Deserialize<ExportWithError>(json);
public class ExportWithError : Export
{
public ExportError Error { get; set; }
}
public class ExportError
{
public string Code { get; set; }
public string Message { get; set; }
public object[] Details { get; set; }
}
Hi zaxbysdt ,
Thank you for reaching out to Microsoft Fabric Community and thanks to Gautam_Kumar01 for providing meaningful insights
Just wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Best Regards,
Abdul Rafi
- zaxbysdt1 month agoRegular Visitor
Yes I have. Thank you for your response! You've confirmed my suspicions that the missing Error object is an oversight and not user error. Cheers.