Skip to main content

Worked Shifts

Worked Shift are used to track work time of fundraiser

Read worked shift list​

GET /workedshift​

Read the list of workedshift for a fundraiser

Fitler Parameters​

You can provide querystring parameters in your GET request to filter results

FieldTypeRequiredDescription
from_dateDateFalseWorkedshift start date
to_dateDateFalseWorkedshift to date
staffIntegerFalseWorkedshift fundraiser ID

Response structure​

In response body you will find a list of worked shifts, with the following structure

FieldTypeRequiredDescription
idIntegerTrueWorkedshift ID
uuidStringTrueWorkedshift UUID
company_labelStringFalseWorkedshift Company
team_labelStringFalseWorkedshift Team
location_labelStringFalseWorkedshift Location
timeround_labelStringFalseWorkedshift Timeround
staff_labelStringFalseWorkedshift Staff
companyIntegerTrueWorkedshift Company ID
teamIntegerTrueWorkedshift Team ID
locationIntegerTrueWorkedshift Location ID
timeroundIntegerTrueWorkedshift Timeround ID
dateDateTrueWorkedshift Date
noteStringFalseWorkedshift Note

Example request

curl --request GET \
--url 'https://<cs>.metaface.it/api/v3/workedshifts/?from_date=2019-12-01' \
--header 'Authorization: Token <secret_api_key>' \

Example response

[
{
"id": 1,
"uuid": "975fc687-a3e4-42bc-9a15-37f2795b4f05",
"company_label": "Team Inhouse",
"team_label": "Tiger Team",
"location_label": "Rome",
"staff_label": "John Doe",
"timeround_label": "1 hour",
"company": 1,
"team": 1,
"location": 1,
"staff": 1,
"date": "2019-12-23",
"timeround": 1,
"note": ""
},
{
"id": 2,
"uuid": "975fc687-a3e4-42bc-9a15-37f2795b4123",
"company_label": "Team Inhouse",
"team_label": "Tiger Team",
"location_label": "Rome",
"staff_label": "John Doe",
"timeround_label": "2 hours",
"company": 1,
"team": 1,
"location": 1,
"staff": 1,
"date": "2019-12-25",
"timeround": 1,
"note": ""
}
]

Create worked shift​

POST /workedshift​

Create a workedshift for a fundraiser

Body Request structure​

FieldTypeRequiredDescription
uuidStringTrueWorkedshift UUID
companyIntegerTrueWorkedshift Company ID
teamIntegerTrueWorkedshift Team ID
locationIntegerTrueWorkedshift Location ID
timeroundIntegerTrueWorkedshift Timeround ID
dateDateTrueWorkedshift Date
noteStringFalseWorkedshift Note

Response structure​

FieldTypeRequiredDescription
idIntegerTrueWorkedshift ID
uuidStringTrueWorkedshift UUID
company_labelStringFalseWorkedshift Company
team_labelStringFalseWorkedshift Team
location_labelStringFalseWorkedshift Location
timeround_labelStringFalseWorkedshift Timeround
staff_labelStringFalseWorkedshift Staff
companyIntegerTrueWorkedshift Company ID
teamIntegerTrueWorkedshift Team ID
locationIntegerTrueWorkedshift Location ID
timeroundIntegerTrueWorkedshift Timeround ID
dateDateTrueWorkedshift Date
noteStringFalseWorkedshift Note

Example request

curl --request POST \
--url https://<cs>.metaface.it/api/v3/workedshifts/ \
--header 'authorization: Token <secret_api_key>' \
--header 'content-type: application/json' \
--data '{
"uuid": "123fc687-a3e4-42bc-9a15-37f2795b4f05",
"company": 1,
"team": 4,
"location": 4,
"staff": 2,
"date": "2019-12-23",
"timeround": 1,
"note": "Example note"
}'

Example response

{
"id": 3,
"uuid": "975fc687-a3e4-42bc-9a15-37f2795b4123",
"company_label": "Team Inhouse",
"team_label": "Tiger Team",
"location_label": "Rome",
"staff_label": "John Doe",
"timeround_label": "2 hours",
"company": 1,
"team": 1,
"location": 1,
"staff": 1,
"date": "2019-12-23",
"timeround": 1,
"note": ""
}

Edit worked shift list​

PUT /workedshift/:uuid​

Edit a workedshift for a fundraiser

Path Parameters​

FieldTypeRequiredDescription
:uuidIntegerTrueWorkedshift UUID

Body Request structure​

FieldTypeRequiredDescription
companyIntegerTrueWorkedshift Company ID
teamIntegerTrueWorkedshift Team ID
locationIntegerTrueWorkedshift Location ID
timeroundIntegerTrueWorkedshift Timeround ID
dateDateTrueWorkedshift Date
noteStringFalseWorkedshift Note

Response structure​

FieldTypeRequiredDescription
idIntegerTrueWorkedshift ID
uuidStringTrueWorkedshift UUID
company_labelStringFalseWorkedshift Company
team_labelStringFalseWorkedshift Team
location_labelStringFalseWorkedshift Location
timeround_labelStringFalseWorkedshift Timeround
staff_labelStringFalseWorkedshift Staff
companyIntegerTrueWorkedshift Company ID
teamIntegerTrueWorkedshift Team ID
locationIntegerTrueWorkedshift Location ID
timeroundIntegerTrueWorkedshift Timeround ID
dateDateTrueWorkedshift Date
noteStringFalseWorkedshift Note

Example request

curl --request POST \
--url https://<cs>.metaface.it/api/v3/workedshifts/3/ \
--header 'authorization: Token <secret_api_key>' \
--header 'content-type: application/json' \
--data '{
"company": 1,
"team": 4,
"location": 4,
"staff": 2,
"date": "2019-12-24",
"timeround": 1,
"note": "Example note Edited"
}'

Example response

{
"id": 3,
"uuid": "975fc687-a3e4-42bc-9a15-37f2795b4123",
"company_label": "Team Inhouse",
"team_label": "Tiger Team",
"location_label": "Rome",
"staff_label": "John Doe",
"timeround_label": "2 hours",
"company": 1,
"team": 1,
"location": 1,
"staff": 1,
"date": "2019-12-24",
"timeround": 1,
"note": "Example note Edited"
}

Delete worked shift list​

DELETE /workedshift/:uuid​

Delete workedshift for a fundraiser

Path Parameters​

FieldTypeRequiredDescription
:uuidIntegerTrueWorkedshift UUID