ActivityStatistics
Activity user statistics¶
Attempt to post user activity statistics
Request¶
Request body¶
Attribute | Type | Required | Notes |
---|---|---|---|
dateFrom | string | yes | defines the first day of activity |
dateTo | string | yes | defines the last day of activity |
Request body example¶
curl --location 'https://example.juno.one/v1/activity/user-statistics' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw' \
--header 'X-tenantID: example' \
--header 'Zone: GMT' \
--header 'Content-Type: application/json' \
--data '{
"dateFrom": "2020-06-03T00:00:00.000Z",
"dateTo": "2020-06-03T00:00:00.000Z"
}'
import requests
import json
url = "https://example.juno.one/v1/activity/user-statistics"
payload = json.dumps({
"dateFrom": "2020-06-03T00:00:00.000Z",
"dateTo": "2020-06-03T00:00:00.000Z"
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw',
'X-tenantID': 'example',
'Zone': 'GMT',
'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 \"dateFrom\": \"2020-06-03T00:00:00.000Z\",\n \"dateTo\": \"2020-06-03T00:00:00.000Z\"\n }".toRequestBody(mediaType)
val request = Request.Builder()
.url("https://example.juno.one/v1/activity/user-statistics")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw")
.addHeader("X-tenantID", "example")
.addHeader("Zone", "GMT")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()
Response¶
Successful response of activity user statistics has the status 200
with following response body:
{
"workingHoursTotal": 1,
"workinghoursData": [
{
"activityType": {
"id": 1,
"name": "Andrej",
"description": "test",
"color": "#29a745",
"workingHours": true,
"approvable": true
},
"allocatedTime": 1
}
],
"nonWorkingHoursTotal": 1,
"nonWorkingHoursData": [
{
"activityType": {
"id": 1,
"name": "Andrej",
"description": "test",
"color": "#29a745",
"workingHours": true,
"approvable": true
},
"allocatedTime": 1
}
]
}
400
Bad Request
Activity requests statistics¶
Attempt to find activity requests statistics
Request¶
Request body¶
curl --location 'https://example.juno.one/v1/activity/getRequestsStatistics' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw' \
--header 'X-tenantID: example' \
--header 'Zone: GMT'
import requests
url = "https://example.juno.one/v1/activity/getRequestsStatistics"
payload = {}
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw',
'X-tenantID': 'example',
'Zone': 'GMT'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
val client = OkHttpClient()
val request = Request.Builder()
.url("https://example.juno.one/v1/activity/getRequestsStatistics")
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJ0ZXN0IiwiZXhwIjoxNjg1MzU0MjEyfQ.J68rrbT6pA6uApOkVl58ID6R7oHWnmiaYdUpJQyyts-vCOfsXYNp7y8BkBKu3NEE5v87nW4vp3-8BxHF-y55hw")
.addHeader("X-tenantID", "example")
.addHeader("Zone", "GMT")
.build()
val response = client.newCall(request).execute()
Response¶
Successful response of activity requests statistics has the status 200
with following response body: