API-Versionierung
API-Versionierung in ihren gängigen Formen. Dasselbe Profil kommt in zwei Formen zurück: v1 (veraltet: flache Felder; sendet die Header Deprecation / Sunset / Link successor-version) und v2 (verschachtelt). Wähle die Version über den URL-Pfad (/api/v1, /api/v2) oder, bei /api/versioned/profile, über den Header X-API-Version, die Query ?api-version= oder Accept: application/vnd.apibee.v2+json (in dieser Reihenfolge geprüft).
- 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.
Beispiel-Request
Get the profile in the deprecated v1 shape (selected by URL path). Vollständige Referenz und Send-Button (auf Englisch).
cURL
curl -X GET "https://api.testingapis.com/api/v1/profile"Antwort · 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"
}