-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfraud_api_v120.json
1 lines (1 loc) · 15.8 KB
/
fraud_api_v120.json
1
{"info":{"title":"catenax-api: Catena-X Rest API","version":"1.2.0","description":"Serves fraud case information and statistics"},"openapi":"3.0.0","basePath":"/","paths":{"/fraudcases":{"get":{"description":"Returns cdq fraud cases as queried.","url":"https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage","tags":["Dashboard"],"security":[{"bearerAuth":[]}],"externalDocs":{"description":"The CDQ Fraud Cases API specification.","url":"https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage"},"parameters":[{"in":"query","name":"page","description":"CDQ API - the page index. The index of the first page is 0.","schema":{"type":"number","default":0,"example":0}},{"in":"query","name":"pageSize","description":"CDQ API - number of records listed on one page.","schema":{"type":"number","default":200,"example":10}},{"in":"query","name":"search","description":"CDQ API - the phrase that the query will look for.","schema":{"type":"string"}},{"in":"query","name":"sort","description":"CDQ API - defines the attributes to sort by. A '-' reverses sort order.","schema":{"type":"string","default":"creationTimestamp","example":"-dateOfAttack"}}],"responses":{"200":{"description":"See [CDQ API GET /fraudcases](https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage)."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerFault"}}},"post":{"description":"Create CATENAX fraud case.","url":"https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage","tags":["Dashboard"],"security":[{"bearerAuth":[]}],"externalDocs":{"description":"The CDQ Fraud Cases API specification.","url":"https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage"},"parameters":[{"in":"query","name":"page","description":"CDQ API - the page index. The index of the first page is 0.","schema":{"type":"object","properties":{"value":{"type":"string"},"type":{"type":"string"}}}}],"responses":{"200":{"description":"See [CDQ API GET /fraudcases](https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasePage)."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerFault"}}}},"/fraudcases/statistics":{"get":{"description":"Returns cdq fraud case statistics.","tags":["Dashboard"],"security":[{"bearerAuth":[]}],"externalDocs":{"description":"The CDQ Fraud Cases API specification.","url":"https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasesStatistics"},"responses":{"200":{"description":"Statistics about the fraud cases via the CDQ API. See [CDQ API GET /fraudcases/statistics](https://developer.cdq.com/reference-docs/bankaccount-data/V2/tag/Fraud-Cases/#tag/Fraud-Cases/operation/readFraudCasesStatistics).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CDQFraudCaseStatistic"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerFault"}}},"put":{"description":"Insert or update fraud case events. This endpoint handles the request *synchronously*. The api keeps track on when fraud case events have been updated.","tags":["Worker"],"security":[{"apiKeyAuth":[]}],"operationId":"putStatistics","requestBody":{"description":"A list of simplified fraud case events for statistical evaluation.","required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"cdlId":{"type":"string","minLength":10,"maxLength":10},"dateOfAttack":{"type":"number","format":"int64","minimum":0},"type":{"type":"string","enum":["ACTIVE_WARNING","ANNOUNCEMENT","FAKE_DOCUMENT","FAKE_EMAIL","FAKE_PRESIDENT_CALL","FALSIFIED_INVOICE"]},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["cdlId","dateOfAttack","type","countryCode"]}},"example":[{"cdlId":"FQdqB4fDL4","dateOfAttack":1485908200000,"type":"FALSIFIED_INVOICE","countryCode":"DE"},{"cdlId":"zbSSUNiDzG","dateOfAttack":1488327600000,"type":"ANNOUNCEMENT","countryCode":"IT"}]}}},"responses":{"200":{"description":"The fraud cases specified in the request's body are updated.","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","format":"int64","description":"number of entries inserted / updated."},"updatedAt":{"type":"string","format":"date","description":"the timestamp (with timezone) of when the fraud cases have been inserted / updated. Use this value for the delete operation on the same path.","example":"2022-12-31T16:23:10.000+00"}}},"example":{"updated":500,"updatedAt":"2022-12-31T16:23:10.000+00"}}},"links":{"deleteUserByLatest":{"operationId":"deleteStatistics","parameters":{"latest":"$response.body#/updatedAt"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Busy"},"500":{"$ref":"#/components/responses/ServerFault"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"description":"Remove stale entries which haven't been updated since `latest`. The request will be handled *asynchronously*.","tags":["Worker"],"security":[{"apiKeyAuth":[]}],"operationId":"deleteStatistics","parameters":[{"in":"query","name":"latest","description":"Instruct api to delete all entries not updated since `latest`. If `latest` isn't set then all statistics are purged. You should use the value of `updatedAt` from the first **put**-response you requested on the same path.","schema":{"type":"string","format":"date","example":"2022-12-31T16:23:10.000+00"}}],"responses":{"204":{"description":"The api will now delete all entries not updated since `latest` and update all fraud case statistics. Call this endpoint only after all **put**-requests have been successfully called."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Busy"},"500":{"$ref":"#/components/responses/ServerFault"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/fraudcases/statistics/fraudtypes":{"get":{"description":"Returns information on a specific fraud case.","tags":["Dashboard"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"earliest","description":"The statistics shown in the result will only include fraud cases that happened *after* the specified date (with `dateOfAttack >= earliest`).","schema":{"type":"string","format":"date","example":"2019-01-31"}},{"in":"query","name":"latest","description":"The statistics shown in the result will only include fraud cases that happened *before* the specified date (with `dateOfAttack <= latest`).","schema":{"type":"string","format":"date","example":"2022-12-31"}},{"in":"query","name":"fraudtypes","schema":{"type":"array","items":{"type":"string","enum":["active_warning","announcement","fake_document","fake_email","fake_president_call","falsified_invoice"]}},"style":"form","explode":false,"examples":{"oneFraudType":{"summary":"Example of selecting a single fraud type.","value":["fake_document"]},"multipleFraudTypes":{"summary":"Example of selecting multiple fraud types.","value":["fake_document","fake_email","fake_president_call"]}}}],"responses":{"200":{"$ref":"#/components/responses/FraudCaseStatistic"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerFault"}}}},"/fraudcases/statistics/geo":{"get":{"description":"Returns information on fraud cases per country.","tags":["Dashboard"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"earliest","description":"The statistics shown in the result will only include fraud cases that happened *after* the specified date (with `dateOfAttack >= earliest`).","schema":{"type":"string","format":"date","example":"2019-01-31"}},{"in":"query","name":"latest","description":"The statistics shown in the result will only include fraud cases that happened *before* the specified date (with `dateOfAttack <= latest`).","schema":{"type":"string","format":"date","example":"2022-12-31"}},{"in":"query","name":"countries","description":"Country codes as per iso-3166-1 alpha 2 (lowercase or uppercase).","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"examples":{"oneCountry":{"summary":"Example of selecting a single country.","value":["de"]},"multipleCountries":{"summary":"Example of selecting multiple countries.","value":["de","fr","uk"]}}}],"responses":{"200":{"$ref":"#/components/responses/FraudCaseGeo"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerFault"}}}},"/public/swagger.json":{"get":{"description":"Serves api specification as an openapi specification (swagger.json).","tags":["Public"],"responses":{"200":{"description":"The swagger.json openapi specification file for this project.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/public/api-docs":{"get":{"description":"Serves swagger-ui hosting autogenerated swagger.json.","tags":["Public"],"responses":{"200":{"description":"The api specification displayed by swagger-ui.","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/public/alive":{"get":{"description":"Returns code 204 if the api is alive and running. Any response code above 400 is to be considered 'not alive'. This endpoint is primarily to be used for k8's 'liveness' probes.","tags":["Public"],"responses":{"204":{"description":"The api is alive and running."}}}},"/public/ready":{"get":{"description":"Returns code 204 if the api is ready to accept incoming requests, any return code >= 400 is to be considererd 'not ready'. The api is 'ready' if it has successfully established a database connection. More checks may be added in the future. On a 418 response you see the checks and their results as a json object for debugging purposes. This endpoint is primarily to be used for k8 'readiness' probes.","tags":["Public"],"responses":{"204":{"description":"The api is ready to accept requests."},"418":{"content":{"application/json":{"schema":{"type":"object","description":"The executed readiness probes and their results. Should contain at least one which probed `false`.","properties":{"database":{"type":"object","description":"The current usability of the database.","properties":{"connected":{"type":"boolean"},"ready":{"type":"boolean"}}}}}}}}}}},"/public/version":{"get":{"description":"Returns the package name and version of the api implementation.","tags":["Public"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":"string","version":"string"},"example":{"name":"catenax-api","version":"1.1.8"}}}}}}}}},"components":{"schemas":{"FraudCaseStatistic":{"type":"object","description":"fraud case statistics by type.","properties":{"active_warning":{"type":"integer","format":"int64"},"announcement":{"type":"integer","format":"int64"},"fake_document":{"type":"integer","format":"int64"},"fake_email":{"type":"integer","format":"int64"},"fake_president_call":{"type":"integer","format":"int64"},"falsified_invoice":{"type":"integer","format":"int64"}},"example":{"active_warning":16,"announcement":17,"fake_document":17,"fake_email":19,"fake_president_call":23,"falsified_invoice":40}},"CDQFraudCaseStatistic":{"type":"object","description":"Statistics about the fraud cases via the CDQ API.","properties":{"cachedValue":{"type":"boolean"},"date":{"type":"integer","format":"int64"},"numberOfAllFraudCases":{"type":"integer","format":"int64"},"numberOfDisclosedFraudCases":{"type":"integer","format":"int64"},"numberOfDisclosedFraudCasesOfTheUsersOrganization":{"type":"integer","format":"int64"},"numberOfFraudCasesOfTheUsersOrganization":{"type":"integer","format":"int64"},"numberOfUndisclosedFraudCases":{"type":"integer","format":"int64"},"numberOfUndisclosedFraudCasesOfTheUsersOrganization":{"type":"integer","format":"int64"}},"example":{"cachedValue":true,"date":1648804091264,"numberOfAllFraudCases":657,"numberOfDisclosedFraudCases":288,"numberOfDisclosedFraudCasesOfTheUsersOrganization":369,"numberOfFraudCasesOfTheUsersOrganization":0,"numberOfUndisclosedFraudCases":0,"numberOfUndisclosedFraudCasesOfTheUsersOrganization":0}},"FraudCaseGeo":{"type":"object","properties":{"de":{"$ref":"#/components/schemas/FraudCaseStatistic"},"fr":{"$ref":"#/components/schemas/FraudCaseStatistic"}},"example":{"de":{"active_warning":3,"announcement":2,"fake_document":5,"fake_email":10,"fake_president_call":6,"falsified_invoice":12},"fr":{"active_warning":2,"announcement":4,"fake_document":8,"fake_email":6,"fake_president_call":7,"falsified_invoice":18}}},"Error":{"properties":{"statusCode":{"type":"integer","format":"int32","minimum":"100,","maximum":500},"message":{"type":"string"}}}},"responses":{"FraudCaseStatistic":{"description":"Overall fraud case statistics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudCaseStatistic"}}}},"FraudCaseGeo":{"description":"Overall fraud case statistics by country.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudCaseGeo"}}}},"BadRequest":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":400,"message":"malformed query parameter 'earliest', must be YYYY-MM-DD"}}}},"Unauthorized":{"description":"Authorization is required but has not been provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"access denied"}}}},"Forbidden":{"description":"The authorization provided is insufficient for this request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":403,"message":"request denied"}}}},"Busy":{"description":"The api is busy handling requests, please try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":429,"message":"too many requests"}}}},"ServerFault":{"description":"The server has encountered an unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":500,"message":"unknown error"}}}},"ServiceUnavailable":{"description":"The endpoint is currently not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":503,"message":"cannot establish database connection"}}}}},"securitySchemes":{"apiKeyAuth":{"description":"API Key token to be used in **Worker** endpoints.","type":"apiKey","in":"header","name":"X-API-KEY"},"bearerAuth":{"type":"http","description":"A bearer access token as supplied by keycloak, to be used in **Dashboard** endpoints.","name":"Authorization","in":"header","scheme":"Bearer","bearerFormat":"JWT"}}},"tags":[{"name":"Public","description":"Publicly available endpoints for healthchecks and api documentation."},{"name":"Dashboard","description":"Endpoints used by the dashboard frontend."},{"name":"Worker","description":"Endpoints used by workers to update data from CDQ API and other tasks."},{"name":"Default","description":"General endpoints."}]}