Versionado de API
Versionado de API en sus formas habituales. El mismo perfil vuelve con dos formas: v1 (obsoleta: campos planos; envía las cabeceras Deprecation / Sunset / Link successor-version) y v2 (anidada). Elige la versión por la ruta de la URL (/api/v1, /api/v2) o, en /api/versioned/profile, por la cabecera X-API-Version, la query ?api-version= o Accept: application/vnd.apibee.v2+json (se comprueban en ese orden).
- GET
https://api.testingapis.com/api/v1/profileGet the profile in the deprecated v1 shape (selected by URL path). - GET
https://api.testingapis.com/api/v2/profileGet the profile in the current v2 shape (selected by URL path). - GET
https://api.testingapis.com/api/versioned/profileGet the profile in the version chosen by header, query string or media type. - GET
https://api.testingapis.com/api/versionsList supported API versions and how to select them.
Petición de ejemplo
Get the profile in the deprecated v1 shape (selected by URL path). Referencia completa y botón Send (en inglés).
cURL
curl -X GET "https://api.testingapis.com/api/v1/profile"Respuesta · 200 OK
{
"id": 101,
"name": "Ava Thompson",
"email": "ava.thompson@example.com",
"phone": "+1-555-0101",
"address": "742 Evergreen Terrace, Springfield, IL 62704, USA",
"memberSince": "2023-04-12"
}