CenResService

<back to all web services

MessageAcknowledgement

The following routes are available for this service:
POST/acknowlegement/{SubscriptionId}/{CendynPropertyId}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Response:
    status_code: Optional[str] = None
    record_count: Optional[int] = None
    error_count: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UniqueIDType:
    id: Optional[str] = None
    type: Optional[str] = None
    context: Optional[str] = None


class StatusMessageType(str, Enum):
    INFO = 'Info'
    WARNING = 'Warning'
    ERROR = 'Error'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class StatusMessage:
    message_type: Optional[StatusMessageType] = None
    code: Optional[str] = None
    message: Optional[str] = None
    target: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Acknowledgement:
    cendyn_property_i_d: Optional[str] = None
    hotel_code: Optional[str] = None
    success: Optional[bool] = None
    echo_token: Optional[str] = None
    unique_i_ds: Optional[List[UniqueIDType]] = None
    messages: Optional[List[StatusMessage]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MessageAcknowledgement:
    acknowledgement: Optional[Acknowledgement] = None
    subscription_id: Optional[str] = None
    cendyn_property_id: Optional[str] = None

Python MessageAcknowledgement DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /acknowlegement/{SubscriptionId}/{CendynPropertyId} HTTP/1.1 
Host: cert.cendyn.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<MessageAcknowledgement xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <Acknowledgement>
    <CendynPropertyID>String</CendynPropertyID>
    <EchoToken>String</EchoToken>
    <HotelCode>String</HotelCode>
    <Messages>
      <StatusMessage>
        <Code>String</Code>
        <Message>String</Message>
        <MessageType>Info</MessageType>
        <Target>String</Target>
      </StatusMessage>
    </Messages>
    <Success>false</Success>
    <UniqueIDs>
      <UniqueIDType>
        <Context>String</Context>
        <ID>String</ID>
        <Type>String</Type>
      </UniqueIDType>
    </UniqueIDs>
  </Acknowledgement>
  <CendynPropertyId>String</CendynPropertyId>
  <SubscriptionId>String</SubscriptionId>
</MessageAcknowledgement>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <ErrorCount>0</ErrorCount>
  <RecordCount>0</RecordCount>
  <StatusCode>String</StatusCode>
</Response>