# API Stadium-Linx response handling other than 200 - Web Service Connector

**URL:** https://community.stadium.software/community/t/api-stadium-linx-response-handling-other-than-200-web-service-connector/222
**Category:** How To
**Created:** [May 10, 2023, 9:41am UTC](https://community.stadium.software/community/t/api-stadium-linx-response-handling-other-than-200-web-service-connector/222 "2023-05-10T09:41:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Pieter-Jan\_Gouws](https://community.stadium.software/community/user_avatar/community.stadium.software/pieter-jan_gouws/32/292_2.png) [@Pieter-Jan\_Gouws](https://community.stadium.software/community/u/Pieter-Jan_Gouws)
#### Post date: [May 10, 2023, 9:41am UTC](https://community.stadium.software/community/t/api-stadium-linx-response-handling-other-than-200-web-service-connector/222/1 "2023-05-10T09:41:49Z")

</div>

Making use of a Web Service Connector in Stadium 6 works great for calling Linx APIs. However when you return a response other than 2XX you would get the error of:  
 ![image](https://community.stadium.software/community/uploads/default/original/1X/52d1d8751c726e5c392cf59092e32b35192bbbd8.png)

To avoid getting this error one should set your return response to application/json format as well. The API definition response should have it’s content: set to “application/json” and Linx must also return the response appropriately. Doing this in Linx, you have to set the HttpContext settings; Status Code and Headers appropriately. Status Code to the response code and Headers should include a list item “content-type” with the value of “application/json”

The header is set as indicated below:

 ![Screenshot 2023-05-10 at 10.39.45](https://community.stadium.software/community/uploads/default/original/1X/8089730334f03c6302bd9258b191ab5cdc4715ec.jpeg)

Attached a sample solution.  
[APIRequests.zip](https://community.stadium.software/community/uploads/short-url/2kllgvUNyHhtqrYBG2PSGUc7k56.zip) (12.1 KB)

_Big shout out to @dawie.botes who is always willing help and quick to respond to us here at Digiata._

---

<div class="post-metadata">

### Author: ![anton.platzoeder](https://community.stadium.software/community/user_avatar/community.stadium.software/anton.platzoeder/32/17_2.png) [@anton.platzoeder](https://community.stadium.software/community/u/anton.platzoeder)
#### Post date: [May 11, 2023, 6:58am UTC](https://community.stadium.software/community/t/api-stadium-linx-response-handling-other-than-200-web-service-connector/222/2 "2023-05-11T06:58:30Z")

</div>

Hi Pieter-Jan,

This does seem like a bug in Linx seeing that the content-type is already defined in the openapi spec as application/json. I will investigate this further on the Linx side as a bug.
