Edit a shift
Needs: Roster, Read-write
Edits a shift. Send only what changes. A recurring shift needs scope, and recurrence changes apply to this and following. Adding a second client converts the shift into a group shift. Completed and cancelled shifts cannot be edited.
Note: The response also has a
message. It addsseries_refswhen you change a recurrence,converted_fromwhen the shift becomes a group shift (or the reverse),replaceswhen the ref changes, andscopefor recurring shifts.
curl -X PATCH "https://app.imploy.com.au/api/integrations/v1/shifts/example_string" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"staff": [
{
"staff_id": 32
}
],
"publish": true
}'
import requests
import json
url = "https://app.imploy.com.au/api/integrations/v1/shifts/example_string"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"staff": [
{
"staff_id": 32
}
],
"publish": true
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.imploy.com.au/api/integrations/v1/shifts/example_string", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"staff": [
{
"staff_id": 32
}
],
"publish": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"staff": [
{
"staff_id": 32
}
],
"publish": true
}`)
req, err := http.NewRequest("PATCH", "https://app.imploy.com.au/api/integrations/v1/shifts/example_string", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.imploy.com.au/api/integrations/v1/shifts/example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"staff": [
{
"staff_id": 32
}
],
"publish": true
}'
response = http.request(request)
puts response.body
{
"updated": "a:123"
}
{
"message": "Invalid or expired access token."
}
{
"message": "Access token does not permit this action."
}
{
"message": "Too many requests."
}
/shifts/{ref}Target server for requests. Edit to use your own host.
An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
imp_at_. Send it as Authorization: Bearer imp_at_XXXX.The shift ref, such as a:123.
The media type of the request body
Recurring shifts need this or this_and_following.
Unassign staff and offer the shift in the shift pool.
Save despite staff warnings. Only use after confirming.
Client ids, 1 to 20. One client is a normal shift, two or more is a group shift.
Start, YYYY-MM-DD HH:MM in the organisation's time.
End, YYYY-MM-DD HH:MM. Must be after the start, and no more than 24 hours later.
Array of staff_id (required) with an optional service for that person. Empty means a shift pool shift (single client only). Several means a multi-staff shift. Up to 10.
A service name from the services endpoint. NDIS clients use NDIS services.
Up to 255 characters.
Up to 500 characters. Defaults to the client's address (or the site's).
Up to 5000 characters.
Publish to staff now. A new shift is a draft unless this is true; on edit it is unchanged.
Makes it a site shift at this site. The clients must be site participants, and services are NDIS services.
Makes the shift repeat. frequency (Day, Week or Month) is required, with ends_on (YYYY-MM-DD, within two years) or occurrences (1 to 366). Also every (1 to 52), days (Mon to Sun, weekly), month_day (1 to 31) or month_week (First to Fourth, or Last) with month_weekday.
Splits the shift into service blocks per staff member. Each needs staff_id, start, end and service. Up to 20.
One of hcp, hcp_unspent, sah, temporary, tsah, thcp, ghcp or private. Defaults to the scheduler default.
Required when funding_source is temporary.
Group shifts. Percent of the charge per client, each with client_id and percent (0 to 100), and optionally funding_source and temporary_funding_id. Defaults to an even split.
Group shifts. Charge every client 100% instead of splitting.
Staff can claim travel for this shift.
Travel details, which turn on apply_travel_claim. planned_kms (0 to 2000), charge_client (NDIS clients only), service (an NDIS travel service, required when charge_client is true) and charge_split for group shifts. On edit only the keys you send change, and null removes the travel details.
Group or site shifts only. Bills the whole shift at one service, with mode of hourly (default) or fixed. null removes it.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
Path Parameters
The shift ref, such as a:123.
Body
Recurring shifts need this or this_and_following.
Unassign staff and offer the shift in the shift pool.
Save despite staff warnings. Only use after confirming.
Client ids, 1 to 20. One client is a normal shift, two or more is a group shift.
Start, YYYY-MM-DD HH:MM in the organisation's time.
End, YYYY-MM-DD HH:MM. Must be after the start, and no more than 24 hours later.
Array of staff_id (required) with an optional service for that person. Empty means a shift pool shift (single client only). Several means a multi-staff shift. Up to 10.
A service name from the services endpoint. NDIS clients use NDIS services.
Up to 255 characters.
Up to 500 characters. Defaults to the client's address (or the site's).
Up to 5000 characters.
Publish to staff now. A new shift is a draft unless this is true; on edit it is unchanged.
Makes it a site shift at this site. The clients must be site participants, and services are NDIS services.
Makes the shift repeat. frequency (Day, Week or Month) is required, with ends_on (YYYY-MM-DD, within two years) or occurrences (1 to 366). Also every (1 to 52), days (Mon to Sun, weekly), month_day (1 to 31) or month_week (First to Fourth, or Last) with month_weekday.
Splits the shift into service blocks per staff member. Each needs staff_id, start, end and service. Up to 20.
One of hcp, hcp_unspent, sah, temporary, tsah, thcp, ghcp or private. Defaults to the scheduler default.
Required when funding_source is temporary.
Group shifts. Percent of the charge per client, each with client_id and percent (0 to 100), and optionally funding_source and temporary_funding_id. Defaults to an even split.
Group shifts. Charge every client 100% instead of splitting.
Staff can claim travel for this shift.
Travel details, which turn on apply_travel_claim. planned_kms (0 to 2000), charge_client (NDIS clients only), service (an NDIS travel service, required when charge_client is true) and charge_split for group shifts. On edit only the keys you send change, and null removes the travel details.
Group or site shifts only. Bills the whole shift at one service, with mode of hourly (default) or fixed. null removes it.
Responses
OK