/
API Draft.txt
88 lines (79 loc) · 1.52 KB
/
API Draft.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// GET /entile
{
links : [
{
rel : 'client',
method : 'GET',
href : 'http://entile.com/entile/client/{clientId}'
},
{
rel : 'register-client',
method : 'POST',
href : 'http://entile.com/entile/client/{clientId}',
},
{
rel : 'unregister-client',
method : 'DELETE',
href : 'http://entile.com/entile/client/{clientId}'
}
]
}
// GET /entile/client/AD44C58C-60F5-4E43-BA61-EC9B36911CF5
// 200 OK
{
subscriptions : [
{
kind : 'Toast',
subscriptionId : '',
links : [
{
rel : 'unsubscribe',
href : ''
}
]
}
],
links : [
{
rel : 'unregister',
href : 'http://entile.com/entile/client/{clientId}'
}
]
}
// 404
// GET /entile/register-client
// content-type : entile-form
{
method : 'POST',
clientId : 'Guid',
notificationChannel : 'string'
}
// POST /entile/register-client
// Request
{
clientId : 'AD44C58C-60F5-4E43-BA61-EC9B36911CF5',
notificationChannel : 'http://test.com/channel/lkjsdfoij'
}
// Response (successful)
// Httpstatus accepted
{
links : [
{
rel : 'subscribe',
href : 'http://entile.com/entile/client/AD44C58C-60F5-4E43-BA61-EC9B36911CF5/subscribe',
}
]
}
// Response (failed)
// 500
{
status : 'failed',
error : {
type : 'argument',
message : 'Invalid client id',
}
}
// POST /entile/client/AD44C58C-60F5-4E43-BA61-EC9B36911CF5/subscribe
{
subscriptionId : 'ACD5A71E-8B46-478E-ACCC-BC318F0F2517'
}