SMARTPRESENCE REST API
SmartPresence API (Application Programming Interface) berbasiskan prinsip REST. Anda dapat menggunakan browser untuk mengakses URL yang ada. API Smartpresence mengijinkan anda untuk melakukan query meta-data seperti detail data karyawan, log presensi, summary presensi karyawan, laporan, atribut atau group karyawan, jadwal dan jam kerja, serta sinkronisasi data dll.
Base Url
Semua URL yang ada memiliki basis referensi melalui ini :
employee
GET /:parameters
http://api.smartpresence.id/v1/employee?{{parameters}}
*Method: GET
*Required Parameter:
key={{APIKEY}}
*Optional Parameter:
empid: idpegawai
pin: pin pegawai
attrid: format dipisahkan koma -> 100,101,102,103
status: dipisahkan pipeline -> a=active | t=not active
result: detail
contoh #1:
http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&empid=835&attrid=283,284,285
JSON result:
{
"status": "OK",
"data": [
{
"employeeid": 835,
"name": "AGUS YUDIANTO",
"pin": "0011",
"scanner": null,
"workhourid": 47,
"workhour": "Jam Bs",
"workhourtype": "full",
"phonenumber": "081805516xxx",
"activedate": "2015-01-05",
"inactivedate": null,
"status": "a"
}
]
}
contoh #2:
http://api.smartpresence.id:9310/v31/api/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&empid=835&attrid=283,284,285&result=detail
json result:
{
"status": "OK",
"data": [
{
"employeeid": 835,
"name": "AGUS YUDIANTO",
"pin": "0011",
"scanner": null,
"workhourid": 47,
"workhour": "Jam Bs",
"workhourtype": "full",
"phonenumber": "081805516xxx",
"activedate": "2015-01-05",
"inactivedate": null,
"status": "a",
"location": [],
"attribute": [
{
"id": 283,
"attribute": "33",
"value": "Manager Development & Technical Support "
}
],
"attributevariable": []
}
]
}
Keterangan JSON result:
employeeid: id pegawai
name: nama pegawai
pin: pin pegawai
scanner: pemindai pegawai (rfid/nfc)
workhourid: id jam kerja
workhour: jam kerja
workhourtype: jenis jam kerja (full atau shift)
phonenumber: nomor telp
activedate: tanggal aktif
inactivedate: tanggal tidak aktif
status: a=active | t=not active
location: array lokasi pegawai yang diijinkan
attribute: array atribut yang melekat pada pegawai tsb. misal: jabatan.
attributevariable: array atribut tambahan yang bersifat inputan, misal: nomor ktp.
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
status a
pin 0011
result detail
Sample Request
curl --request GET
--url 'http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Sample Request
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
Sample Request
import requests
url = "http://api.smartpresence.id/v1/employee"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx","status":"a","pin":"0011","result":"detail"}
response = requests.request("GET", url, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee"
],
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
"http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
curl --request GET
--url 'http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail'
POST /:parameters
http://api.smartpresence.id/v1/employee?key={{APIKEY}}
*Method: POST (+ JSON request)
contoh #1:
http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
JSON request:
{
"name": "AGUS YUDIANTO",
"pin": "",
"workhourid": 55,
"phonenumber": "08123456xxx",
"scanner": "1234",
"location": [],
"attributevalue": [290],
"attributevariable": [
{
"idatributvariable": 4,
"variable": ""
},
{
"idatributvariable": 5,
"variable": "L"
}
],
"activedate": "2016-06-01"
}
JSON result:
{
"status": "OK",
"id": "956"
}
Keterangan JSON request:
name (harus disertakan): nama pegawai, maksimum 100 karakter
pin: pin pegawai, harus angka, maksimum 8 digit (jika dikosongkin akan autogenerate random 4 digit angka)
workhourid: id jam kerja
scanner: pemindai pegawai (rfid/nfc), maksimum 64 karakter
location: array lokasi pegawai yang diijinkan
attributevalue: array idatributvalue
attributevariable: array data atributvariable, terdiri atas idatributvariable --> id nya dan variable --> variablenya
activedate (harus disertakan): tanggal pegawai mulai aktif kerja, formatnya harus yyyy-mm-dd
Keterangan JSON response:
status: OK atau error
id: adalah last inserted id
errormsg: bersifat optional, hanya akan disertakan jika status=error
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
BODY
{
"name": "AGUS YUDIANTO",
"religionid": 1,
"pin": "",
"workhourid": null,
"phonenumber": "087889997xxx",
"scanner": "2",
"location": [],
"attributevalue": [281],
"attributevariable": [
],
"activedate": "2016-06-01"
}
Sample Request
curl --request POST
--url 'http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
--data '{
"name": "AGUS YUDIANTO",
"religionid": 1,
"pin": "",
"workhourid": null,
"phonenumber": "087889997xxx",
"scanner": "2",
"location": [],
"attributevalue": [281],
"attributevariable": [
],
"activedate": "2016-06-01"
}'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "POST",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/employee"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
payload = "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
headers = {'content-type': 'application/json'}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "POST",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ name: 'AGUS YUDIANTO',
religionid: 1,
pin: '',
workhourid: null,
phonenumber: '087889997xxx',
scanner: '2',
location: [],
attributevalue: [ 281 ],
attributevariable: [],
activedate: '2016-06-01' }));
req.end();
"http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}",
CURLOPT_HTTPHEADER => array(
"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/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"
payload := strings.NewReader("{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
PUT /id?:parameters
http://api.smartpresence.id/v1/employee/:idemp?{{parameters}}
*Method: PUT (+ JSON request)
*Required Parameter:
key={{APIKEY}}
empid: idpegawai
contoh #1:
http://api.smartpresence.id/v1/employee/955?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
JSON request:
{
"status": "t"
}
JSON result:
{
"status": "OK"
}
Keterangan JSON request:
name: nama pegawai, maksimum 100 karakter
pin: pin pegawai, harus angka, maksimum 8 digit (jika dikosongkin akan autogenerate random 4 digit angka)
scanner: pemindai pegawai (rfid/nfc), maksimum 64 karakter
location: array lokasi pegawai yang diijinkan
attributevalue: array idatributvalue
attributevariable: array data atributvariable, terdiri atas idatributvariable --> id nya dan variable --> variablenya
status: a --> aktif, t --> tidak aktif
activedate: tanggal pegawai mulai aktif kerja, formatnya harus yyyy-mm-dd
nonactivedate: tanggal pegawai mulai aktif kerja, formatnya harus yyyy-mm-dd
Keterangan JSON response:
status: OK atau error
id: adalah last inserted id
errormsg: bersifat optional, hanya akan disertakan jika status=error
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
BODY
{
"name": "AGUS YUDIANTO",
"religionid": 1,
"pin": "",
"workhourid": null,
"phonenumber": "087889997xxx",
"scanner": "2",
"location": [],
"attributevalue": [281],
"attributevariable": [
],
"activedate": "2016-06-01"
}
curl --request PUT
--url 'http://api.smartpresence.id/v1/employee/1157?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
--data '{
"name": "AGUS YUDIANTO",
"religionid": null,
"pin": "1111",
"phonenumber": "087889997xxx",
"scanner": "11221122",
"location": [],
"attributevalue": [282],
"attributevariable": [
],
"activedate": "2016-06-01"
}'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee/1157?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "PUT",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": "{n "name": "AGUS YUDIANTO",n "religionid": null,n "pin": "1111",n "phonenumber": "087889997xxx",n "scanner": "11221122",n "location": [],n "attributevalue": [282],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee/1157?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{n "name": "AGUS YUDIANTO",n "religionid": null,n "pin": "1111",n "phonenumber": "087889997xxx",n "scanner": "11221122",n "location": [],n "attributevalue": [282],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/employee/1157"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
payload = "{n "name": "AGUS YUDIANTO",n "religionid": null,n "pin": "1111",n "phonenumber": "087889997xxx",n "scanner": "11221122",n "location": [],n "attributevalue": [282],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
headers = {'content-type': 'application/json'}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "PUT",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee",
"1157"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ name: 'AGUS YUDIANTO',
religionid: null,
pin: '1111',
phonenumber: '087889997xxx',
scanner: '11221122',
location: [],
attributevalue: [ 282 ],
attributevariable: [],
activedate: '2016-06-01' }));
req.end();
"http://api.smartpresence.id/v1/employee/1157?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{n "name": "AGUS YUDIANTO",n "religionid": null,n "pin": "1111",n "phonenumber": "087889997xxx",n "scanner": "11221122",n "location": [],n "attributevalue": [282],n "attributevariable": [n ],n "activedate": "2016-06-01"n}",
CURLOPT_HTTPHEADER => array(
"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"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&status=a&pin=0011&result=detail"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /usepin/:pin?:parameters
http://api.smartpresence.id/v1/employee/usepin/:pin?{{parameters}}
*Method: PUT (+ JSON request)
*Required Parameter:
key={{APIKEY}}
pin: pin pegawai
contoh #1:
http://api.smartpresence.id/v1/employee/usepin/0020?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
JSON request:
{
"status": "t"
}
JSON result:
{
"status": "OK"
}
Keterangan JSON request:
name: nama pegawai, maksimum 100 karakter
pin: pin pegawai, harus angka, maksimum 8 digit (jika dikosongkin akan autogenerate random 4 digit angka)
scanner: pemindai pegawai (rfid/nfc), maksimum 64 karakter
location: array lokasi pegawai yang diijinkan
attributevalue: array idatributvalue
attributevariable: array data atributvariable, terdiri atas idatributvariable --> id nya dan variable --> variablenya
status: a --> aktif, t --> tidak aktif
activedate: tanggal pegawai mulai aktif kerja, formatnya harus yyyy-mm-dd
nonactivedate: tanggal pegawai mulai aktif kerja, formatnya harus yyyy-mm-dd
Keterangan JSON response:
status: OK atau error
id: adalah last inserted id
errormsg: bersifat optional, hanya akan disertakan jika status=error
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
BODY
{
"name": "AGUS YUDIANTO",
"religionid": 1,
"pin": "",
"workhourid": null,
"phonenumber": "087889997xxx",
"scanner": "2",
"location": [],
"attributevalue": [281],
"attributevariable": [
],
"activedate": "2016-06-01"
}
curl --request POST
--url 'http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
--data '{
"name": "AGUS YUDIANTO",
"religionid": 1,
"pin": "",
"workhourid": null,
"phonenumber": "087889997xxx",
"scanner": "2",
"location": [],
"attributevalue": [281],
"attributevariable": [
],
"activedate": "2016-06-01"
}'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "POST",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/employee"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
payload = "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}"
headers = {'content-type': 'application/json'}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "POST",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ name: 'AGUS YUDIANTO',
religionid: 1,
pin: '',
workhourid: null,
phonenumber: '087889997xxx',
scanner: '2',
location: [],
attributevalue: [ 281 ],
attributevariable: [],
activedate: '2016-06-01' }));
req.end();
"http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}",
CURLOPT_HTTPHEADER => array(
"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/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"
payload := strings.NewReader("{n "name": "AGUS YUDIANTO",n "religionid": 1,n "pin": "",n "workhourid": null,n "phonenumber": "087889997xxx",n "scanner": "2",n "location": [],n "attributevalue": [281],n "attributevariable": [n ],n "activedate": "2016-06-01"n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
DELETE /id?:parameters
http://api.smartpresence.id/v1/employee/:idemp?{{parameters}}
*Method: DELETE
*Required Parameter:
key={{APIKEY}}
empid: idpegawai
contoh #1:
http://api.smartpresence.id/v1/employee/955?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
JSON result:
{
"status": "OK"
}
Keterangan JSON response:
status: OK atau error
id: adalah last inserted id
errormsg: bersifat optional, hanya akan disertakan jika status=error
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
curl --request DELETE
--url 'http://api.smartpresence.id/v1/employee/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "DELETE",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": ""
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/employee/1111"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
payload = ""
headers = {'content-type': 'application/json'}
response = requests.request("DELETE", url, data=payload, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "DELETE",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee",
"1111"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
"http://api.smartpresence.id/v1/employee/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"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"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /usepin/:pin?:parameters
http://api.smartpresence.id/v1/employee/usepin/:pin?{{parameters}}
*Method: DELETE
*Required Parameter:
key={{APIKEY}}
pin: pin pegawai
contoh #1:
http://api.smartpresence.id/v1/employee/pin/0020?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
JSON result:
{
"status": "OK"
}
Keterangan JSON response:
status: OK atau error
id: adalah last inserted id
errormsg: bersifat optional, hanya akan disertakan jika status=error
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
curl --request DELETE
--url 'http://api.smartpresence.id/v1/employee/usepin/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/employee/usepin/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "DELETE",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": ""
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/employee/usepin/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/employee/usepin/1111"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
payload = ""
headers = {'content-type': 'application/json'}
response = requests.request("DELETE", url, data=payload, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "DELETE",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"employee",
"usepin",
"1111"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
"http://api.smartpresence.id/v1/employee/usepin/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"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"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/employee/usepin/1111?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
log
GET /:parameters
http://api.smartpresence.id/v1/log?{{parameters}}
*Method: GET
*Required Parameter:
key={{APIKEY}}
*Optional Parameter:
date: format -> yyyy-mm-dd
startdate: format -> yyyy-mm-dd
enddate: format -> yyyy-mm-dd
empid: idpegawai
pin: pin pegawai
attrid: format dipisahkan koma -> 100,101,102,103
status: dipisahkan pipeline -> v=valid | c=confirmation | na=not_approved
*Catatan:
parameter (date) atau (startdate dan enddate) atau (empid) harus ada
Contoh:
http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&empid=835&attrid=283,284,285
JSON result:
{
"status": "OK",
"data": [
{
"logid": 22584,
"datetime": "2016-09-13 08:29:03",
"empid": 835,
"empname": "AGUS YUDIANTO",
"emppin": "0011",
"datacapid": 193,
"datacapturename": "Mesin Pusat",
"inout": "m",
"inoutnoteid": null,
"inoutnote": "",
"isworking": "y",
"lat": -8.6237605,
"lon": 115.2087168,
"status": "v",
"confirm": null,
"origin": null
},
{
"logid": 23055,
"datetime": "2016-09-13 19:45:19",
"empid": 835,
"empname": "AGUS YUDIANTO",
"datacapid": 193,
"datacapturename": "Mesin Pusat",
"inout": "k",
"inoutnoteid": null,
"inoutnote": "",
"isworking": "y",
"lat": -8.6238519,
"lon": 115.2087875,
"status": "v",
"confirm": null,
"origin": null
}
]
}
Keterangan JSON result:
logid: id log kehadiran
datetime: waktu kehadiran
empid: id pegawai
empname: nama pegawai
datacapid: id mesin (data capture)
datacapturename: nama mesin (data capture)
inout: masuk atau keluar?
inoutnoteid: id catatan kehadiran
inoutnote: catatan kehadiran
isworking: apakah terhitung kerja?
lat: latitude
lon: longitude
status: v=valid | c=confirmation | na=not_approved
confirm: apakah melakukan proses masuk/keluar dengan konfirmasi? misal: kemiripin dibawah target, atau lokasi tidak sesuai
origin: data asli
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
date 2016-09-13
status v
pin 0011
curl curl --request GET
--url 'http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&pin=0011'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&pin=0011",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
>
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&pin=0011")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/log"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx","date":"2016-09-13","status":"v","pin":"0011"}
response = requests.request("GET", url, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"log"
],
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
"http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&pin=0011",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/log?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&date=2016-09-13&status=v&pin=0011"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
summary
GET /:parameters
http://api.smartpresence.id/v1/summary?{{parameters}}
*Method: GET
*Required Parameter:
key={{APIKEY}}
*Optional Parameter:
date: format -> yyyy-mm-dd
startdate: format -> yyyy-mm-dd
enddate: format -> yyyy-mm-dd
empid: idpegawai
pin: pin pegawai
attrid: format dipisahkan koma -> 100,101,102,103
status: dipisahkan pipeline -> w=waiting | v=valid | d=discard
*Catatan:
parameter (date) atau (startdate dan enddate) atau (empid) harus ada
Contoh:
http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2016-09-13&enddate=2016-09-14&empid=835&attrid=283,284,285
JSON result:
{
"status": "OK",
"data": [
{
"summaryid": 3,
"date": "2016-09-13",
"empid": 835,
"empname": "AGUS YUDIANTO",
"emppin": "0011",
"holidayid": null,
"holiday": "",
"attendance": "y",
"sessioncount": 1,
"absentnoteid": null,
"absentnote": "",
"workhourid": 47,
"unusuallworkhourid": null,
"shouldworking": "y",
"workhourtype": "full",
"shouldworkingtimeduration": 32400,
"innoteid": null,
"innote": "",
"checkin": "2016-09-13 08:29:03",
"checkout": "2016-09-13 19:45:19",
"checkindiff": -1743,
"checkoutdiff": 9919,
"workingtimeduration": 30657,
"overtimeduration": 6319,
"overlapstime": null,
"status": "w"
},
{
"summaryid": 2,
"date": "2016-09-14",
"empid": 835,
"empname": "AGUS YUDIANTO",
"holidayid": null,
"holiday": "",
"attendance": "y",
"sessioncount": 1,
"absentnoteid": null,
"absentnote": "",
"workhourid": 47,
"unusuallworkhourid": null,
"shouldworking": "y",
"workhourtype": "full",
"shouldworkingtimeduration": 32400,
"innoteid": null,
"innote": "",
"checkin": "2016-09-14 09:00:54",
"checkout": "2016-09-14 20:10:01",
"checkindiff": -3654,
"checkoutdiff": 11401,
"workingtimeduration": 28746,
"overtimeduration": 7801,
"overlapstime": null,
"status": "w"
}
]
}
Keterangan JSON result:
summaryid: id rekap kehadiran
date: tanggal kehadiran
empid: id pegawai
empname: nama pegawai
holidayid: id hari libur
holiday: keterangan hari libur
attendance: apakah masuk kerja?
sessioncount: sesi kerja (sesi shift)
absentnoteid: id catatan tidak masuk
absentnote: catatan tidak masuk
workhourid: idjamkerja
unusuallworkhourid: idjamkerjakhusus
shouldworking: jadwalmasukkerja (apakah tanggal tsb dijadwalkan masuk kerja?)
workhourtype: jenis jam kerja (full atau shift)
shouldworkingtimeduration: lama jam kerja menurut jadwal (lama kerja yang seharusnya)
innoteid: id catatan presensi masuk
innote: catatan presensi masuk
checkin: waktu masuk
checkout: waktu keluar
checkindiff: selisih waktu masuk (dalam detik). Jika negatif berarti terlambat
checkoutdiff: selisih waktu keluar (dalam detik). Jika negatif berarti pulang awal
workingtimeduration: lama jam kerja
overtimeduration: lama kerja lembur
overlapstime: apakah ada waktu overlap (khusus untuk jam kerja shift)
status: w=waiting | v=valid | d=discard
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
startdate 2017-02-13
enddate 2017-02-26
pin 0011
curl --request GET
--url 'http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-02-13&enddate=2017-02-26&pin=0011'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-02-13&enddate=2017-02-26&pin=0011",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-02-13&enddate=2017-02-26&pin=0011")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/summary"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx","startdate":"2017-02-13","enddate":"2017-02-26","pin":"0011"}
response = requests.request("GET", url, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"summary"
],
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
< ?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-02-13&enddate=2017-02-26&pin=0011",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/summary?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-02-13&enddate=2017-02-26&pin=0011"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
report
GET /:parameters
http://api.smartpresence.id/v1/report?{{parameters}}
*Method: GET
*Required Parameter:
key={{APIKEY}}
*Optional Parameter:
date: format -> yyyy-mm-dd
startdate: format -> yyyy-mm-dd
enddate: format -> yyyy-mm-dd
empid: idpegawai
pin: pin pegawai
attrid: format dipisahkan koma -> 100,101,102,103
status: dipisahkan pipeline -> w=waiting | v=valid | d=discard
late_limit: batas terlambat sebelum dan sesudah X menit
leaveearly_limit: batas pulang awal sebelum dan sesudah X menit
overtime_limit: batas lembur sebelum dan sesudah X menit
*Catatan:
parameter (date) atau (startdate dan enddate) atau (empid) harus ada
Contoh:
http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2016-09-13&enddate=2016-09-26&late_limit=30
JSON result:
{
"status": "OK",
"data": [
{
"employeeid": 835,
"name": "AGUS YUDIANTO",
"pin": "0011",
"workday_count": "2",
"presence_count": "2",
"presence_in_workday_count": "2",
"presence_not_in_workday_count": "0",
"presence_incomplete_in": "0",
"presence_incomplete_out": "0",
"presence_normal_count": "0",
"presence_dispense_count": "0",
"presence_late_count": "2",
"presence_late_before_count": "2",
"presence_late_after_count": "0",
"absent_permission_count": "0",
"absent_sick_count": "0",
"absent_alpha_count": "0",
"presence_early_leave_count": "0",
"presence_early_leave_before_count": "0",
"presence_early_leave_after_count": "0",
"presence_overtime_count": "2",
"presence_overtime_in_workday_count": "2",
"presence_overtime_not_in_workday_count": "0",
"presence_duration": "61388",
"presence_in_workday_duration": "61388",
"presence_not_in_workday_duration": "0",
"presence_late_duration": "3412",
"presence_late_before_duration": "3412",
"presence_late_after_duration": "0",
"presence_early_leave_duration": "0",
"presence_early_leave_before_duration": "0",
"presence_early_leave_after_duration": "0",
"presence_overtime_duration": "8911",
"presence_overtime_in_workday_duration": "8911",
"presence_overtime_not_in_workday_duration": "0"
}
]
}
Keterangan JSON result:
employeeid: id pegawai
name: nama pegawai
pin: pin pegawai
[Dalam Hari]
=============================================================================================
hari kerja = workday_count
hadir = presence_count
hadir pada jam kerja = presence_in_workday_count
hadir pada hari libur = presence_not_in_workday_count
belum absen masuk = presence_incomplete_in
belum absen keluar = presence_incomplete_out
hadir normal = presence_normal_count
dispensasi = absent_dispense_count
terlambat = presence_late_count
terlambat < (x) mnt = presence_late_before_count terlambat >= (x) mnt = presence_late_after_count
ijin = absent_permission_count
sakit = absent_sick_count
alpha = absent_alpha_count
pulang mendahului = presence_early_leave_count
pulang mendahului < (x) mnt = presence_early_leave_before_count pulang mendahului >= (x) mnt = presence_early_leave_after_count
lembur = presence_overtime_count
lembur hari kerja = presence_overtime_in_workday_count
lembur hari kerja < (x) mnt = presence_overtime_in_workday_before_count lembur hari kerja >= (x) mnt = presence_overtime_in_workday_after_count
lembur hari libur = presence_overtime_not_in_workday_count
lembur hari libur < (x) mnt = presence_overtime_not_in_workday_before_count lembur hari libur >= (x) mnt = presence_overtime_not_in_workday_after_count
=============================================================================================
[Dalam Menit]
=============================================================================================
hadir = presence_duration
hadir pada jam kerja = presence_in_workday_duration
hadir pada hari libur = presence_not_in_workday_duration
terlambat = presence_late_duration
terlambat < (x) mnt = presence_late_before_duration terlambat >= (x) mnt = presence_late_after_duration
pulang mendahului = presence_early_leave_duration
pulang mendahului < (x) mnt = presence_early_leave_before_duration pulang mendahului >= (x) mnt = presence_early_leave_after_duration
lembur = presence_overtime_duration
lembur hari kerja = presence_overtime_in_workday_duration
lembur hari kerja < (x) mnt = presence_overtime_in_workday_before_duration lembur hari kerja >= (x) mnt = presence_overtime_in_workday_after_duration
lembur hari libur = presence_overtime_not_in_workday_duration
lembur hari libur < (x) mnt = presence_overtime_not_in_workday_before_duration lembur hari libur >= (x) mnt = presence_overtime_not_in_workday_after_duration
=============================================================================================
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
startdate 2017-02-13
enddate 2017-02-26
late_limit 100
leaveerly_limit 100
pin 0011
curl --request GET
--url 'http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-03-13&enddate=2017-03-14&late_limit=100&leaveearly_limit=100&pin=0011'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-03-13&enddate=2017-03-14&late_limit=100&leaveearly_limit=100&pin=0011",
"method": "GET",
"headers": {}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-03-13&enddate=2017-03-14&late_limit=100&leaveearly_limit=100&pin=0011")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/report"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx","startdate":"2017-03-13","enddate":"2017-03-14","late_limit":"100","leaveearly_limit":"100","pin":"0011"}
response = requests.request("GET", url, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"report"
],
"headers": {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
< ?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-03-13&enddate=2017-03-14&late_limit=100&leaveearly_limit=100&pin=0011",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://api.smartpresence.id/v1/report?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx&startdate=2017-03-13&enddate=2017-03-14&late_limit=100&leaveearly_limit=100&pin=0011"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
religion
GET /:parameters
http://api.smartpresence.id/v1/api/religion?{{parameters}}
*Method: GET
*Required Parameter:
key={{APIKEY}}
Contoh:
http://api.smartpresence.id/v1/religion?key=50ebvUeHAVjZG7TJqT6L4F7tAoBE3or8oGjUxxx
JSON result:
{
"status": "OK",
"data": [
{
"id": 5,
"agama": "Budha"
},
{
"id": 4,
"agama": "Hindu"
},
{
"id": 1,
"agama": "Islam"
},
{
"id": 2,
"agama": "Kristen"
},
{
"id": 3,
"agama": "Katolik"
}
]
}
HEADERS
Conten-Type application/json
PARAMS
key AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx
curl --request GET
--url 'http://api.smartpresence.id/v1/religion?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx'
--header 'content-type: application/json'
var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.smartpresence.id/v1/religion?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("http://api.smartpresence.id/v1/religion?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import requests
url = "http://api.smartpresence.id/v1/religion"
querystring = {"key":"AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"http://api.smartpresence.id/v1"
],
"path": [
"religion"
],
"headers": {
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
< ?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.smartpresence.id/v1/religion?key=AIzaSyBY28CvmBsfMilTkHoB1SzBhxh3iMzKxxx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}