box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue: CopyFileRequestAsync and GetFileRequestByIdAsync fails with casting error

ShankarItKY opened this issue · comments

Box Team, I am trying to access the CopyFileRequestAsync and GetFileRequestByIdAsync methods using SDK but the API failed with the error message "Unable to cast object of type Box.V2.Models.BoxEntity to type Box.V2.Models.BoxFileRequestObject" and the line number is 7. Please find the case number which I created in box support below.

Code:
1var boxFileRequestObjectresponse = new BoxFileRequestObject();
2FileStream jsonConfig = new FileStream("C:\appsettingsbox.json", FileMode.Open);
3 var config = BoxConfigBuilder.CreateFromJsonFile(jsonConfig).Build();
4 var session = new BoxJWTAuth(config);
5 var adminToken = await session.AdminTokenAsync();
6 BoxClient client = session.AdminClient(adminToken);
7 boxFileRequestObjectresponse = await client.FileRequestsManager.GetFileRequestByIdAsync("3703363788");

Case #2782003
Created on: January 30, 2023, 12:43
Link: https://support.box.com/hc/en-us/requests/2782003?page=1
Issue: CopyFileRequestAsync and GetFileRequestByIdAsync fails with casting error

Hi @ShankarItKY

Please follow our instruction for the file request here and check if it works?

If the problem persist, please let us know.

Best regards,
Minh

Minh, Please fidn the attached screenshot. I am still facing the same error.

Box_Issue

Hi @ShankarItKY

I am checking this issue and will get back to you when I have any updates.

Hi @ShankarItKY

Thanks for your patience, as I identified, this is an error due to API changes, we will work with them to clarify this issue.

I will back to you when I have some updates.

Best regards,
Minh

Hi @ShankarItKY
We got an updates and now it's working as usual.
I'm closing this issue now and if it not works, you can reopen it anytime.
Best regards,
Minh