Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create

...

a notice

Description

Creates a new outage notice.

Package Details

Interface

IOutageNoticeManagerINoticeManager

Syntax

await OutageNoticeManagerNoticeManager.Create(OutageNoticeDTO outageNoticeNoticeDTO notice, int userId);

Returns

Task<OutageNotice>Task<Notice>

API

POST
/api/v1/outage-notices

Parameters

...

Parameter

Description

Parameter Type

Notice

Notice object

request body

Sample request body

Code Block
languagejson
{
    "Services":

...

 [
            11    
    ],
    "NoticeTypeCd": "PlannedOutage",
    "EnglishHeaderText": "

...

",

...


    "FrenchHeaderText": "

...

",

...


    "EnglishBodyText": "

...

",

...


    "FrenchBodyText": "

...

",

...


    "StartDate": "2020-10-

...

25T09:00:00.000Z"
    "EndDate": "2020-10-

...

25T11:00:00.000Z"
    "DisplayDate": "2020-10-19T13:14:00.000Z"
}

Returns

200 OK - OutageNoticeNotice

Example

Code Block
languagec#
var

...

 notice = new

...

 NoticeDTO
{    
    Services = new List<int> {2, 7, 11},

...


    NoticeTypeCd = 1
    EnglishHeaderText = "",
    FrenchHeaderText = "",
    EnglishBodyText = "",
    FrenchBodyText = "",
    DisplayDate = DateTime.Now.AddDays(1) 
    StartDate = DateTime.Now.AddDays(2) 
    EndDate = DateTime.Now.AddDays(5)

...


};

...


var userId = 1234;
var notice = await _noticeManager.Create(notice, userId);