{
    "openapi": "3.0.0",
    "info": {
        "title": "CORDIS WEB Data Extraction Tool - OpenAPI definition",
        "version": "1.1.0"
    },
    "paths": {
        "/api/dataextractions/deleteExtraction": {
            "delete": {
                "description": "Delete an extraction via the API",
                "operationId": "delete_dataextraction_delete_api",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Users api key",
                        "required": true
                    },
                    {
                        "name": "taskId",
                        "in": "query",
                        "description": "ID of the extraction task",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "payload": {
                                            "$ref": "#/components/schemas/DeleteExtractionDTO"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/dataextractions/getExtraction": {
            "get": {
                "description": "Creates an extraction",
                "operationId": "get_dataextraction_api",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Search query",
                        "required": true
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Users api key",
                        "required": true
                    },
                    {
                        "name": "outputFormat",
                        "in": "query",
                        "description": "Format to be returned",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "xml",
                                "csv",
                                "json",
                                "xlsx",
                                "summary"
                            ]
                        }
                    },
                    {
                        "name": "archived",
                        "in": "query",
                        "description": "Search archived content",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "false",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "payload": {
                                            "$ref": "#/components/schemas/GetExtractionDTO"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/dataextractions/cancelExtraction": {
            "get": {
                "description": "Cancel an ongoing extraction",
                "operationId": "get_dataextraction_cancel_api",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Users api key",
                        "required": true
                    },
                    {
                        "name": "taskId",
                        "in": "query",
                        "description": "ID of the extraction task",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "payload": {
                                            "$ref": "#/components/schemas/CancelExtractionDTO"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/dataextractions/getExtractionStatus": {
            "get": {
                "description": "Gets the extraction status",
                "operationId": "get_dataextraction_getextractionstatus_api",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Users api key",
                        "required": true
                    },
                    {
                        "name": "taskId",
                        "in": "query",
                        "description": "ID of the extraction task",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "payload": {
                                            "$ref": "#/components/schemas/GetExtractionDTO"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/dataextractions/listExtractions": {
            "get": {
                "description": "List the extractions",
                "operationId": "get_dataextraction_listextractions_api",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Users api key",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "payload": {
                                            "$ref": "#/components/schemas/ListExtractionDTO"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "DeleteExtractionDTO": {
                "required": [
                    "taskID",
                    "progress",
                    "message"
                ],
                "properties": {
                    "taskID": {
                        "type": "integer"
                    },
                    "progress": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GetExtractionDTO": {
                "required": [
                    "taskID",
                    "cancelledExtraction"
                ],
                "properties": {
                    "taskID": {
                        "type": "integer"
                    },
                    "cancelledExtraction": {
                        "$ref": "#/components/schemas/CancelledExtractionDTO"
                    }
                },
                "type": "object"
            },
            "CancelExtractionDTO": {
                "required": [
                    "taskID",
                    "progress",
                    "query",
                    "message"
                ],
                "properties": {
                    "taskID": {
                        "type": "integer"
                    },
                    "progress": {
                        "type": "string"
                    },
                    "query": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ListExtractionDTO": {
                "required": [
                    "result"
                ],
                "properties": {
                    "result": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/GetExtractionStatusDTO"
                        }
                    }
                },
                "type": "object"
            },
            "CancelledExtractionDTO": {
                "required": [
                    "taskID",
                    "query"
                ],
                "properties": {
                    "taskID": {
                        "type": "integer"
                    },
                    "query": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GetExtractionStatusDTO": {
                "required": [
                    "taskID",
                    "progress",
                    "query",
                    "numberOfRecords",
                    "numberOfRecordsEstimated",
                    "numberOfProcessedRecords",
                    "remainingTime",
                    "averageSpeed",
                    "destinationFileUri"
                ],
                "properties": {
                    "taskID": {
                        "type": "integer"
                    },
                    "progress": {
                        "type": "string"
                    },
                    "query": {
                        "type": "string"
                    },
                    "numberOfRecords": {
                        "type": "string"
                    },
                    "numberOfRecordsEstimated": {
                        "type": "string"
                    },
                    "numberOfProcessedRecords": {
                        "type": "string"
                    },
                    "remainingTime": {
                        "type": "string"
                    },
                    "averageSpeed": {
                        "type": "string"
                    },
                    "destinationFileUri": {
                        "type": "string"
                    }
                },
                "type": "object"
            }
        }
    }
}