Étape 1 : Créer un proxy d'API à partir d'une spécification
Créez un proxy d'API à partir d'une spécification OpenAPI qui décrit l'API.
Pour créer un proxy d'API à partir d'une spécification OpenAPI, procédez comme suit :
Dans l'interface utilisateur Apigee, sélectionnez Develop > API proxies (Développer > Proxys d'API) dans la barre de navigation de gauche pour ouvrir la page Proxys d'API.
Cliquez sur Créer.
L'assistant de création de proxy s'ouvre et vous invite à sélectionner le type de proxy d'API à créer.
Sous Proxy inverse (le plus courant), cliquez sur Utiliser la spécification OpenAPI.
La boîte de dialogue Use OpenAPI Spec (Utiliser la spécification OpenAPI) s'affiche.
Copiez et collez l'URL suivante dans le champ URL de spécification OpenAPI de l'onglet URL :
Cliquez sur Sélectionner.
L'assistant Create Proxy (Créer un proxy) s'ouvre, et la page Proxy details (Détails du proxy) est renseignée à l'aide des valeurs de la spécification OpenAPI.
Modifiez le champ Description comme suit : proxy d'API pour Hello World.
Cliquez sur Suivant.
Sur la page Policies (Règles) :
Sous Security: Authorization (Sécurité : Autorisation), sélectionnez Pass through (no authorization) (Directe [sans autorisation]).
Sous Security: Browser (Sécurité : Navigateur), sélectionnez Add CORS headers (Ajouter des en-têtes CORS).
Cliquez sur Suivant.
Sur la page Flows (Flux), assurez-vous que toutes les opérations sont sélectionnées et cliquez sur Suivant.
Sur la page Summary (Résumé), sélectionnez l'environnement dans lequel vous souhaitez effectuer le déploiement sous Optional Deployment (Déploiement facultatif).
Cliquez sur Create and deploy (Créer et déployer).
Sur la page Résumé, un message de confirmation indique que votre nouveau proxy d'API a été créé et déployé dans l'environnement sélectionné.
Étape 2 : Créer un produit d'API
Créez un produit d'API contenant les ressources d'API que vous souhaitez exposer aux utilisateurs de l'API.
Pour créer un produit API, procédez comme suit :
Dans l'interface utilisateur Apigee, sélectionnez Publish > API Products (Publier > Produits d'API) dans la barre de navigation de gauche pour ouvrir la page des produits d'API.
Cliquez sur +CRÉER.
La page "Produit" s'affiche.
Saisissez les détails du produit API. Remarque : Les champs Nom à afficher et Description s'affichent sur le portail lorsque vous publiez le produit d'API, par défaut. Vous pouvez modifier les valeurs de l'Étape 3 : Publier l'API sur votre portail.
Champ
Valeur
Nom
Hello World
Nom à afficher
Hello World
Description
Exemple "Hello World" simple
Environnement
Sélectionnez l'environnement dans lequel le proxy d'API est déployé.
Accès
Public
Approuver automatiquement les requêtes d'accès
Activé
Quota
(laissez le champ vide)
Champs d'application OAuth autorisés
(laissez le champ vide)
Dans la section Opérations, cliquez sur AJOUTER UNE OPÉRATION pour identifier les opérations à ajouter à votre produit d'API.
Sous Source, cliquez sur API Proxy (Proxy d'API) et sélectionnez Mock-Target-API dans le menu déroulant.
Sous Operation (Opération), saisissez une barre oblique (/) dans le champ Path (Chemin d'accès). Ignorez les autres champs.
Cliquez sur Save (Enregistrer) pour enregistrer l'opération.
La boîte de dialogue Ajouter une opération s'affiche.
Cliquez sur Ajouter.
Cliquez sur Enregistrer.
Étape 3 : Publier l'API sur votre portail
Publiez l'API sur votre portail pour permettre à vos clients de se familiariser avec celle-ci et de l'utiliser.
Pour publier l'API sur votre portail, procédez comme suit :
Dans l'UI d'Apigee, accédez à la page des API de votre portail :
Sélectionnez Publier > Portails dans la barre de navigation de gauche.
Cliquez sur la ligne Mon premier portail pour ouvrir le portail.
Cliquez sur Catalogue d'API pour afficher la page des API.
Cliquez sur le signe +.
Sélectionnez Hello World dans la boîte de dialogue Ajouter un produit d'API au catalogue, puis cliquez sur Suivant.
Sous API details (Détails de l'API), configurez les options suivantes :
Sélectionnez Published (listed in the catalog) (Publié [répertorié dans le catalogue]) pour publier l'API sur votre portail.
Pour Display image (Image à afficher) :
Cliquez sur Select image (Sélectionner une image).
Cliquez sur home-background.jpg dans la liste des images existantes de la boîte de dialogue Select image.
Cliquez sur Sélectionner.
Prévisualisez l'image et cliquez sur Select (Sélectionner).
Pour Categories (Catégories), saisissez Get Started (Premiers pas) et appuyez sur Entrée.
Conservez toutes les autres valeurs par défaut.
Sous API documentation (Documentation de l'API), pour générer automatiquement la documentation de référence de l'API à partir d'un instantané de votre spécification OpenAPI, procédez comme suit :
Sélectionnez OpenAPI document (Document OpenAPI).
Cliquez sur Select Document (Sélectionner un document).
Sélectionnez l'onglet Import from a URL (Importer à partir d'une URL).
Saisissez helloworld dans le champ Spec name (Nom de la spécification).
Copiez et collez l'URL suivante dans le champ URL, puis appuyez sur Entrée :
Pour afficher la documentation de référence de l'API, procédez comme suit :
Dans l'interface utilisateur d'Apigee, cliquez sur Live Portal (Portail en ligne) pour afficher les modifications dans le portail (ou actualisez le portail en ligne s'il est déjà ouvert dans un autre onglet).
Dans le portail en ligne :
a. Cliquez sur APIs (API) dans la barre de navigation supérieure pour afficher l'API publiée. Cliquez sur la fiche Hello World pour afficher la documentation de référence de l'API. Essayez votre API !
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThis guide walks through publishing an API to a portal using Apigee or Apigee hybrid.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating an API proxy from an OpenAPI Specification within the Apigee UI.\u003c/p\u003e\n"],["\u003cp\u003eAn API product is generated, defining the resources to be exposed to API consumers through the portal.\u003c/p\u003e\n"],["\u003cp\u003eFinally, the API is published to the portal, enabling customers to learn about and utilize it, including generating API reference documentation.\u003c/p\u003e\n"]]],[],null,["# Step 6: Publish an API\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\u003cbr /\u003e\n\nIn this step, you'll publish an API to the portal by performing the following steps:\n\n1. [Create an API proxy from a spec](#proxy)\n2. [Create an API product](#product)\n3. [Publish the API to your portal](#publish)\n\nStep 1: Create an API Proxy from a spec\n---------------------------------------\n\nCreate an API proxy from an OpenAPI Specification that describes the API.\n\nTo create an API proxy from an OpenAPI Specification: \n\n### Cloud Console UI\n\n1. In the Apigee in Cloud console, go to the **Proxy Development \\\u003e API proxies** page.\n\n [Go to API proxies](https://console.cloud.google.com/apigee/proxies)\n2. Click **Create** .\n The **Create a proxy** wizard opens prompting you to select the type of API\n proxy to create.\n\n3. Click in the **Proxy template** box.\n\n4. Click **OpenAPI spec template, Reverse Proxy (most common)**.\n\n5. Open the following file in a browser, and then save it:\n\n ```text\n https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml\n ```\n\n \u003cbr /\u003e\n\n6. In **Step 1 OpenAPI Specs** , click **Browse**.\n\n7. Navigate to an OpenAPI Spec file you just downloaded, select it, and then\n click **Open**.\n\n8. Click **Next**.\n\n9. In **Step 2 Proxy details** , the fields are prepopulated using values from\n the OpenAPI Specification. Edit the **Description** field as follows: **API proxy for hello world.**\n\n10. Click **Next**.\n\n11. In **Step 3 Flows**, select all operations.\n\n12. Click **Next**.\n\n13. In **Step 4 Deploy**, select the environment to which you want to deploy.\n\n14. Click **OK**.\n\n15. Click **Create**.\n\n| **Note:** It may take a few moments for Apigee to deploy the new proxy.\n\nWhen the proxy is deployed, the **Status** column in the **Deployments**\nsection displays a green icon to show that the API proxy revision is deployed.\nYou can hold the pointer over the status icon to see more information about\nthe deployment.\n\n### Classic UI\n\n1. In the Apigee UI, select **Develop \\\u003e API proxies** in the left navigation bar to open the API proxies page.\n2. Click **Create New** .\n\n The Create Proxy wizard opens prompting you to select the type of API proxy to create.\n3. Under **Reverse Proxy (most common)** , click **Use OpenAPI Spec** .\n\n The **Use OpenAPI Spec** dialog displays.\n4. Copy and paste the following URL in **OpenAPI Spec URL** field on the **URL** tab:\n\n ```text\n https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml\n ```\n5. Click **Select** .\n The **Create Proxy** wizard opens and the **Proxy details** page is prepopulated using values from the OpenAPI Specification.\n\n6. Edit the **Description** field as follows: **API proxy for hello world.**\n\n7. Click **Next**.\n\n8. On the **Policies** page:\n\n - Under **Security: Authorization** , select **Pass through (no authorization)**.\n - Under **Security: Browser** , select **Add CORS headers** .\n\n9. Click **Next**.\n\n10. On the **Flows** page, make sure all operations are selected and click **Next** .\n\n11. On the **Summary** page, select the environment to which you want to deploy under **Optional Deployment**.\n\n12. Click **Create and deploy**.\n\nOn the **Summary** page, you'll see an acknowledgement that your new API proxy was created successfully\nand deployed to the selected environment.\n\nStep 2: Create an API product\n-----------------------------\n\nCreate an API product that contains the API resources that you want to expose to your API consumers.\n\nTo create an API product:\n\n1. In the Apigee in Cloud console, go to the **Distribution \\\u003e API products** page.\n\n [Go to API products](https://console.cloud.google.com/apigee/apiproducts)\n2. Click **Create** . The **Product details** page is displayed.\n Enter the **Product Details** for your API product. \n\n | **Note:** The **Display Name** and **Description** fields are displayed in the portal when you publish the API product, by default. You can edit the values in [Step 3: Publish the API to your portal](#publish).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n3. In the **Operations** section, click **Add an operation** to identify the\n operations to add to your API product.\n\n - Under **Source** , select **API proxy** and then select **Mock-Target-API** from the drop-down.\n - Under **Operation** , enter a forward slash (`/`) in the **Path** field. Ignore the other fields.\n4. Click **Save** to save the operation.\n\n5. Click **Save** to save the product.\n\nStep 3: Publish the API to your portal\n--------------------------------------\n\nPublish the API to your portal to enable your customers to learn about and use it.\n\nTo publish the API to your portal: \n\n### Cloud Console UI\n\n1. In the Apigee in Cloud console, go to the **Distribution \\\u003e Portals** page.\n\n [Go to Portals](https://console.cloud.google.com/apigee/portals)\n2. Click in the **My first portal** row to open the portal.\n\n3. Click the **APIs** tab.\n\n4. Click **+ API**.\n\n5. For **API product** select **Hello World**.\n\n6. Select **Published (listed in the catalog)** to publish the API to your portal.\n\n7. For **Display title** , enter **Hello World**.\n\n8. For **Display image** , click **Select**.\n\n9. Click **Assets**.\n\n10. Click **Preview** for `home-background.jpg`.\n\n11. Click **Select**.\n\n12. For **API documentation**, to auto-generate API reference documentation\n from a snapshot of your OpenAPI Specification:\n\n 1. Select **OpenAPI document**.\n 2. Click **Select**.\n 3. Click the **URL** tab.\n 4. Type **helloworld** in the **Spec name** field.\n 5. Copy and paste the following URL in the **URL** field: \n\n ```text\n https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml\n ```\n 6. Click **Select**.\n13. Click **Save**.\n\n### Classic UI\n\n1. In the Apigee UI, navigate to the APIs page in your portal:\n 1. Select **Publish \\\u003e Portals** in the left navigation bar.\n 2. Click in the **My first portal** row to open the portal.\n 3. Click **API Catalog** to display the APIs page.\n2. Click **+**.\n3. Select **Hello World** in the **Add an API product to the catalog** dialog and click **Next**.\n4. Under **API details** , configure the following options:\n - Select **Published (listed in the catalog)** to publish the API to your portal.\n - For **Display image** :\n 1. Click **Select image**.\n 2. Click `home-background.jpg` from the list of existing images in the **Select image** dialog.\n 3. Click **Select**.\n 4. Preview the image and click **Select**.\n - For **Categories** , enter **Get Started** and press **Enter**.\n\n Leave all other values set to their defaults.\n\n\n5. Under **API documentation** , to auto-generate API reference documentation from a snapshot of your OpenAPI Specification:\n 1. Select **OpenAPI document**.\n 2. Click **Select Document**.\n 3. Select the **Import from a URL** tab.\n 4. Enter **helloworld** in the **Spec name** field.\n 5. Copy and paste the following URL in the **URL** field and press **Enter** : \n\n ```text\n https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget3.0.yaml\n ```\n 6. Click **Select**.\n\n\n6. Click **Save**.\n\nStep 4: View the API reference documentation\n--------------------------------------------\n\nTo view the API reference documentation:\n\n1. In the Apigee UI, click **Live Portal** to view the changes in the live portal (or refresh the live portal if it is already open in another tab).\n2. In the live portal:\n 1. Click **APIs** in the top navigation bar to the view published API.\n 2. Click the **Hello World** card to view the API reference documentation.\n 3. Give your API a try!\n\n| **Congratulations!** You have successfully completed the tutorial. Ready to learn more? Go to the [Apigee portal documentation](/apigee/docs/api-platform/publish/portal/build-integrated-portal)."]]