1

I am using Sitefinity webservice module to post data to the content. I am using Postman to test the POST method for odata.

My Post method       /api/AzureFunctionSitefinity/azuresitefinityintegrations

My Model :APPLICATION/JSON

  {
    "UrlName": "sample string 1",
    "Title": "sample string 2",
    "VacancyId": 1.0,
    "VacancyReferenceNumber": 1.0,
    "VacancyGuid": "sample string 3",
    "ShortDescription": "sample string 4",
    "StartDate": "2017-09-19T07:32:50.5023011Z",
    "EndDate": "2017-09-19T07:32:50.5023011Z"
    }

Whenever I am posting using the content-type application/json for odata its returning 200 rather than 201 which i am expecting it to return.

Even i tried posting with

 {
"@odata.type" :"Telerik.Sitefinity.DynamicTypes.Model.AzureFunctionSitefinityIntegration.AzureSitefinityIntegration",
"PublicationDate": "2017-09-19T08:03:53.5165122Z",
 "ExpirationDate": "2017-09-19T08:03:53.5165122Z",
 "UrlName": "sample string 
 "Title": "sample string 3",
 "VacancyId": 1.0,
 "VacancyReferenceNumber": 1.0,
 "VacancyGuid": "sample string 4",
 "ShortDescription": "sample string 5",
 "StartDate": "2017-09-19T08:03:53.5165122Z",
 "EndDate": "2017-09-19T08:03:53.5165122Z"
 }

Still i am getting 200 . I am expecting it to return 201 which says that the data has been created.

Any help on this will be highly appreciated. I am using Postman to post the odata

Dinesh
  • 193
  • 2
  • 14
  • My stupid mistake. My Basic Authentication password was wrong, and the API was configured to be read only for everyone and write permission for authenticated user.So even the basic authentication was wrong still it was giving 200Ok http result. – Dinesh Sep 20 '17 at 09:01

1 Answers1

0

I have tested the mentioned sample with Sitefinity 10.1 and status 401 unauthorized is returned when I don't pass the bearer token. Here is a video Which Siteifnity version are you using. I would recommend to use the JavaScript SDK for you client calls. The library will handle everything internally.

  • Where is the SDK located? – Jon R. Nov 01 '17 at 14:42
  • [Here](https://docs.sitefinity.com/for-developers-client-side-programming-and-web-services) you can find more info about it. Here is a the direct link to npm [link](https://www.npmjs.com/package/sitefinity-webservices-sdk). – Peter Filipov Nov 01 '17 at 21:01