Registra batidas de ponto a partir da importação de um arquivo de relatório AFD
curl --request POST \
--url https://api.example.com/registro-ponto/afd \
--header 'Content-Type: application/json' \
--data '
{
"dataInicial": "01/05/2024",
"dataFinal": "31/05/2024",
"unidadeNegocioId": "123-456abc",
"versao": "PORTARIA_671",
"nomeArquivo": "AFD123456789012347317871000105REP_P.txt",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dataInicial: '01/05/2024',
dataFinal: '31/05/2024',
unidadeNegocioId: '123-456abc',
versao: 'PORTARIA_671',
nomeArquivo: 'AFD123456789012347317871000105REP_P.txt',
base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='
})
};
fetch('https://api.example.com/registro-ponto/afd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/registro-ponto/afd"
payload = {
"dataInicial": "01/05/2024",
"dataFinal": "31/05/2024",
"unidadeNegocioId": "123-456abc",
"versao": "PORTARIA_671",
"nomeArquivo": "AFD123456789012347317871000105REP_P.txt",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/registro-ponto/afd"
payload := strings.NewReader("{\n \"dataInicial\": \"01/05/2024\",\n \"dataFinal\": \"31/05/2024\",\n \"unidadeNegocioId\": \"123-456abc\",\n \"versao\": \"PORTARIA_671\",\n \"nomeArquivo\": \"AFD123456789012347317871000105REP_P.txt\",\n \"base64\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/registro-ponto/afd",
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([
'dataInicial' => '01/05/2024',
'dataFinal' => '31/05/2024',
'unidadeNegocioId' => '123-456abc',
'versao' => 'PORTARIA_671',
'nomeArquivo' => 'AFD123456789012347317871000105REP_P.txt',
'base64' => 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.example.com/registro-ponto/afd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataInicial\": \"01/05/2024\",\n \"dataFinal\": \"31/05/2024\",\n \"unidadeNegocioId\": \"123-456abc\",\n \"versao\": \"PORTARIA_671\",\n \"nomeArquivo\": \"AFD123456789012347317871000105REP_P.txt\",\n \"base64\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"mensagem": "OK",
"relatorioId": "123-abc",
"registrosIndevidos": false,
"colaboradoresNaoEncontrados": false
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Registro de Ponto
Registra batidas de ponto a partir da importação de um arquivo de relatório AFD
POST
/
registro-ponto
/
afd
Registra batidas de ponto a partir da importação de um arquivo de relatório AFD
curl --request POST \
--url https://api.example.com/registro-ponto/afd \
--header 'Content-Type: application/json' \
--data '
{
"dataInicial": "01/05/2024",
"dataFinal": "31/05/2024",
"unidadeNegocioId": "123-456abc",
"versao": "PORTARIA_671",
"nomeArquivo": "AFD123456789012347317871000105REP_P.txt",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dataInicial: '01/05/2024',
dataFinal: '31/05/2024',
unidadeNegocioId: '123-456abc',
versao: 'PORTARIA_671',
nomeArquivo: 'AFD123456789012347317871000105REP_P.txt',
base64: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='
})
};
fetch('https://api.example.com/registro-ponto/afd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/registro-ponto/afd"
payload = {
"dataInicial": "01/05/2024",
"dataFinal": "31/05/2024",
"unidadeNegocioId": "123-456abc",
"versao": "PORTARIA_671",
"nomeArquivo": "AFD123456789012347317871000105REP_P.txt",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/registro-ponto/afd"
payload := strings.NewReader("{\n \"dataInicial\": \"01/05/2024\",\n \"dataFinal\": \"31/05/2024\",\n \"unidadeNegocioId\": \"123-456abc\",\n \"versao\": \"PORTARIA_671\",\n \"nomeArquivo\": \"AFD123456789012347317871000105REP_P.txt\",\n \"base64\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/registro-ponto/afd",
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([
'dataInicial' => '01/05/2024',
'dataFinal' => '31/05/2024',
'unidadeNegocioId' => '123-456abc',
'versao' => 'PORTARIA_671',
'nomeArquivo' => 'AFD123456789012347317871000105REP_P.txt',
'base64' => 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.example.com/registro-ponto/afd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataInicial\": \"01/05/2024\",\n \"dataFinal\": \"31/05/2024\",\n \"unidadeNegocioId\": \"123-456abc\",\n \"versao\": \"PORTARIA_671\",\n \"nomeArquivo\": \"AFD123456789012347317871000105REP_P.txt\",\n \"base64\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"mensagem": "OK",
"relatorioId": "123-abc",
"registrosIndevidos": false,
"colaboradoresNaoEncontrados": false
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Body
application/json
Dados do relatório AFD
Data inicial (dd/MM/yyyy)
Example:
"01/05/2024"
Data final (dd/MM/yyyy)
Example:
"31/05/2024"
ID da unidade de negócio
Example:
"123-456abc"
Versão do equipamento AFD
Available options:
PORTARIA_1510, PORTARIA_671 Nome do arquivo
Example:
"AFD123456789012347317871000105REP_P.txt"
Arquivo base64
Example:
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
Caso hajam colaboradores ativos com CPFs repetidos na unidade de negócio, será considerado somente o primeiro encontrado
Response
Relatório AFD importado com sucesso
Status da operação
Example:
true
Mensagem de retorno
Example:
"OK"
ID do relatório AFD criado
Example:
"123-abc"
Um ou mais registros foram considerados indevidos devido a alguma pendência
Example:
false
Um ou mais colaboradores não foram encontrados ou estão inativos no sistema
Example:
false