Change the response format of Sitefinity default web service

Posted by araman on 17-May-2019 12:30

Hello,

I have created web service for my Sitefinity website referring the document https://www.progress.com/documentation/sitefinity-cms/create-a-web-service and I have used OData for all the filters selections etc.

Below is the sample response I get from one of the web service.

{
"@odata.context": " ",
"value": [
{
"Id": "aa981bde-a977-48db-a0ed-69b077e3fsdfs",
"Title": "Define: Problem",
"Order": "2"
},
{
"Id": "9e346ada-dde9-4a0f-a025-2004932f4dfg",
"Title": "Pre-Planning",
"Order": "1"
}
]
}

Is there a way I can change the response format of the Sitefinity web services. I would like to get a response like :

{
"code": 200,
"data": "THE RESULT OF THE API",
"message": " ",
"status": "OK"
}

code is the HttpStatusCode, status is the HttpStatus, data is the actual result of the API.

Can anyone please help me on this.

Thanks,

Aiswarya

All Replies

This thread is closed