다음을 통해 공유


등록 만들기

 

새 등록을 만듭니다. 이 메서드에서 생성하는 등록 ID를 사용하여 나중에 해당 등록을 검색하고 업데이트하고 삭제할 수 있습니다.

요청

방법 요청 URI HTTP 버전
POST https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?api-version=2015-01 HTTP/1.1

요청 헤더

다음 표에서는 필수 요청 헤더와 선택적 요청 헤더에 대해 설명합니다.

요청 헤더 설명
콘텐츠-유형 application/atom+xml;type=entry;charset=utf-8
권한 부여 공유 액세스 서명 인증 된에 지정된대로 생성 한 토큰 서비스 버스, 또는 서비스 버스 인증 및 권한 부여와 Microsoft Azure Active Directory 액세스 제어(액세스 제어 서비스 또는 ACS라고도 함)합니다.
x-ms-version 2015-01

요청 본문

내용에 설명이 포함된 ATOM 항목입니다. 아래에 몇 가지 예제가 나와 있습니다.

Windows 알림 서비스에 대한 기본 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <WindowsRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <ChannelUri>{ChannelUri}</ChannelUri> </WindowsRegistrationDescription> </content> </entry>  

참고

Tags 요소는 선택 사항입니다.

Windows 알림 서비스에 대한 템플릿 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <WindowsTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <ChannelUri>{ChannelUri}</ChannelUri> <BodyTemplate><![CDATA[{Template for the body}]]></BodyTemplate> <WnsHeaders> <WnsHeader> <Header>X-WNS-Type</Header> <Value>wns/tile</Value> </WnsHeader> <WnsHeader> <Header>X-WNS-Tag</Header> <Value>myTag</Value> </WnsHeader> </WnsHeaders> </WindowsTemplateRegistrationDescription> </content> </entry>  

참고

BodyTemplate 요소는 필수, 가능한 한는 X-WNS-Type 헤더입니다.

Apple 푸시 알림 서비스에 대한 기본 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <AppleRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <DeviceToken>{DeviceToken}</DeviceToken> </AppleRegistrationDescription> </content> </entry>  

참고

Tags 요소는 선택 사항입니다.

Apple 푸시 알림 서비스에 대한 템플릿 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <AppleTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <DeviceToken>{DeviceToken}</DeviceToken> <BodyTemplate><![CDATA[{Template for the body}]]></BodyTemplate> <Expiry>{Template for Expiry in }</Expiry> </AppleTemplateRegistrationDescription> </content> </entry>  

참고

BodyTemplate 요소는 필수입니다.Expiry 선택 사항입니다.

Google Cloud Messaging에 대한 기본 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <GcmRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <GcmRegistrationId>{GCM Registration Id}</GcmRegistrationId> </GcmRegistrationDescription> </content> </entry>  

참고

Tags 요소는 선택 사항입니다.

Google Cloud Messaging에 대한 템플릿 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <GcmTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <GcmRegistrationId>{GCM Registration Id}</GcmRegistrationId> <BodyTemplate><![CDATA[ {BodyTemplate}]]></BodyTemplate> </GcmTemplateRegistrationDescription> </content> </entry>  

참고

BodyTemplate 요소는 필수입니다.

Microsoft 푸시 알림 서비스에 대한 기본 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <MpnsRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <ChannelUri>{ChannelUri}</ChannelUri> </MpnsRegistrationDescription> </content> </entry>  

참고

Tags 요소는 선택 사항입니다.

Microsoft 푸시 알림 서비스에 대한 템플릿 등록:

<?xml version="1.0" encoding="utf-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <content type="application/xml"> <MpnsTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <Tags>myTag, myOtherTag</Tags> <ChannelUri>{ChannelUri}</ChannelUri> <BodyTemplate><![CDATA[{Template for the body}]]></BodyTemplate> <MpnsHeaders> <MpnsHeader> <Header>X-WindowsPhone-Target</Header> <Value>toast</Value> </MpnsHeader> <MpnsHeader> <Header>X-NotificationClass</Header> <Value>[batching interval]</Value> </MpnsHeader> </MpnsHeaders> </MpnsTemplateRegistrationDescription> </content> </entry>  

참고

BodyTemplate 요소는 필수, 가능한 한는 X-WindowsPhone-Target 헤더입니다.

응답

응답에는 HTTP 상태 코드 및 응답 헤더 집합이 포함되어 있습니다.

응답 코드

코드 설명
201 등록이 만들어졌습니다.
400 잘못된 요청 본문입니다. 요청의 형식이 잘못되어 등록을 만들 수 없습니다.
401 인증 실패 액세스 키가 잘못되었습니다.
403 할당량이 초과되었습니다. 이 네임스페이스에 등록이 너무 많습니다. 등록이 만들어지지 않았습니다.
403 등록 작업 속도가 너무 빨라 요청이 거부되었습니다.

상태 코드에 대 한 정보를 참조 하십시오. 상태 및 오류 코드.

응답 헤더

응답 헤더 설명
Content-type application/atom+xml;type=entry;charset=utf-8
ETag {취약한 ETag}

응답 본문

요청이 성공하면 유효성이 검사된 Atom 항목이 반환됩니다. 와 같은 읽기 전용 요소에 포함이 ETag, RegistrationId, 및 ExpirationTime합니다. 예를 들면 다음과 같습니다.

<entry> <id>https://{tenant}.servicebus.windows.net/{NotificationHub}/registrations/{registrationId}</id> <title type="text"> /{NotificationHub}/registrations/{registrationId}</title> <updated>2012-08-17T17:32:00Z</updated> <metadata:etag>{weak Etag}</metadata:etag> <content type="application/xml"> <WindowsRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect"> <ETag>{ETag}</ETag> <ExpirationTime>2012-07-16T19:20+01:00</ExpirationTime> <RegistrationId>{RegistrationId}</RegistrationId> <Tags>myTag, myOtherTag</Tags> <ChannelUri>{ChannelUri}</ChannelUri> </WindowsRegistrationDescription> </content> </entry>