ActivityClone
Clone activity¶
Attempt to clone an activity specified by an id
Request¶
Parameters¶
Parameter | Path/Query | Type | Required | Notes |
---|---|---|---|---|
id | path | integer | yes | defines the id of a user |
Request body¶
Attribute | Type | Required | Notes |
---|---|---|---|
dateFrom | string | yes | defines the first day of an activity |
dateTo | string | yes | defines the last day of an activity |
timeFrom | string | yes | defines the starting time of an activity |
timeTo | string | yes | defines the end time of an activity |
Request body example¶
curl --location 'https://example.juno.one/v1/activity/clone/12' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NTA5NTk4Nn0.pv8kavc3kNXiXFgZfSQjRCrA-HDVyIzTzNgi9IUXhEW4_1uRRgzoD2ZQTJB77u9VamGwICZeEyi3-b1PjRFMBQ' \
--header 'X-tenantID: example' \
--header 'Zone: GMT' \
--header 'Content-Type: application/json' \
--data '{
"dateFrom": "2020-06-03",
"timeFrom": "12:00",
"dateTo": "2020-06-03",
"timeTo": "12:00"
}'
import requests
import json
url = "https://example.juno.one/v1/activity/clone/12"
payload = json.dumps({
"dateFrom": "2020-06-03",
"timeFrom": "12:00",
"dateTo": "2020-06-03",
"timeTo": "12:00"
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NTA5NTk4Nn0.pv8kavc3kNXiXFgZfSQjRCrA-HDVyIzTzNgi9IUXhEW4_1uRRgzoD2ZQTJB77u9VamGwICZeEyi3-b1PjRFMBQ',
'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-03\",\n \"timeFrom\": \"12:00\",\n \"dateTo\": \"2020-06-03\",\n \"timeTo\": \"12:00\"\n}".toRequestBody(mediaType)
val request = Request.Builder()
.url("https://example.juno.one/v1/activity/clone/12")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NTA5NTk4Nn0.pv8kavc3kNXiXFgZfSQjRCrA-HDVyIzTzNgi9IUXhEW4_1uRRgzoD2ZQTJB77u9VamGwICZeEyi3-b1PjRFMBQ")
.addHeader("X-tenantID", "example")
.addHeader("Zone", "GMT")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()
Response¶
Successful response of clone activity has the status 200
with following response body:
[
{
"id": 1,
"activityTypeId": {
"id": 1,
"name": "Andrej",
"description": "test",
"color": "#29a745",
"workingHours": true,
"approvable": true
},
"place": {
"id": 1,
"name": "test",
"type": "CUSTOM"
},
"author": {
"id": 2,
"firstname": "test",
"lastname": "test",
"email": "test@juno.one",
"avatar": "9",
"deleted": false
},
"projectId": {
"id": 13,
"name": "test",
"test_case_robust": true
},
"issueId": {
"id": 2,
"name": "test"
},
"teamId": {
"id": 1,
"name": "test",
"deleted": false
},
"includeWeekends": true,
"description": "test",
"dateFrom": "2020-06-03T00:00:00.000Z",
"dateTo": "2020-06-03T00:00:00.000Z",
"timeFrom": "720",
"timeTo": "720",
"duration": 1,
"statusId": {
"id": 1,
"name": "test",
"color": "#29a745",
"positiveFinal": false,
"negativeFinal": false
},
"statusEditor": {
"id": 2,
"firstname": "test",
"lastname": "test",
"email": "test@juno.one",
"avatar": "9",
"deleted": false
},
"deleted": false,
"created_at": "2020-06-03T00:00:00.000Z"
}
]
400
Bad Request
404
Not found
406
Insufficient permision
412
Precondition failed