You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`format`| str | File format. Currently, only `json` value is supported. |
97
-
|`condition`| str | Reference to `annotation.content``schema_id` that holds evaluated value. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"`|
98
-
|`source_reference_key`| str | Relation key into metadata for source document. |
99
-
|`extract_rules`| object | Rules to update annotation's content. |
|`format`| str | File format. Currently, only `json` value is supported. |
97
+
|`condition`| str | Reference to `annotation.content``schema_id` that holds evaluated value. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"`|
98
+
|`source_reference_key`| str | Relation key into metadata for source document. |
99
+
|`extract_rules`| object | Rules to update annotation's content. |
100
100
101
101
The `extract_rules` object defines how values are extracted and stored:
This extension works as a part of the [Export Pipeline](./index.md) and it expects a payload file to be generated using [Custom format templating extension](./custom-format-templating.md).
@@ -122,41 +121,23 @@ The `response_headers_reference_key` stores the headers of the reply with added
122
121
123
122
```json
124
123
{
125
-
"status_code": 200,
126
-
"headers": {
127
-
"access_control_allow_origin": "*",
128
-
"alt_svc": "h3=\":443\"; ma=2592000",
129
-
"content_type": "application/json",
130
-
"date": "Tue, 25 Jun 2024 08:02:26 GMT",
131
-
"vary": "Accept-Encoding",
132
-
"transfer_encoding": "chunked"
133
-
},
134
-
"raw": [
135
-
[
136
-
"Access-Control-Allow-Origin",
137
-
"*"
138
-
],
139
-
[
140
-
"Alt-Svc",
141
-
"h3=\":443\"; ma=2592000"
142
-
],
143
-
[
144
-
"Content-Type",
145
-
"application/json"
146
-
],
147
-
[
148
-
"Date",
149
-
"Tue, 25 Jun 2024 08:02:26 GMT"
150
-
],
151
-
[
152
-
"Vary",
153
-
"Accept-Encoding"
154
-
],
155
-
[
156
-
"Transfer-Encoding",
157
-
"chunked"
158
-
]
159
-
]
124
+
"status_code": 200,
125
+
"headers": {
126
+
"access_control_allow_origin": "*",
127
+
"alt_svc": "h3=\":443\"; ma=2592000",
128
+
"content_type": "application/json",
129
+
"date": "Tue, 25 Jun 2024 08:02:26 GMT",
130
+
"vary": "Accept-Encoding",
131
+
"transfer_encoding": "chunked"
132
+
},
133
+
"raw": [
134
+
["Access-Control-Allow-Origin", "*"],
135
+
["Alt-Svc", "h3=\":443\"; ma=2592000"],
136
+
["Content-Type", "application/json"],
137
+
["Date", "Tue, 25 Jun 2024 08:02:26 GMT"],
138
+
["Vary", "Accept-Encoding"],
139
+
["Transfer-Encoding", "chunked"]
140
+
]
160
141
}
161
142
```
162
143
@@ -244,9 +225,9 @@ Specifically, this example is for Azure API Management:
244
225
245
226
The `status_code_resolver` is a tool that allows you to define error handling, that means how HTTP status codes from the API response are handled in Rossum.
246
227
247
-
***error**: A list of status codes that should be considered as errors. They will cause the export process to fail and will be displayes as errors on the document in Rossum. The content of the error message is the content sent by the API.
248
-
***warning**: A list of status codes that should be considered warnings. They will NOT cause the export process to fail, but will be shown as warning message. The content of the warning message is the content sent by the API.
249
-
* All other status codes will be considered successful.
228
+
-**error**: A list of status codes that should be considered as errors. They will cause the export process to fail and will be displayes as errors on the document in Rossum. The content of the error message is the content sent by the API.
229
+
-**warning**: A list of status codes that should be considered warnings. They will NOT cause the export process to fail, but will be shown as warning message. The content of the warning message is the content sent by the API.
230
+
- All other status codes will be considered successful.
250
231
251
232
By default when no error handling by `status_code_resolver` is defined, all status codes are considered successful.
252
233
The resolver only applies to the export request, not the authentication request.
@@ -267,16 +248,8 @@ Example configuration with status code resolver:
|`export_reference_key`| str | A unique key referencing the exported data prepared by the [Custom format templating extension](./custom-format-templating.md). |
295
-
|`request`| object | Defines the REST API request (URL, method, headers, and body content). |
296
-
|`auth`*(optional)*| object | Configuration for authentication, supporting OAuth2. |
297
-
|`condition`*(optional)*| str | Reference to a `schema_id` in `annotation.content` controlling execution. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition definition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"`|
298
-
|`response_headers_reference_key`*(optional)*| str | Key to store API response headers (including `status_code`). |
299
-
|`response_payload_reference_key`*(optional)*| str | Key to store the full response body from the API. |
300
-
|`status_code_resolver`*(optional)*| object|Defines status code handling. |
|`export_reference_key`| str | A unique key referencing the exported data prepared by the [Custom format templating extension](./custom-format-templating.md).|
268
+
|`request`| object | Defines the REST API request (URL, method, headers, and body content).|
269
+
|`auth`_(optional)_| object | Configuration for authentication, supporting OAuth2.|
270
+
|`condition`_(optional)_| str | Reference to a `schema_id` in `annotation.content` controlling execution. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition definition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"`|
271
+
|`response_headers_reference_key`_(optional)_| str | Key to store API response headers (including `status_code`).|
272
+
|`response_payload_reference_key`_(optional)_| str | Key to store the full response body from the API.|
273
+
|`status_code_resolver`_(optional)_| object |Defines status code handling.|
301
274
302
275
### Request Object
303
276
304
277
The `request` object contains parameters defining the HTTP request:
0 commit comments