Restaurar campo personalizado
curl --request POST \
--url https://api.ugps.io/api/asset-custom-fields/{id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/asset-custom-fields/{id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/asset-custom-fields/{id}/restore', 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.ugps.io/api/asset-custom-fields/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.ugps.io/api/asset-custom-fields/{id}/restore"
req, _ := http.NewRequest("POST", 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.post("https://api.ugps.io/api/asset-custom-fields/{id}/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/asset-custom-fields/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "6727d4b2c1a8e3f0a9b1c2d3",
"label": "Código de inventario",
"name": "codigo_de_inventario",
"type": "text",
"groupId": "<string>",
"order": 123,
"options": [
{
"value": "taller",
"label": "Taller central",
"status": "active"
}
],
"rules": {
"required": true,
"unique": true,
"minLength": 500,
"maxLength": 500,
"min": 123,
"max": 123,
"maxDecimals": 5,
"minDate": "2020-01-01",
"maxDate": "2030-12-31"
},
"status": "active",
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"message": "Error interno del servidor"
}Activos - Campos personalizados
Restaurar campo personalizado
Devuelve un campo archivado a activo con su grupo, opciones y reglas. Responde 400 si la empresa ya tiene 50 campos activos o si otro campo activo usa su etiqueta.
Permisos requeridos: access_asset_custom_fields (Campos de activos)
POST
/
api
/
asset-custom-fields
/
{id}
/
restore
Restaurar campo personalizado
curl --request POST \
--url https://api.ugps.io/api/asset-custom-fields/{id}/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/asset-custom-fields/{id}/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/asset-custom-fields/{id}/restore', 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.ugps.io/api/asset-custom-fields/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.ugps.io/api/asset-custom-fields/{id}/restore"
req, _ := http.NewRequest("POST", 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.post("https://api.ugps.io/api/asset-custom-fields/{id}/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/asset-custom-fields/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "6727d4b2c1a8e3f0a9b1c2d3",
"label": "Código de inventario",
"name": "codigo_de_inventario",
"type": "text",
"groupId": "<string>",
"order": 123,
"options": [
{
"value": "taller",
"label": "Taller central",
"status": "active"
}
],
"rules": {
"required": true,
"unique": true,
"minLength": 500,
"maxLength": 500,
"min": 123,
"max": 123,
"maxDecimals": 5,
"minDate": "2020-01-01",
"maxDate": "2030-12-31"
},
"status": "active",
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"message": "Error interno del servidor"
}Authorizations
bearerAuthcookieAuth
Token de sesión Better Auth o API token (atk_...) en el header Authorization: Bearer <token>. Los JWT legacy ya no son válidos.

