TestSpacesJunofilter
Test spaces junofilter¶
Attempt to filter test spaces
Request¶
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¶
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
404
Not found
406
Insufficient permision
412
Precondition failed