События CSP

В этом разделе

Следуйте этой последовательности вызовов для использования потоков API.

  1. Создание потока
  2. Получение страницы
  3. Удаление потока

Пример

В этом разделе приведены примеры для получения событий CSP.

Create a stream

Пример запроса


PUT https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscription-streams/d51a0512-02a2-4363-8184-ef4b470568db/ZIntPmND HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2
{
	"start_time" : "03/21/2015 03:40:22",
	"page_size" : "100"
}

Пример ответа


HTTP / 1.1 200 OK
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 22 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : fb4bbd17 - dd57 - 4671 - a303 - caab0d440666
X - Powered - By : ASP.NET
X - Server : BLUOS3OMSORDW01
{
	"start_time" : "2015-03-21T03:15:19.857",
	"page_size" : 100
}

Get a page

Пример запроса


GET https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscription-streams/d51a0512-02a2-4363-8184-ef4b470568db/ZIntPmND/pages HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2

Пример ответа


HTTP / 1.1 200 OK
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 22 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : 99c38338 - d409 - 436e-afd4 - f65660ca0726
X - Powered - By : ASP.NET
X - Server : BLUOS3OMSORDW01
{
	"items" : [{
			"type" : "subscription_deleted",
			"subscription_uri" : "/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/4675f57a-c0f8-47e6-be11-3e6b1e45bd8f",
			"recipient_customer_uri" : "/customers/fa4bbe7b-fcef-4b3a-ae9e-2e737e092f45",
			"event_date" : "2015-03-21T03:15:19.857Z",
			"data" : {}

		}
	],
	"contract_version" : "1.0",
	"links" : {
		"completion" : {
			"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/subscription-streams/d51a0512-02a2-4363-8184-ef4b470568db/ZIntPmND/pages?token=Y2U2YTZhOTEtNzU3ZC00NjAzLWE3MmEtOWI2M2MzYTM3N2ExLDQxOTY1NSwyMDE1LTAzLTIxVDAzOjE1OjE5Ljg1NzAwMDAsMjAxNS0wMy0yMVQwMzo1MDoyMy4zOTQ3NTM3",
			"method" : "GET"
		}
	}
}

Delete a stream

Пример запроса


DELETE https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscription-streams/d51a0512-02a2-4363-8184-ef4b470568db/ZIntPmND HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2

Пример ответа


HTTP / 1.1 200 OK
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 24 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : 2416b1ac - d6d2 - 4835 - 94a0 - 035c5eb70f39
X - Powered - By : ASP.NET
X - Server : BLUOS3OMSORDW01
{
	"start_time" : "2015-03-21T03:15:19.857",
	"page_size" : 100
}

 

 

Показ: