Realiza rollback de um serviço para uma versão anterior
curl --request POST \
--url https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_version": 2,
"change_reason": "<string>"
}
'import requests
url = "https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback"
payload = {
"to_version": 2,
"change_reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({to_version: 2, change_reason: '<string>'})
};
fetch('https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback', 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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback",
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([
'to_version' => 2,
'change_reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback"
payload := strings.NewReader("{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"autor": "<string>",
"custo_servico": "<string>",
"descricao_completa": "<string>",
"nome_servico": "<string>",
"orgao_gestor": [
"<string>"
],
"resultado_solicitacao": "<string>",
"resumo": "<string>",
"tema_geral": "<string>",
"tempo_atendimento": "<string>",
"agents": {
"exclusive_for_agents": true,
"tool_hint": "<string>"
},
"awaiting_approval": true,
"buttons": [
{
"descricao": "<string>",
"is_enabled": true,
"ordem": 123,
"titulo": "<string>",
"url_service": "<string>"
}
],
"canais_digitais": [
"<string>"
],
"canais_presenciais": [
"<string>"
],
"created_at": 123,
"documentos_necessarios": [
"<string>"
],
"embedding": [
123
],
"extra_fields": {},
"fixar_destaque": true,
"id": "<string>",
"instrucoes_solicitante": "<string>",
"is_free": true,
"last_update": 123,
"legislacao_relacionada": [
"<string>"
],
"publico_especifico": [
"<string>"
],
"published_at": 123,
"search_content": "<string>",
"servico_nao_cobre": "<string>",
"slug": "<string>",
"slug_history": [
"<string>"
],
"status": 0,
"sub_categoria": "<string>"
}{}{}{}{}versions
Realiza rollback de um serviço para uma versão anterior
Cria uma nova versão que restaura o estado de uma versão anterior (git-revert style)
POST
/
api
/
v1
/
admin
/
services
/
{id}
/
rollback
Realiza rollback de um serviço para uma versão anterior
curl --request POST \
--url https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_version": 2,
"change_reason": "<string>"
}
'import requests
url = "https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback"
payload = {
"to_version": 2,
"change_reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({to_version: 2, change_reason: '<string>'})
};
fetch('https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback', 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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback",
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([
'to_version' => 2,
'change_reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback"
payload := strings.NewReader("{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/app-busca-search/api/v1/admin/services/{id}/rollback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to_version\": 2,\n \"change_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"autor": "<string>",
"custo_servico": "<string>",
"descricao_completa": "<string>",
"nome_servico": "<string>",
"orgao_gestor": [
"<string>"
],
"resultado_solicitacao": "<string>",
"resumo": "<string>",
"tema_geral": "<string>",
"tempo_atendimento": "<string>",
"agents": {
"exclusive_for_agents": true,
"tool_hint": "<string>"
},
"awaiting_approval": true,
"buttons": [
{
"descricao": "<string>",
"is_enabled": true,
"ordem": 123,
"titulo": "<string>",
"url_service": "<string>"
}
],
"canais_digitais": [
"<string>"
],
"canais_presenciais": [
"<string>"
],
"created_at": 123,
"documentos_necessarios": [
"<string>"
],
"embedding": [
123
],
"extra_fields": {},
"fixar_destaque": true,
"id": "<string>",
"instrucoes_solicitante": "<string>",
"is_free": true,
"last_update": 123,
"legislacao_relacionada": [
"<string>"
],
"publico_especifico": [
"<string>"
],
"published_at": 123,
"search_content": "<string>",
"servico_nao_cobre": "<string>",
"slug": "<string>",
"slug_history": [
"<string>"
],
"status": 0,
"sub_categoria": "<string>"
}{}{}{}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID do serviço
Body
application/json
Dados do rollback
Response
OK
Maximum string length:
20000Maximum string length:
20000Maximum string length:
20000Maximum string length:
20000Minimum array length:
1Maximum string length:
20000Maximum string length:
20000Maximum string length:
20000Maximum string length:
20000Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
20000Maximum string length:
200000=Draft, 1=Published
Required range:
0 <= x <= 1