get-aml-OFFICER_PUB-kyc-statistics-NAMES.rst (2966B)
1 .. http:get:: /aml/$OFFICER_PUB/kyc-statistics/$NAMES 2 3 Returns the number of KYC events matching the space-separated (!) 4 list of given event types ``$NAMES`` in 5 the specified time range. Note that this query can be slow as the 6 statistics are computed on-demand. (This is OK as such requests should be 7 rare.) 8 9 This endpoint was introduced in protocol **v20**. It was 10 modified in **v30** revision 1 to accept a space-separated 11 list of names instead of a single name and to return an array 12 of results. 13 14 **Request:** 15 16 *Taler-AML-Officer-Signature*: 17 The client must provide Base-32 encoded EdDSA signature with 18 ``$OFFICER_PRIV``, affirming the desire to obtain AML data. Note that this 19 is merely a simple authentication mechanism, the details of the request are 20 not protected by the signature. 21 22 :query start_date=TIMESTAMP: 23 *Optional*. Specifies the date when to 24 start looking (inclusive). If not given, the start time of the 25 exchange operation is used. The TIMESTAMP is given 26 in seconds since the UNIX epoch. 27 :query end_date=TIMESTAMP: 28 *Optional*. Specifies the date when to 29 stop looking (exclusive). If not given, the current date is used. The TIMESTAMP is given 30 in seconds since the UNIX epoch. 31 32 **Response:** 33 34 :http:statuscode:`200 OK`: 35 The responds will be an `AmlStatisticsResponse` message. 36 :http:statuscode:`204 No content`: 37 All the event counters are zero. 38 :http:statuscode:`400 Bad Request`: 39 The request is malformed. Cases include: 40 - The ``$H_OFFICER_PUB`` path segment is malformed. 41 This response comes with a standard `ErrorDetail` response with 42 a code of ``TALER_EC_GENERIC_PATH_SEGMENT_MALFORMED``. 43 - The required HTTP header with the signature is missing. Returned with 44 ``TALER_EC_GENERIC_HTTP_HEADERS_MALFORMED``. 45 :http:statuscode:`403 Forbidden`: 46 Two cases: 47 - The signature is invalid. Returned with a code of 48 ``TALER_EC_EXCHANGE_GENERIC_AML_OFFICER_GET_SIGNATURE_INVALID``. 49 - The specific officer is unknown or disabled. Returned with a code of 50 ``TALER_EC_EXCHANGE_GENERIC_AML_OFFICER_ACCESS_DENIED``. 51 :http:statuscode:`414 URI Too Long`: 52 The statistics names string in the URL is too long. 53 This response comes with a standard `ErrorDetail` response with 54 a code of ``TALER_EC_GENERIC_URI_TOO_LONG``. 55 :http:statuscode:`500 Internal server error`: 56 The server had an internal problem handling the request. 57 The error code is usually a ``TALER_EC_GENERIC_DB_FETCH_FAILED``. 58 59 **Details:** 60 61 .. ts:def:: AmlStatisticsResponse 62 63 interface AmlStatisticsResponse { 64 // Statistics that were found. 65 statistics: EventCounter[]; 66 } 67 68 69 .. ts:def:: EventCounter 70 71 interface EventCounter { 72 // Name of the statistic that is being returned. 73 event: string; 74 75 // Number of events of the specified type in 76 // the given range. 77 counter: Integer; 78 79 }