clockIn
curl --request POST \
--url https://sandbox.rollfi.xyz/userPortal/clockIn \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "clockIn",
"companyId": "737A232C-33C3-4D15-9A76-FC99826F1B33",
"userId": "F64EFF29-6516-4C1E-B14D-82F00B7EADF9"
}
'import requests
url = "https://sandbox.rollfi.xyz/userPortal/clockIn"
payload = {
"method": "clockIn",
"companyId": "737A232C-33C3-4D15-9A76-FC99826F1B33",
"userId": "F64EFF29-6516-4C1E-B14D-82F00B7EADF9"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'clockIn',
companyId: '737A232C-33C3-4D15-9A76-FC99826F1B33',
userId: 'F64EFF29-6516-4C1E-B14D-82F00B7EADF9'
})
};
fetch('https://sandbox.rollfi.xyz/userPortal/clockIn', 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/userPortal/clockIn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'clockIn',
'companyId' => '737A232C-33C3-4D15-9A76-FC99826F1B33',
'userId' => 'F64EFF29-6516-4C1E-B14D-82F00B7EADF9'
]),
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/userPortal/clockIn"
payload := strings.NewReader("{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.rollfi.xyz/userPortal/clockIn")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/userPortal/clockIn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}"
response = http.request(request)
puts response.read_body{
"timeEntry": {
"timeEntryId": "B17DCF4B-CE3B-45AC-8535-B132F05B6F5B",
"status": "Ready",
"message": "The employee is successfully clocked in."
}
}{
"error": {
"code": 400,
"message": "Employee is already clocked in."
}
}User Portal
clockIn
The clockIn API starts a shift for an employee.
What it does:
- Creates an active time entry for the employee on the current local work date.
Notes:
- Use
getEmployeeTimeTrackingStatusto check eligibility before clock in.
POST
/
userPortal
/
clockIn
clockIn
curl --request POST \
--url https://sandbox.rollfi.xyz/userPortal/clockIn \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "clockIn",
"companyId": "737A232C-33C3-4D15-9A76-FC99826F1B33",
"userId": "F64EFF29-6516-4C1E-B14D-82F00B7EADF9"
}
'import requests
url = "https://sandbox.rollfi.xyz/userPortal/clockIn"
payload = {
"method": "clockIn",
"companyId": "737A232C-33C3-4D15-9A76-FC99826F1B33",
"userId": "F64EFF29-6516-4C1E-B14D-82F00B7EADF9"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'clockIn',
companyId: '737A232C-33C3-4D15-9A76-FC99826F1B33',
userId: 'F64EFF29-6516-4C1E-B14D-82F00B7EADF9'
})
};
fetch('https://sandbox.rollfi.xyz/userPortal/clockIn', 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/userPortal/clockIn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'clockIn',
'companyId' => '737A232C-33C3-4D15-9A76-FC99826F1B33',
'userId' => 'F64EFF29-6516-4C1E-B14D-82F00B7EADF9'
]),
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/userPortal/clockIn"
payload := strings.NewReader("{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.rollfi.xyz/userPortal/clockIn")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/userPortal/clockIn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"clockIn\",\n \"companyId\": \"737A232C-33C3-4D15-9A76-FC99826F1B33\",\n \"userId\": \"F64EFF29-6516-4C1E-B14D-82F00B7EADF9\"\n}"
response = http.request(request)
puts response.read_body{
"timeEntry": {
"timeEntryId": "B17DCF4B-CE3B-45AC-8535-B132F05B6F5B",
"status": "Ready",
"message": "The employee is successfully clocked in."
}
}{
"error": {
"code": 400,
"message": "Employee is already clocked in."
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Response
Clock-in recorded
The response is of type object.
⌘I
