Add API Documentation for Casablanca
[externalapi/nbi.git] / docs / offeredapis / swaggers / listener-1_0_0.json
1
2 {
3   "swagger": "2.0",
4   "info": {
5     "description": "Listener API has to be implemented on the client side in order to receive notification.\nNotification are received if HUB has been posted on server side.",
6     "version": "0.1.0",
7     "title": "API Listener",
8     "x-logo": {
9       "url": "/redoc/logo.png",
10       "backgroundColor": "#FFFFFF"
11     }
12   },
13   
14   "host": "serverRoot",
15   "basePath":   "/externalapi/listener/v1",
16   "schemes": [
17     "https"
18   ],
19   "produces": [
20     "application/json;charset=utf-8"
21   ],
22   "tags": [
23   
24     {
25       "name": "Listener",
26       "description": ""
27     }
28   ],
29   "paths": {
30       "/listener": {
31       "post": {
32         "tags": [
33            "Listener"
34         ],
35         "consumes": [
36            "application/json;charset=utf-8"
37         ],
38         "produces": [
39            "application/json;charset=utf-8"
40         ],        
41         "operationId": "listenerCreate",
42         "summary": "createEvent",
43         "description": "The create event is used by the seller to trigger (POST) a notification to the buyer. The buyer has previously subscribed to receive notification\n\nSpecific business errors for current operation will be encapsulated in\n\nHTTP Response 422 Unprocessable entity\n",
44         "deprecated": false,
45         
46         "parameters": [
47           
48           {
49             "name": "event",
50             "required": true,
51             "in": "body",
52             "description": "",
53             "schema": {
54               "$ref": "#/definitions/Listener"
55             }
56           }
57         ],
58         "responses": {
59           "201": {
60             "description": "Success",
61             "schema": {
62               "$ref": "#/definitions/Listener"
63             }
64
65           },
66           "400": {
67             
68             "description": "Bad Request\n\nList of supported error codes:\n- 20: Invalid URL parameter value\n- 21: Missing body\n- 22: Invalid body\n- 23: Missing body field\n- 24: Invalid body field\n- 25: Missing header\n- 26: Invalid header value\n- 27: Missing query-string parameter\n- 28: Invalid query-string parameter value",
69             "schema": {
70             
71               "$ref": "#/definitions/ErrorRepresentation"
72             }
73           },
74           "401": {
75             
76             "description": "Unauthorized\n\nList of supported error codes:\n- 40: Missing credentials\n- 41: Invalid credentials\n- 42: Expired credentials",
77             "schema": {
78             
79               "$ref": "#/definitions/ErrorRepresentation"
80             }
81           },
82           "403": {
83             
84             "description": "Forbidden\n\nList of supported error codes:\n- 50: Access denied\n- 51: Forbidden requester\n- 52: Forbidden user\n- 53: Too many requests",
85             "schema": {
86             
87               "$ref": "#/definitions/ErrorRepresentation"
88             }
89           },
90           "422": {
91             
92             "description": "Unprocessable entity\n\nFunctional error",
93             "schema": {
94             
95               "$ref": "#/definitions/ErrorRepresentation"
96             }
97           },
98           "500": {
99             
100             "description": "Internal Server Error\n\nList of supported error codes:\n- 1: Internal error",
101             "schema": {
102             
103               "$ref": "#/definitions/ErrorRepresentation"
104             }
105           },
106           "503": {
107             
108             "description": "Service Unavailable\n\nList of supported error codes:\n- 5: The service is temporarily unavailable\n- 6: Orange API is over capacity, retry later !",
109             "schema": {
110             
111               "$ref": "#/definitions/ErrorRepresentation"
112             }
113           }
114         }
115       }
116     }
117   },
118 "definitions": {
119   
120     "EventType": {
121       "description": "",
122       
123       "type": "string",
124       "enum": [
125                   "ServiceOrderCreationNotification",
126                   "ServiceOrderStateChangeNotification",
127                   "ServiceOrderItemStateChangeNotification"]
128       
129     },
130
131     "ErrorRepresentation": {
132       "description": "",
133
134       
135       "required": [
136           
137             "code"
138       ],
139       "type": "object",
140       "properties": {
141         "code": {
142           "description": "",
143               "type": "integer",
144               "format": "int32"
145         },
146         "reason": {
147           "description": "",
148               "type": "string"
149         },
150         "message": {
151           "description": "",
152               "type": "string"
153         },
154         "status": {
155           "description": "",
156               "type": "integer",
157               "format": "int32"
158         },
159         "referenceError": {
160           "description": "",
161               "type": "string"
162         },
163         "@type": {
164           "description": "",
165               "type": "string"
166         },
167         "@schemaLocation": {
168           "description": "",
169               "type": "string"
170         }
171       }
172       
173     },
174
175     "Listener": {
176       "description": "An event will be triggered for each time a notification is send to a listener.",
177
178       
179       "required": [
180           
181             "eventId",
182             "eventDate",
183             "eventType",
184             "event"
185       ],
186       "type": "object",
187       "properties": {
188         "eventId": {
189           "description": "id of the event",
190               "type": "string"
191         },
192         "eventDate": {
193           "description": "",
194               "type": "string",
195               "format": "date-time"
196         },
197         "eventType": {
198           
199            "$ref": "#/definitions/EventType"
200         },
201         "event": {
202           "description": "An event representation is the payload of information send with the notification; it will feature event attributes + summary view of the resource.",
203               "type": "object"
204         }
205       }
206       
207     }
208   }
209 }
210