Conexiones
Eliminar una conexión
Elimina una conexión. No debe estar referenciada por una regla de enrutamiento activa.
DELETE
/
connections
/
{connection_id}
Eliminar una conexión
curl --request DELETE \
--url https://api-sandbox.y.uno/v1/connections/{connection_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <x-account-code>'import requests
url = "https://api-sandbox.y.uno/v1/connections/{connection_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-Account-Code': '<x-account-code>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/connections/{connection_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-sandbox.y.uno/v1/connections/{connection_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <x-account-code>"
],
]);
$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-sandbox.y.uno/v1/connections/{connection_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.y.uno/v1/connections/{connection_id}")
.header("X-Account-Code", "<x-account-code>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "auth_error",
"code": "NOT_AUTHENTICATED",
"message": "Not authenticated"
}{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found"
}{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection '...' is still referenced by an active routing rule"
}Elimina una conexión que creaste previamente. Devuelve
204 No Content si la operación es exitosa.
Problema conocido: después del
204, la conexión sigue apareciendo como ACTIVE cuando la obtienes. La llamada no cambia el estado que devuelve la consulta.Una conexión que todavía está referenciada por una regla de enrutamiento activa no se puede eliminar: la solicitud falla con
409 CONNECTION_IN_USE. Desvincúlala primero de tus rutas y luego reintenta.Parámetros de ruta
El id devuelto por Crear una conexión. Debe pertenecer a la cuenta a la que está asociada tu clave de API.
Encabezados
Respuesta
Devuelve204 No Content con un cuerpo vacío.
curl -X DELETE 'https://api.y.uno/v1/connections/f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e' \
-H 'public-api-key: <YOUR_PUBLIC_KEY>' \
-H 'private-secret-key: <YOUR_SECRET_KEY>' \
-H 'X-Account-Code: a1b2c3d4-e5f6-7890-abcd-ef1234567890'
{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection 'f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e' is still referenced by an active routing rule",
"details": { "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e" }
}
{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found",
"details": { "connection_id": "..." }
}
Errores
| HTTP | code |
|---|---|
401 | NOT_AUTHENTICATEDClave de API ausente o no válida. |
404 | CONNECTION_NOT_FOUNDconnection_id desconocido, o el id pertenece a otra cuenta. |
409 | CONNECTION_IN_USELa conexión todavía está referenciada por una regla de enrutamiento activa. |
¿Esta página le ayudó?
⌘I
Eliminar una conexión
curl --request DELETE \
--url https://api-sandbox.y.uno/v1/connections/{connection_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Account-Code: <x-account-code>'import requests
url = "https://api-sandbox.y.uno/v1/connections/{connection_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'X-Account-Code': '<x-account-code>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/connections/{connection_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-sandbox.y.uno/v1/connections/{connection_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Account-Code: <x-account-code>"
],
]);
$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-sandbox.y.uno/v1/connections/{connection_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.y.uno/v1/connections/{connection_id}")
.header("X-Account-Code", "<x-account-code>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "auth_error",
"code": "NOT_AUTHENTICATED",
"message": "Not authenticated"
}{
"type": "not_found",
"code": "CONNECTION_NOT_FOUND",
"message": "Connection '...' was not found"
}{
"type": "conflict",
"code": "CONNECTION_IN_USE",
"message": "Connection '...' is still referenced by an active routing rule"
}