Add API Documentation for Casablanca
[externalapi/nbi.git] / docs / offeredapis / listener / markDown.md
1 # API Listener
2
3
4 <a name="overview"></a>
5 ## Overview
6
7 ### Api URL
8
9 [Swagger UI](https://api-designer.sso.infra.ftgroup/swagger-ui/?url=https://api-designer.sso.infra.ftgroup/api/1.0/apis/aoG0EJ01Pv/swagger.json)
10
11
12 [plant UML UI](https://plantuml.rd.francetelecom.fr/proxy?fmt=svg&src=https://api-designer.sso.infra.ftgroup/api/1.0/apis/aoG0EJ01Pv/plantuml&noCache=7322.0)
13
14 Listener API has to be implemented on the client side in order to receive notification.
15 Notification are received if HUB has been posted on server side.
16
17
18 ### Version information
19 *Version* : 0.1.0_inProgress
20
21
22 ### URI scheme
23 *Host* : serverRoot  
24 *BasePath* : /externalapi/listener/v1  
25 *Schemes* : HTTPS
26
27
28 ### Tags
29
30 * Listener
31
32
33 ### Produces
34
35 * `application/json;charset=utf-8`
36
37
38 <a name="paths"></a>
39 ## Resources
40
41 <a name="listener_resource"></a>
42 ### Listener
43
44 <a name="listenercreate"></a>
45 #### createEvent
46 ```
47 POST /listener
48 ```
49
50
51 ##### Description
52 The create event is used by the seller to trigger (POST) a notification to the buyer. The buyer has previously subscribed to receive notification
53
54 Specific business errors for current operation will be encapsulated in
55
56 HTTP Response 422 Unprocessable entity
57
58
59 ##### Parameters
60
61 |Type|Name|Schema|
62 |---|---|---|
63 |**Body**|**event**  <br>*required*|[Listener](#listener)|
64
65
66 ##### Responses
67
68 |HTTP Code|Description|Schema|
69 |---|---|---|
70 |**201**|Success|[Listener](#listener)|
71 |**400**|Bad Request<br><br>List of supported error codes:<br>- 20: Invalid URL parameter value<br>- 21: Missing body<br>- 22: Invalid body<br>- 23: Missing body field<br>- 24: Invalid body field<br>- 25: Missing header<br>- 26: Invalid header value<br>- 27: Missing query-string parameter<br>- 28: Invalid query-string parameter value|[ErrorRepresentation](#errorrepresentation)|
72 |**401**|Unauthorized<br><br>List of supported error codes:<br>- 40: Missing credentials<br>- 41: Invalid credentials<br>- 42: Expired credentials|[ErrorRepresentation](#errorrepresentation)|
73 |**403**|Forbidden<br><br>List of supported error codes:<br>- 50: Access denied<br>- 51: Forbidden requester<br>- 52: Forbidden user<br>- 53: Too many requests|[ErrorRepresentation](#errorrepresentation)|
74 |**422**|Unprocessable entity<br><br>Functional error|[ErrorRepresentation](#errorrepresentation)|
75 |**500**|Internal Server Error<br><br>List of supported error codes:<br>- 1: Internal error|[ErrorRepresentation](#errorrepresentation)|
76 |**503**|Service Unavailable<br><br>List of supported error codes:<br>- 5: The service is temporarily unavailable<br>- 6: Orange API is over capacity, retry later !|[ErrorRepresentation](#errorrepresentation)|
77
78
79 ##### Consumes
80
81 * `application/json;charset=utf-8`
82
83
84 ##### Produces
85
86 * `application/json;charset=utf-8`
87
88
89 <a name="definitions"></a>
90 ## Definitions
91
92 <a name="errorrepresentation"></a>
93 ### ErrorRepresentation
94
95 |Name|Schema|
96 |---|---|
97 |**@schemaLocation**  <br>*optional*|string|
98 |**@type**  <br>*optional*|string|
99 |**code**  <br>*required*|integer (int32)|
100 |**message**  <br>*optional*|string|
101 |**reason**  <br>*optional*|string|
102 |**referenceError**  <br>*optional*|string|
103 |**status**  <br>*optional*|integer (int32)|
104
105
106 <a name="eventtype"></a>
107 ### EventType
108 *Type* : enum (ServiceOrderCreationNotification, ServiceOrderStateChangeNotification, ServiceOrderItemStateChangeNotification)
109
110
111 <a name="listener"></a>
112 ### Listener
113 An event will be triggered for each time a notification is send to a listener.
114
115
116 |Name|Description|Schema|
117 |---|---|---|
118 |**event**  <br>*required*|An event representation is the payload of information send with the notification; it will feature event attributes + summary view of the resource.|object|
119 |**eventDate**  <br>*required*||string (date-time)|
120 |**eventId**  <br>*required*|id of the event|string|
121 |**eventType**  <br>*required*||[EventType](#eventtype)|
122