Skip to main content
Nintex Community Menu Bar

when Rest API smartObject executed, in response it is returning back blank values with code=0

  • November 4, 2022
  • 3 replies
  • 20 views
  • Translate

when Rest API smartObject executed, in response it is returning back blank values.

and the response code is 0.

 

I have also tried with openweather API it shows same result.

 

PFA screen shot.

 

When I tested Rest API and the JSON descriptor document also in POSTMAN client, Response code is 200. test is successful.

 

but not able to understand from k2 why it does not returning expected result.

Guys, Kindly let me know how to resolve it.

I will really greatfull for your technical help.

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

3 replies

Forum|alt.badge.img+9
  • Rookie
  • 114 replies
  • November 7, 2022

Hi there,

 

When you make the call in POSTMAN, do you have any default headers set against the request being made?

 

If so you'll need to also pass them through on the request.  You can on the service instance set the value of Add HTTP Request Header Property To Methods to true, this will then allow you to pass in serialised HTTP Header values to the request, or if they are always the same you can set them against the service instance in the Default HTTP Request Headers value. 

 

The below example is serialised from the HttpHeaders SmartObject Serialise add item to Array method and sets the Accept header to application/json;odata=verbose, which can then be added to either of the above places:

 

{"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader[], SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null","$values":[{"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader, SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null","Name":"Accept","Value":"application/json;odata=verbose"}]}

 

Cheers

Translate

  • Author
  • 2 replies
  • November 15, 2022
thanks Scout.
Translate

Forum|alt.badge.img+10
  • Nintex Employee
  • 176 replies
  • November 23, 2022

Another possible cause may be the response section of your swagger file:

https://help.nintex.com/en-US/k2five/userguide/current/default.htm#ServiceBrokers/EndPoints/REST_SwaggerFileReferenceFormat.htm

Do you have a response definition for 200? If it is a complex response, do you have a ref and a definition defined?

Translate

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