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