Skip to content

TestSpacesJunofilter

Test spaces junofilter

Attempt to filter test spaces

Request

post /test-spaces/junofilter

Parameters

Parameter Type Required Notes
page query yes page number that the filter returns
size query yes size number that the filter returns

Request body

Attribute                      Type Required Notes
userFilter array yes array of objects containing nameOfTheField, operator and value. nameOfTheField is a string (example= assignedId), operator defines if filter works with "=" or "!=" and value is an integer that defines what is being filtered
navbar object yes object containing substring (type: string)
projectId integer yes integer defining id of project
deleted boolean yes defines if filter returns deleted test spaces

Request body example

{
  "userFilter": [
    {
      "nameOfTheField": "ownerId",
      "operator": "=",
      "value": 1
    }
  ],
  "navbar": {
    "substring": "string"
  },
  "projectId": 13,
  "deleted": false
}
curl --location 'https://example.juno.one/test-spaces/junofilter' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA' \
--header 'X-tenantId: example' \
--header 'Content-Type: application/json' \
--data '{
  "userFilter": [
    {
      "nameOfTheField": "assignedId",
      "operator": "=",
      "value": 1
    }
  ],
  "navbar": {
    "substring": "string"
  },
  "projectId": 13,
  "deleted": false
}'
import requests
import json

url = "https://example.juno.one/test-spaces/junofilter"

payload = json.dumps({
  "userFilter": [
    {
      "nameOfTheField": "assignedId",
      "operator": "=",
      "value": 1
    }
  ],
  "navbar": {
    "substring": "string"
  },
  "projectId": 13,
  "deleted": False
})
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA',
  'X-tenantId': 'example',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
val client = OkHttpClient()
val mediaType = "application/json".toMediaType()
val body = "{\n  \"userFilter\": [\n    {\n      \"nameOfTheField\": \"assignedId\",\n      \"operator\": \"=\",\n      \"value\": 1\n    }\n  ],\n  \"navbar\": {\n    \"substring\": \"string\"\n  },\n  \"projectId\": 13,\n  \"deleted\": false\n}".toRequestBody(mediaType)
val request = Request.Builder()
  .url("https://example.juno.one/test-spaces/junofilter")
  .post(body)
  .addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA")
  .addHeader("X-tenantId", "example")
  .addHeader("Content-Type", "application/json")
  .build()
val response = client.newCall(request).execute()

Response

Successful response of test space junofilter has the status 200 with following response body:

[
  {
    "data": [
      {
        "id": 1,
        "name": "test",
        "creatorId": {
          "id": 2,
          "firstname": "test",
          "lastname": "test",
          "email": "test@juno.one",
          "avatar": "9",
          "deleted": false
        },
        "projectId": {
          "id": 13,
          "name": "test",
          "test_case_robust": true
        },
        "deleted": true,
        "deleted_at": "2023-03-16T10:17:04.000Z",
        "created_at": "2023-03-16T10:17:04.000Z",
        "updated_at": "2023-03-16T10:17:04.000Z"
      }
    ],
    "first": true,
    "last": true,
    "totalPages": 1,
    "totalElements": 1,
    "numberOfElements": 1,
    "limit": 10,
    "pageNumber": 1
  }
]

400 Bad Request

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "The request is missing page parameter",
    "path": "/test-spaces/junofilter"
}

404 Not found

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 404,
    "error": "Not Found",
    "message": "Project with id 30 was not found.",
    "path": "/test-spaces/junofilter"
}

406 Insufficient permision

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 406,
    "error": "Missing permission for action",
    "message": "You do not have a permission for this action",
    "path": "/test-spaces/junofilter"
}

412 Precondition failed

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 412,
    "error": "Precondition failed",
    "message": "You do not have permission for this action",
    "path" : "/test-spaces/junofilter"
}

500 Unknown error

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 500,
    "error": "Unknown",
    "message": "There was a problem with your request. Please contact your administrator.",
    "path" : "/test-spaces/junofilter"
}