aboutsummaryrefslogtreecommitdiffstats
path: root/docs/offeredapis/swaggers/listener-1_0_0.json
blob: 7aa65fbd1b2cf0a49bf9b34c2d444b2e5b24fb79 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
{
  "swagger": "2.0",
  "info": {
    "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.",
    "version": "0.1.0",
    "title": "API Listener",
    "x-logo": {
      "url": "/redoc/logo.png",
      "backgroundColor": "#FFFFFF"
    }
  },
  
  "host": "serverRoot",
  "basePath":	"/externalapi/listener/v1",
  "schemes": [
    "https"
  ],
  "produces": [
    "application/json;charset=utf-8"
  ],
  "tags": [
  
    {
      "name": "Listener",
      "description": ""
    }
  ],
  "paths": {
      "/listener": {
      "post": {
        "tags": [
           "Listener"
        ],
        "consumes": [
           "application/json;charset=utf-8"
        ],
        "produces": [
           "application/json;charset=utf-8"
        ],        
        "operationId": "listenerCreate",
        "summary": "createEvent",
        "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",
        "deprecated": false,
        
        "parameters": [
          
          {
            "name": "event",
            "required": true,
            "in": "body",
            "description": "",
            "schema": {
              "$ref": "#/definitions/Listener"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Listener"
            }

          },
          "400": {
            
            "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",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          },
          "401": {
            
            "description": "Unauthorized\n\nList of supported error codes:\n- 40: Missing credentials\n- 41: Invalid credentials\n- 42: Expired credentials",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          },
          "403": {
            
            "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",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          },
          "422": {
            
            "description": "Unprocessable entity\n\nFunctional error",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          },
          "500": {
            
            "description": "Internal Server Error\n\nList of supported error codes:\n- 1: Internal error",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          },
          "503": {
            
            "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 !",
            "schema": {
            
              "$ref": "#/definitions/ErrorRepresentation"
            }
          }
        }
      }
    }
  },
"definitions": {
  
    "EventType": {
      "description": "",
      
      "type": "string",
      "enum": [
  	          "ServiceOrderCreationNotification",
  	          "ServiceOrderStateChangeNotification",
  	          "ServiceOrderItemStateChangeNotification"]
      
    },

    "ErrorRepresentation": {
      "description": "",

      
      "required": [
          
            "code"
      ],
      "type": "object",
      "properties": {
        "code": {
          "description": "",
              "type": "integer",
              "format": "int32"
        },
        "reason": {
          "description": "",
              "type": "string"
        },
        "message": {
          "description": "",
              "type": "string"
        },
        "status": {
          "description": "",
              "type": "integer",
              "format": "int32"
        },
        "referenceError": {
          "description": "",
              "type": "string"
        },
        "@type": {
          "description": "",
              "type": "string"
        },
        "@schemaLocation": {
          "description": "",
              "type": "string"
        }
      }
      
    },

    "Listener": {
      "description": "An event will be triggered for each time a notification is send to a listener.",

      
      "required": [
          
            "eventId",
            "eventDate",
            "eventType",
            "event"
      ],
      "type": "object",
      "properties": {
        "eventId": {
          "description": "id of the event",
              "type": "string"
        },
        "eventDate": {
          "description": "",
              "type": "string",
              "format": "date-time"
        },
        "eventType": {
          
           "$ref": "#/definitions/EventType"
        },
        "event": {
          "description": "An event representation is the payload of information send with the notification; it will feature event attributes + summary view of the resource.",
              "type": "object"
        }
      }
      
    }
  }
}