Skip to main content
Nintex Community Menu Bar
Question

The specified value is unknown. [Error Code: TypeCasting.UnknownCasting] when calling API to get file

  • August 12, 2025
  • 3 replies
  • 39 views

Forum|alt.badge.img+4

Hello,

I get the following error The specified value is unknown. [Error Code: TypeCasting.UnknownCasting] when calling a xtension which should return an ics file.

The xtension is a .net core api and nintex does recognize the specified result type as file.

The responses part of the definitions looks like this:

"responses": {

               "200": {

                  "description": "OK",

                  "schema": {

                     "type": "object",

                     "properties": {

                        "file": {

                           "type": "string",

                           "format": "byte"

                        }

                     }

                  }

               }

            }

I tried it according to OpenAPI Specification quick reference and Download base64 files but they differ on the properties part “file” <> “content”. But both ways dont work.

But when calling the xtension i get this error.

Is there anything, that I am missing?

Thank you in advance!

Niklas

3 replies

Forum|alt.badge.img+4
  • Author
  • Rookie
  • August 12, 2025

I think i got a bit further now.

I am now returning a base64 string from my api an not a filecontentresult.

I am creating the string like this: "data:text/calendar;base64," + Convert.ToBase64String(myBytes)

Now the workflows successfully calls the xtension, but when i try to send the received attachment via mail, i get the error “[WorkflowExecution.Runtime.Internal] The workflow failed unexpectedly.”

The received object is structured like this:

When i send the objICSFile the mail successfully sends, but without any attachments, and when i send the Content the mail runs into the error above.


SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • August 18, 2025

Hi ​@NiklasG,

I was recently playing with the Nintex API and exporting workflows.
I found that configuring my response as per the below put the file into a file variable, which I could then use downstream in the workflow.
Maybe this might work for you.
 

                "responses": {
"200": {
"description": "Successful download",
"schema": {
"type": "file"
}
},


 


MillaZ
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • August 25, 2025

Hi ​@NiklasG have you solved this error?