Artifacts With Date in Date Range

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Get all artifacts with specified dates within the given range. Search can be limited to specific repositories (local or caches).

Since: 3.2.1

Security: Requires a privileged non-anonymous user.

Usage: GET /api/search/dates?[from=fromVal][&to=toVal][&repos=x[,y]][&dateFields=c[,d]]

Parameters: The from and to parameters can be either a long value for the java epoch (milliseconds since the epoch), or an ISO8601 string value. from is mandatory. If to is not provided, now() will be used instead. If both parameters are omitted, 400 bad request is returned.

The dateFields parameter is a mandatory, comma-separated list of date fields that specify which fields the from and to values should be applied to. The supported date fields are:created,lastModified,lastDownloaded.

The dateFields parameter dictates which fields will be added to the JSON returned. If any of the specified date fields of an artifact is within the specified range, the artifact will be returned.

Produces: application/json (application/vnd.org.jfrog.artifactory.search.ArtifactResult+json)

Sample Requests:

Long value:

GET /artifactory/api/search/dates?from=1708819200000&dateFields=created,lastModified

ISO 8601 value:

GET /artifactory/api/search/dates?from=2024-02-28T12:07:45.867Z&to=2024-02-29T23:59:59.867Z&dateFields=created,lastModifiedapi/search/dates?from=2024-02-28T12:07:45.867Z&dateFields=created,lastModified

Sample Output:

{
    "results": [
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-28/ecc742f16766-observability-request-2024-02-28T12-07-35.983.log.gz",
            "created": "2024-02-28T12:07:46.485Z",
            "lastModified": "2024-02-28T12:07:46.326Z"
        },
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-28/c13cfe9f8109-observability-request-2024-02-28T12-07-57.343.log.gz",
            "created": "2024-02-28T12:08:07.847Z",
            "lastModified": "2024-02-28T12:08:07.628Z"
        },
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-29/99c9f9e0b6ee-access-security-audit.2024-02-28T10-58-54.659.log.gz",
            "created": "2024-02-29T09:58:15.882Z",
            "lastModified": "2024-02-29T09:58:15.795Z"
        },
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-28/ba0c747a992a-observability-request-2024-02-28T12-10-34.198.log.gz",
            "created": "2024-02-28T12:11:09.699Z",
            "lastModified": "2024-02-28T12:11:09.548Z"
        },
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-28/86f9f4ad9d6c-observability-request-2024-02-28T12-08-58.368.log.gz",
            "created": "2024-02-28T12:09:28.873Z",
            "lastModified": "2024-02-28T12:09:28.695Z"
        },
        {
            "uri": "https://productdemo.jfrog.io/artifactory/api/storage/jfrog-logs/artifactory/2024-02-29/99c9f9e0b6ee-access-request.2024-02-29T20-37-59.787.log.gz",
            "created": "2024-02-29T20:38:15.972Z",
            "lastModified": "2024-02-29T20:38:15.786Z"
        },
    ]
}