POST api/News/CreateOrUpdate

Create or update news

Request Information

URI Parameters

None.

Body Parameters

NewsEdit
NameDescriptionTypeAdditional information
Id

integer

None.

Title

string

None.

Content

string

None.

Url

string

None.

NewsGroupTypeId

integer

None.

OnTop

integer

None.

StartDate

date

None.

EndDate

date

None.

CompanyIds

Collection of integer

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "Title": "sample string 2",
  "Content": "sample string 3",
  "Url": "sample string 4",
  "NewsGroupTypeId": 5,
  "OnTop": 6,
  "StartDate": "2026-04-01T16:38:25.7529233+07:00",
  "EndDate": "2026-04-01T16:38:25.7529233+07:00",
  "CompanyIds": [
    1,
    2
  ]
}

text/html

Sample:
{"Id":1,"Title":"sample string 2","Content":"sample string 3","Url":"sample string 4","NewsGroupTypeId":5,"OnTop":6,"StartDate":"2026-04-01T16:38:25.7529233+07:00","EndDate":"2026-04-01T16:38:25.7529233+07:00","CompanyIds":[1,2]}

application/xml, text/xml

Sample:
<NewsEdit xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TTMWM_MECLAIM_API.ViewModels">
  <CompanyIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>1</d2p1:int>
    <d2p1:int>2</d2p1:int>
  </CompanyIds>
  <Content>sample string 3</Content>
  <EndDate>2026-04-01T16:38:25.7529233+07:00</EndDate>
  <Id>1</Id>
  <NewsGroupTypeId>5</NewsGroupTypeId>
  <OnTop>6</OnTop>
  <StartDate>2026-04-01T16:38:25.7529233+07:00</StartDate>
  <Title>sample string 2</Title>
  <Url>sample string 4</Url>
</NewsEdit>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

News

ServiceResultTypedOfNewsDetail
NameDescriptionTypeAdditional information
Code

integer

None.

Errors

Collection of string

None.

Data

NewsDetail

None.

Response Formats

application/json, text/json

Sample:
{
  "Code": 1,
  "Errors": [
    "sample string 1",
    "sample string 2"
  ],
  "Data": {
    "Id": 1,
    "CreatedDate": "2026-04-01T16:38:25.7559217+07:00",
    "CreatedDateStr": "sample string 3",
    "UpdatedDate": "2026-04-01T16:38:25.7559217+07:00",
    "UpdatedDateStr": "sample string 5",
    "Title": "sample string 6",
    "HeaderImageId": 1,
    "Content": "sample string 7",
    "StartDate": "2026-04-01T16:38:25.7559217+07:00",
    "StartDateStr": "sample string 9",
    "EndDate": "2026-04-01T16:38:25.7559217+07:00",
    "EndDateStr": "sample string 11",
    "NewsGroupTypeId": 12,
    "Url": "sample string 13",
    "OnTop": 14,
    "HeaderImageName": "sample string 15",
    "HeaderImageUrl": "sample string 16",
    "CompanyIds": [
      1,
      2
    ],
    "NewsGroupTypeName": "sample string 17",
    "EmployeeCompanyId": 1
  }
}

text/html

Sample:
{"Code":1,"Errors":["sample string 1","sample string 2"],"Data":{"Id":1,"CreatedDate":"2026-04-01T16:38:25.7559217+07:00","CreatedDateStr":"sample string 3","UpdatedDate":"2026-04-01T16:38:25.7559217+07:00","UpdatedDateStr":"sample string 5","Title":"sample string 6","HeaderImageId":1,"Content":"sample string 7","StartDate":"2026-04-01T16:38:25.7559217+07:00","StartDateStr":"sample string 9","EndDate":"2026-04-01T16:38:25.7559217+07:00","EndDateStr":"sample string 11","NewsGroupTypeId":12,"Url":"sample string 13","OnTop":14,"HeaderImageName":"sample string 15","HeaderImageUrl":"sample string 16","CompanyIds":[1,2],"NewsGroupTypeName":"sample string 17","EmployeeCompanyId":1}}

application/xml, text/xml

Sample:
<ServiceResultTypedOfNewsDetailYj8O1tFc xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LSW.Common.Models">
  <Code>1</Code>
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/TTMWM_MECLAIM_API.ViewModels">
    <d2p1:CompanyIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>1</d3p1:int>
      <d3p1:int>2</d3p1:int>
    </d2p1:CompanyIds>
    <d2p1:Content>sample string 7</d2p1:Content>
    <d2p1:CreatedDate>2026-04-01T16:38:25.7559217+07:00</d2p1:CreatedDate>
    <d2p1:CreatedDateStr>sample string 3</d2p1:CreatedDateStr>
    <d2p1:EmployeeCompanyId>1</d2p1:EmployeeCompanyId>
    <d2p1:EndDate>2026-04-01T16:38:25.7559217+07:00</d2p1:EndDate>
    <d2p1:EndDateStr>sample string 11</d2p1:EndDateStr>
    <d2p1:HeaderImageId>1</d2p1:HeaderImageId>
    <d2p1:HeaderImageName>sample string 15</d2p1:HeaderImageName>
    <d2p1:HeaderImageUrl>sample string 16</d2p1:HeaderImageUrl>
    <d2p1:Id>1</d2p1:Id>
    <d2p1:NewsGroupTypeId>12</d2p1:NewsGroupTypeId>
    <d2p1:NewsGroupTypeName>sample string 17</d2p1:NewsGroupTypeName>
    <d2p1:OnTop>14</d2p1:OnTop>
    <d2p1:StartDate>2026-04-01T16:38:25.7559217+07:00</d2p1:StartDate>
    <d2p1:StartDateStr>sample string 9</d2p1:StartDateStr>
    <d2p1:Title>sample string 6</d2p1:Title>
    <d2p1:UpdatedDate>2026-04-01T16:38:25.7559217+07:00</d2p1:UpdatedDate>
    <d2p1:UpdatedDateStr>sample string 5</d2p1:UpdatedDateStr>
    <d2p1:Url>sample string 13</d2p1:Url>
  </Data>
  <Errors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Errors>
</ServiceResultTypedOfNewsDetailYj8O1tFc>