updateTimeCardApprovals
curl --request PUT \
--url https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "updateTimeCardApprovals",
"companyId": "5221FFCF-E84B-4690-B7DC-DE29D549096B",
"payPeriodId": "3EAEC271-6C06-4E17-8C3B-1C6649D534D5",
"timeCardIds": [
"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C"
],
"isApproved": true
}
'import requests
url = "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals"
payload = {
"method": "updateTimeCardApprovals",
"companyId": "5221FFCF-E84B-4690-B7DC-DE29D549096B",
"payPeriodId": "3EAEC271-6C06-4E17-8C3B-1C6649D534D5",
"timeCardIds": ["4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C"],
"isApproved": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'updateTimeCardApprovals',
companyId: '5221FFCF-E84B-4690-B7DC-DE29D549096B',
payPeriodId: '3EAEC271-6C06-4E17-8C3B-1C6649D534D5',
timeCardIds: ['4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C'],
isApproved: true
})
};
fetch('https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'updateTimeCardApprovals',
'companyId' => '5221FFCF-E84B-4690-B7DC-DE29D549096B',
'payPeriodId' => '3EAEC271-6C06-4E17-8C3B-1C6649D534D5',
'timeCardIds' => [
'4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C'
],
'isApproved' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals"
payload := strings.NewReader("{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}"
response = http.request(request)
puts response.read_body{
"timeCards": [
{
"timeCardId": "4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C",
"userId": "C4CA148F-F2C6-4E70-8349-57CC6DFC1C2B",
"status": "Approved",
"message": "Time card approved successfully."
}
]
}{
"timeCards": [
{
"error": 400,
"message": "Time card not approved. There are open time entries on the time card"
},
{
"error": 400,
"message": "Invalid timeCardId"
}
]
}Admin Portal
updateTimeCardApprovals
The updateTimeCardApprovals API moves timecards between the editable new status and approved so they can be synced to payroll
What it does:
- Locks the complete time card when isApproved: true so the administrator or employee cannot add or update time entries
- Unlocks the time card when isApproved: false so last minyte edits can be made
- Blocks clock in and out for the employee if the timecard includes the current date
Notes:
- Once time cards are approved they can be synced to payroll using the
syncTimeCardsToPayrollAPI - Time cards can be unapproved from both synced and approved status so they are once again editable and corrections can be made
- Approval status is determined by the
isApproved: true/falsefields
PUT
/
adminPortal
/
updateTimeCardApprovals
updateTimeCardApprovals
curl --request PUT \
--url https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "updateTimeCardApprovals",
"companyId": "5221FFCF-E84B-4690-B7DC-DE29D549096B",
"payPeriodId": "3EAEC271-6C06-4E17-8C3B-1C6649D534D5",
"timeCardIds": [
"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C"
],
"isApproved": true
}
'import requests
url = "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals"
payload = {
"method": "updateTimeCardApprovals",
"companyId": "5221FFCF-E84B-4690-B7DC-DE29D549096B",
"payPeriodId": "3EAEC271-6C06-4E17-8C3B-1C6649D534D5",
"timeCardIds": ["4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C"],
"isApproved": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'updateTimeCardApprovals',
companyId: '5221FFCF-E84B-4690-B7DC-DE29D549096B',
payPeriodId: '3EAEC271-6C06-4E17-8C3B-1C6649D534D5',
timeCardIds: ['4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C'],
isApproved: true
})
};
fetch('https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'updateTimeCardApprovals',
'companyId' => '5221FFCF-E84B-4690-B7DC-DE29D549096B',
'payPeriodId' => '3EAEC271-6C06-4E17-8C3B-1C6649D534D5',
'timeCardIds' => [
'4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C'
],
'isApproved' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals"
payload := strings.NewReader("{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/adminPortal/updateTimeCardApprovals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"updateTimeCardApprovals\",\n \"companyId\": \"5221FFCF-E84B-4690-B7DC-DE29D549096B\",\n \"payPeriodId\": \"3EAEC271-6C06-4E17-8C3B-1C6649D534D5\",\n \"timeCardIds\": [\n \"4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C\"\n ],\n \"isApproved\": true\n}"
response = http.request(request)
puts response.read_body{
"timeCards": [
{
"timeCardId": "4DDB60ED-BC33-49FA-A589-E29FB6C4FD5C",
"userId": "C4CA148F-F2C6-4E70-8349-57CC6DFC1C2B",
"status": "Approved",
"message": "Time card approved successfully."
}
]
}{
"timeCards": [
{
"error": 400,
"message": "Time card not approved. There are open time entries on the time card"
},
{
"error": 400,
"message": "Invalid timeCardId"
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Response
Time card approval statuses updated
Show child attributes
Show child attributes
⌘I
