curl --request GET \
--url https://api.salvy.com.br/api/v3/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salvy.com.br/api/v3/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salvy.com.br/api/v3/tasks/{id}', 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://api.salvy.com.br/api/v3/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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"
)
func main() {
url := "https://api.salvy.com.br/api/v3/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salvy.com.br/api/v3/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v3/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "0f9c1b2e-5d3a-4f8b-9c7e-1a2b3c4d5e6f",
"type": "phone-account.update-cost-center",
"status": "running",
"totalCount": 10,
"appliedCount": 7,
"failedCount": 1,
"pendingCount": 2,
"canceledCount": 0
}{
"code": "unauthorized",
"message": "<string>"
}{
"code": "forbidden",
"message": "<string>"
}{
"code": "resource-not-found",
"message": "<string>"
}{
"code": "payload-too-large",
"message": "<string>"
}{
"code": "input-validation-error",
"message": "<string>",
"details": [
{
"key": "<string>",
"message": "<string>"
}
]
}{
"code": "too-many-attempts",
"message": "<string>"
}{
"code": "unknown",
"message": "<string>"
}Detalhar tarefa
Consulta o andamento de uma tarefa iniciada por uma chave de API da sua empresa, com as contagens de itens aplicados, com falha, pendentes e interrompidos. O resultado de cada item está em GET /tasks//results. Tarefas iniciadas pelo dashboard não são consultáveis por aqui e respondem 404.
curl --request GET \
--url https://api.salvy.com.br/api/v3/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salvy.com.br/api/v3/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salvy.com.br/api/v3/tasks/{id}', 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://api.salvy.com.br/api/v3/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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"
)
func main() {
url := "https://api.salvy.com.br/api/v3/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salvy.com.br/api/v3/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v3/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "0f9c1b2e-5d3a-4f8b-9c7e-1a2b3c4d5e6f",
"type": "phone-account.update-cost-center",
"status": "running",
"totalCount": 10,
"appliedCount": 7,
"failedCount": 1,
"pendingCount": 2,
"canceledCount": 0
}{
"code": "unauthorized",
"message": "<string>"
}{
"code": "forbidden",
"message": "<string>"
}{
"code": "resource-not-found",
"message": "<string>"
}{
"code": "payload-too-large",
"message": "<string>"
}{
"code": "input-validation-error",
"message": "<string>",
"details": [
{
"key": "<string>",
"message": "<string>"
}
]
}{
"code": "too-many-attempts",
"message": "<string>"
}{
"code": "unknown",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
ID da tarefa.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"0f9c1b2e-5d3a-4f8b-9c7e-1a2b3c4d5e6f"
Operação da tarefa, que define o formato de cada item em GET /tasks/{id}/results: phone-account.update-cost-center (centro de custo), phone-account.update-custom-fields (campos customizados), phone-account.top-up-data (recarga de dados), phone-account.cancel (cancelamento) ou employee.sync (criação ou atualização de colaboradores). Novos valores podem ser adicionados; trate um valor desconhecido sem falhar.
phone-account.update-cost-center, phone-account.update-custom-fields, phone-account.top-up-data, phone-account.cancel, employee.sync "phone-account.update-cost-center"
Situação da tarefa: running enquanto ainda há itens sendo processados, succeeded quando a alteração foi aplicada em todos os itens, failed quando terminou com ao menos um item com falha, canceled quando foi interrompida.
running, succeeded, failed, canceled "running"
Quantidade de itens incluídos na tarefa.
-9007199254740991 <= x <= 900719925474099110
Quantidade de itens em que a alteração foi aplicada.
-9007199254740991 <= x <= 90071992547409917
Quantidade de itens em que a alteração não foi aplicada.
-9007199254740991 <= x <= 90071992547409911
Quantidade de itens que ainda estão sendo processados.
-9007199254740991 <= x <= 90071992547409912
Quantidade de itens que deixaram de ser processados porque a tarefa foi interrompida.
-9007199254740991 <= x <= 90071992547409910