Skip to main content
Nintex Community Menu Bar

Rest service returns results as a string instead of json

  • February 16, 2021
  • 0 replies
  • 43 views
  • Translate

Issue

When generating a Swagger Descriptor for REST-based Services using RESTUnited.com and the accept header on the request is not text/plain, the response from the Rest API may return the results as a string value instead of the expected Json. This will cause the SmartObject of the rest service to present an error.

 

Error Code

"Error","SmartObjects","10702","Error","SourceCode.SmartObjects.ServiceBroker [ExecuteSmartObject]","10702 An error occurred in the K2_Management Service Instance. System.Exception: Service: [Service Name]
Service Guid: ef2dd87a-eaf3-42c4-bac1-e8a0312defd3
Severity: Error
Error Message: Encountered a problem calling REST service. (Inner: Error converting value......
InnerException Message: at SourceCode.SmartObjects.Services.K2Management.SmartObjects.Client.ManagementService.ExecuteSmartObjectWithResultCount(Guid SmartObjectGuid, String MethodName, SmartProperty[] InputProperties)","anonymous","0.0.0.0","[K2 Server name]:C:Program FilesK2Host ServerBin","867777006","1844a6751cc6472798aaa7b9ad574ed7",""

Resolution

You need to change the accept header on the request to text/plain. This will return the results of the API as the expected json. 

Additional Information

-  This was discovered in K2 Five (5.3).

- This issue occurred only on Get methods from the swagger that had an array/s.

Related Links

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings