<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</title>
    <link>https://blog-qa.groupdocs.cloud/fr/tag/nodejs-rest-api/</link>
    <description>Recent content in nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>fr</language>
    <lastBuildDate>Wed, 21 Oct 2026 13:18:44 +0000</lastBuildDate><atom:link href="https://blog-qa.groupdocs.cloud/fr/tag/nodejs-rest-api/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Supprimer les objets d&#39;annotation du PDF avec REST dans Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/fr/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</link>
      <pubDate>Wed, 21 Oct 2026 13:18:44 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/fr/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</guid>
      <description>Apprenez comment supprimer les objets Annotation d’un PDF avec REST dans Node.JS en utilisant le SDK Cloud GroupDocs.Annotation. Guide étape par étape avec du code, cURL et des pratiques.</description>
      <content:encoded><![CDATA[<p>La suppression des notes, des surlignages ou des marques d’encre indésirables dans les PDF est une exigence fréquente lors de la préparation de documents propres à distribuer. <a href="https://products.groupdocs.cloud/annotation/nodejs/">GroupDocs.Annotation Cloud SDK for Node.js</a> fournit une bibliothèque puissante basée sur REST qui vous permet de gérer les annotations <a href="https://docs.fileformat.com/pdf">PDF</a> de manière programmatique. Ce guide vous montre comment supprimer les objets d’annotation d’un PDF avec REST dans Node.JS, étape par étape. Vous verrez un exemple de code complet, des commandes cURL équivalentes, des conseils de configuration et des recommandations de bonnes pratiques pour intégrer la suppression d’annotations dans vos services.</p>
<h2 id="exemple-complet-fonctionnel-pour-supprimer-les-objets-dannotation-dun-pdf-avec-rest-en-nodejs">Exemple complet fonctionnel pour supprimer les objets d&rsquo;annotation d&rsquo;un PDF avec REST en Node.JS</h2>
<p>Cet exemple montre comment téléverser un PDF, supprimer toutes ses annotations et télécharger le fichier nettoyé en utilisant le GroupDocs.Annotation SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fs</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;fs&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">path</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;path&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Authentication =========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientId</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientSecret</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">AnnotationsApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">storageApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">StorageApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Local &amp; Remote file definitions =======================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localInputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;input.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localOutputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;output.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">remoteFilePath</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.pdf&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Main workflow ==========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>(<span style="color:#66d9ef">async</span> () =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 1. Upload PDF to GroupDocs Cloud storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileBytes</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">readFileSync</span>(<span style="color:#a6e22e">localInputPath</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 2. Build FileInfo object for the uploaded PDF
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileInfo</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 3. Retrieve all existing annotations
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationIds</span> <span style="color:#f92672">=</span> (<span style="color:#a6e22e">annotationsResult</span>.<span style="color:#a6e22e">annotations</span> <span style="color:#f92672">||</span> []).<span style="color:#a6e22e">map</span>(<span style="color:#a6e22e">a</span> =&gt; <span style="color:#a6e22e">a</span>.<span style="color:#a6e22e">id</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 4. Delete all annotations (if any)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">annotationIds</span>.<span style="color:#a6e22e">length</span> <span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">0</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 5. Download the cleaned PDF back to local storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`All annotations removed. Clean file saved to </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">localOutputPath</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>})();
</span></span></code></pre></div><blockquote>
<p><strong>Note :</strong> Cet exemple de code démontre la fonctionnalité principale. Avant de l&rsquo;utiliser dans votre projet, assurez‑vous de mettre à jour tous les chemins de fichiers et les valeurs de configuration pour qu&rsquo;ils correspondent à votre environnement réel, vérifiez que toutes les dépendances requises sont correctement installées et testez soigneusement dans votre environnement de développement. Si vous rencontrez des problèmes, veuillez consulter la <a href="https://docs.groupdocs.cloud/annotation/">documentation officielle</a> ou contacter l&rsquo;<a href="https://forum.groupdocs.cloud/c/annotation/10">équipe de support</a> pour obtenir de l&rsquo;aide.</p>
</blockquote>
<h2 id="supprimer-les-annotations-pdf-via-lapi-rest-en-utilisant-curl">Supprimer les annotations PDF via l&rsquo;API REST en utilisant cURL</h2>
<p>Ci-dessous se trouvent les commandes cURL qui exécutent le même flux de travail de suppression d’annotation via les points de terminaison REST de GroupDocs.Annotation Cloud.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 1. Obtain an access token</span>
</span></span><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/auth/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;client_id\&#34;:\&#34;YOUR_CLIENT_ID\&#34;,\&#34;client_secret\&#34;:\&#34;YOUR_CLIENT_SECRET\&#34;}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 2. Upload the source PDF</span>
</span></span><span style="display:flex;"><span>curl -X PUT <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     --data-binary <span style="color:#e6db74">&#34;@input.pdf&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 3. Retrieve annotation IDs</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 4. Delete all retrieved annotations</span>
</span></span><span style="display:flex;"><span>curl -X DELETE <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;annotationIds\&#34;:[\&#34;id1\&#34;,\&#34;id2\&#34;]}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 5. Download the cleaned PDF</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -o output.pdf
</span></span></code></pre></div><p>Pour une liste complète des points de terminaison et des paramètres, consultez la <a href="https://reference.groupdocs.cloud/annotation/">documentation officielle de l&rsquo;API</a>.</p>
<h2 id="comment-supprimer-les-objets-dannotation-dun-pdf-avec-rest-en-nodejs-fonctionne">Comment supprimer les objets d&rsquo;annotation d&rsquo;un PDF avec REST en Node.JS fonctionne</h2>
<ol>
<li><strong>Configuration de l&rsquo;authentification</strong> - La classe <code>Configuration</code> est instanciée avec votre <code>clientId</code> et <code>clientSecret</code>, créant un contexte authentifié pour tous les appels d&rsquo;API ultérieurs.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span></code></pre></div></li>
<li><strong>Téléchargement de fichier</strong> - <code>UploadFileRequest</code> envoie les octets PDF locaux vers le stockage GroupDocs Cloud. La méthode <code>storageApi.uploadFile</code> gère le transfert.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Récupération des annotations</strong> - <code>GetAnnotationsRequest</code> crée un objet de requête avec une référence <code>FileInfo</code>. L&rsquo;appel <code>annotationsApi.getAnnotations</code> renvoie une collection d&rsquo;objets d&rsquo;annotation, dont les ID sont extraits.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Suppression des annotations</strong> - Si des ID existent, <code>DeleteAnnotationsRequest</code> est rempli et transmis à <code>annotationsApi.deleteAnnotations</code>, qui supprime définitivement les annotations du PDF stocké.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Téléchargement du PDF nettoyé</strong> - Enfin, <code>DownloadFileRequest</code> récupère le fichier mis à jour, et <code>fs.writeFileSync</code> l&rsquo;écrit sur le système de fichiers local.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span></code></pre></div></li>
</ol>
<p>Pour des définitions détaillées des classes et des méthodes, consultez la <a href="https://reference.groupdocs.cloud/annotation/">référence API</a>.</p>
<h2 id="installation-et-configuration-groupdocsannotation-cloud-sdk-for-nodejs">Installation et configuration GroupDocs.Annotation Cloud SDK for Node.js</h2>
<p>Le SDK est distribué sous forme de package npm. Installez‑le avec la commande ci‑dessous, puis requérez‑le dans votre projet.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-annotation-cloud
</span></span></code></pre></div><p>Vous pouvez également télécharger le dernier package directement depuis la <a href="https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node">page des releases GitHub</a> ou depuis l&rsquo;<a href="https://releases.groupdocs.cloud/annotation/nodejs/">URL de téléchargement officielle</a>.</p>
<p>Après l&rsquo;installation, importez la bibliothèque et créez un objet de configuration comme indiqué dans l&rsquo;exemple de code :</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>, <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>);
</span></span></code></pre></div><p>Assurez-vous que votre environnement d&rsquo;exécution répond aux exigences de version de Node.js et que vous disposez d&rsquo;un compte GroupDocs valide pour obtenir les informations d&rsquo;identification du client.</p>
<h2 id="options-et-paramètres-de-suppression-dannotation">Options et paramètres de suppression d&rsquo;annotation</h2>
<p>Le SDK expose plusieurs paramètres que vous pouvez ajuster :</p>
<ul>
<li><strong>clientId / clientSecret</strong> - Identifiants pour l&rsquo;authentification OAuth. Définissez‑les dans le constructeur <code>Configuration</code>.</li>
<li><strong>fileInfo.filePath</strong> - Le chemin du PDF dans le stockage GroupDocs Cloud. Modifiez‑le si vous stockez les fichiers dans un autre dossier.</li>
<li><strong>annotationIds</strong> - Un tableau d&rsquo;ID renvoyés par <code>GetAnnotations</code>. Fournir un sous‑ensemble permet une suppression sélective.</li>
</ul>
<p>Des paramètres supplémentaires tels que les délais d’attente des requêtes et la configuration du proxy sont disponibles dans la documentation du SDK ; consultez la <a href="https://docs.groupdocs.cloud/annotation/">documentation officielle</a> pour la liste complète.</p>
<h2 id="meilleures-pratiques-pour-la-suppression-des-annotations-pdf-via-rest">Meilleures pratiques pour la suppression des annotations PDF via REST</h2>
<ul>
<li><strong>Valider les ID d&rsquo;annotation</strong> - Vérifiez toujours que les ID que vous prévoyez de supprimer existent ; tenter de supprimer des ID inexistants peut entraîner une erreur 404.</li>
<li><strong>Utiliser HTTPS</strong> - Toutes les appels d&rsquo;API doivent être effectués via HTTPS afin de protéger vos identifiants et les données du document.</li>
<li><strong>Gérer les gros fichiers avec des téléchargements fractionnés</strong> - Pour les PDF de plus de 100 Mo, privilégiez le point de terminaison de téléchargement multipart pour éviter les dépassements de délai.</li>
<li><strong>Consigner les réponses de l&rsquo;API</strong> - Enregistrez les ID de requête et les réponses pour les pistes d’audit et faciliter le dépannage.</li>
<li><strong>Réutiliser les jetons d&rsquo;accès</strong> - Mettez en cache le jeton OAuth jusqu&rsquo;à son expiration afin de réduire la charge d&rsquo;authentification.</li>
</ul>
<h2 id="questions-fréquentes">Questions fréquentes</h2>
<ul>
<li>
<p><strong>Comment m&rsquo;authentifier avec GroupDocs.Annotation Cloud API ?</strong><br>
Obtenez un ID client et un secret depuis votre compte GroupDocs, puis demandez un jeton d&rsquo;accès via le point de terminaison OAuth. Voir la <a href="https://docs.groupdocs.cloud/annotation/">documentation officielle</a> pour plus de détails.</p>
</li>
<li>
<p><strong>Puis-je supprimer des annotations spécifiques au lieu de toutes ?</strong><br>
Oui, fournissez les ID des annotations que vous souhaitez supprimer dans le DeleteAnnotationsRequest. Le SDK renvoie la liste des ID d’annotation après un appel GetAnnotations.</p>
</li>
<li>
<p><strong>How can I remove Annotation objects from PDF with REST in Node.JS?</strong><br>
Utilisez le GroupDocs.Annotation Cloud SDK for Node.js pour appeler le point de terminaison DeleteAnnotations après avoir récupéré les ID des annotations. Le flux complet est présenté dans l’exemple de code et la section cURL de ce guide.</p>
</li>
<li>
<p><strong>Quel type de licence est requis pour une utilisation en production ?</strong><br>
Une licence payante est nécessaire pour la production. Vous pouvez obtenir une licence temporaire depuis la <a href="https://purchase.groupdocs.cloud/temporary-license/">page de licence temporaire</a> lors de l&rsquo;évaluation.</p>
</li>
</ul>
<h2 id="lectures-complémentaires">Lectures complémentaires</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/fr/annotation/extract-or-remove-annotations-from-pdf-using-rest-api-in-node-js/">Extraire ou supprimer des annotations d&rsquo;un PDF à l&rsquo;aide de l&rsquo;API REST en Node.js</a></li>
<li><a href="https://blog.groupdocs.cloud/fr/annotation/strikethrough-text-in-a-pdf-using-nodejs/">Texte barré dans un PDF avec Node.js et l&rsquo;API REST</a></li>
<li><a href="https://blog.groupdocs.cloud/fr/annotation/remove-annotations-from-pdf-using-rest-api-in-python/">Supprimer les annotations d&rsquo;un PDF à l&rsquo;aide de l&rsquo;API REST en Python</a></li>
</ul>
]]></content:encoded>
    </item>
    
    <item>
      <title>Modifier une feuille Excel via REST en Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/fr/editor/edit-excel-sheet-via-rest-in-nodejs/</link>
      <pubDate>Fri, 02 Oct 2026 14:32:02 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/fr/editor/edit-excel-sheet-via-rest-in-nodejs/</guid>
      <description>Apprenez à modifier un fichier Excel dans Node.js via REST en utilisant GroupDocs.Editor Cloud SDK. Le guide couvre la configuration, un exemple de code, les appels cURL et les conseils de performance.</description>
      <content:encoded><![CDATA[<p>Automatiser les mises à jour de feuilles de calcul est un besoin courant lors de la création de services web axés sur les données ou de pipelines de reporting. Le <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a> vous permet de modifier un fichier Excel dans Node.js via REST avec seulement quelques lignes de code. Dans ce tutoriel, vous verrez comment configurer le SDK, charger un classeur <a href="https://docs.fileformat.com/spreadsheet/xlsx/">XLSX</a>, modifier une <a href="https://docs.fileformat.com/spreadsheet/cell/">cellule</a>, enregistrer les modifications et obtenir le même résultat en utilisant des appels cURL bruts. Nous abordons également les fonctionnalités clés, les options de configuration et les considérations de performance pour vous aider à intégrer l&rsquo;édition d&rsquo;Excel de manière efficace.</p>
<h2 id="modifier-un-fichier-excel-dans-nodejs-via-rest---guide-en-5-étapes">Modifier un fichier Excel dans Node.js via REST - Guide en 5 étapes</h2>
<ol>
<li><strong>Installez le SDK et configurez les informations d&rsquo;identification</strong> : Définissez votre <code>CLIENT_ID</code> et <code>CLIENT_SECRET</code> afin que la bibliothèque puisse s&rsquo;authentifier auprès de GroupDocs Cloud.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span></code></pre></div><ol start="2">
<li><strong>Charger le classeur Excel pour l&rsquo;édition</strong> : Utilisez <code>EditDocumentRequest</code> pour ouvrir le fichier stocké dans votre stockage cloud.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({ <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span> })
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span></code></pre></div><ol start="3">
<li><strong>Récupérer la première feuille de calcul et localiser la cellule cible</strong> : Le SDK renvoie un objet <code>document</code> qui contient des feuilles de calcul et des cellules.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span></code></pre></div><ol start="4">
<li><strong>Mettre à jour ou créer la valeur de la cellule</strong> : Modifiez le contenu de la cellule <strong>A1</strong> (ou ajoutez‑le s’il n’existe pas).</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>} <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><ol start="5">
<li><strong>Enregistrez le classeur modifié dans le stockage</strong> : Fournissez un <code>outputPath</code> et appelez <code>saveDocument</code>.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({ <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span> });
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>    document<span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.document,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span></code></pre></div><p>Pour une liste complète des classes et des méthodes, consultez la <a href="https://reference.groupdocs.cloud/editor/">référence API</a>.</p>
<h2 id="modifier-un-fichier-excel-dans-nodejs-via-rest---exemple-de-code-complet">Modifier un fichier Excel dans Node.js via REST - Exemple de code complet</h2>
<p>L&rsquo;exemple suivant montre comment modifier un fichier Excel dans Node.js via REST en utilisant GroupDocs.Editor Cloud SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/editor-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Replace with your actual GroupDocs Cloud credentials
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Paths for the source Excel file and the edited result
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">editExcel</span>() {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Configure the SDK
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 1. Load the Excel workbook for editing
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>        })
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">documentId</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> document <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 2. Retrieve the first worksheet
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 3. Update cell A1 (rowIndex = 0, columnIndex = 0) with a new value
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>    } <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 4. Save the edited workbook back to storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>        document<span style="color:#f92672">:</span> document,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`Edited file saved to: </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">saveResult</span>.<span style="color:#a6e22e">path</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Execute the edit operation
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">editExcel</span>().<span style="color:#66d9ef">catch</span>(<span style="color:#a6e22e">error</span> =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">error</span>(<span style="color:#e6db74">&#34;Error during Excel editing:&#34;</span>, <span style="color:#a6e22e">error</span>);
</span></span><span style="display:flex;"><span>});
</span></span></code></pre></div><blockquote>
<p><strong>Note :</strong> Cet exemple de code démontre la fonctionnalité principale. Avant de l&rsquo;utiliser dans votre projet, assurez-vous de mettre à jour tous les chemins de fichiers et les valeurs de configuration pour qu&rsquo;ils correspondent à votre environnement réel, vérifiez que toutes les dépendances requises sont correctement installées et testez soigneusement dans votre environnement de développement. Si vous rencontrez des problèmes, veuillez consulter la <a href="https://docs.groupdocs.cloud/editor/">documentation officielle</a> ou contacter l&rsquo;<a href="https://forum.groupdocs.cloud/c/editor/20">équipe de support</a> pour obtenir de l&rsquo;aide.</p>
</blockquote>
<h2 id="mettre-à-jour-une-feuille-xlsx-en-utilisant-lapi-rest-dans-nodejs-via-curl">Mettre à jour une feuille XLSX en utilisant l&rsquo;API REST dans Node.js via cURL</h2>
<p>Voici un guide rapide de la même opération en utilisant des appels HTTP bruts. Remplacez les valeurs de substitution par vos informations d&rsquo;identification et noms de fichiers réels.</p>
<ol>
<li><strong>Obtenir un jeton d&rsquo;accès</strong></li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/connect/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -H <span style="color:#e6db74">&#34;Content-Type: application/x-www-form-urlencoded&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -d <span style="color:#e6db74">&#34;client_id=YOUR_CLIENT_ID&amp;client_secret=YOUR_CLIENT_SECRET&amp;grant_type=client_credentials&#34;</span>
</span></span></code></pre></div><p>La réponse contient <code>access_token</code>.</p>
<ol start="2">
<li><strong>Téléverser le fichier XLSX source</strong></li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -F <span style="color:#e6db74">&#34;file=@input.xlsx&#34;</span>
</span></span></code></pre></div><ol start="3">
<li>
<p><strong>Modifier le classeur (modifier la cellule A1)</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/editor/edit&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#39;{
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;fileInfo&#34;: { &#34;filePath&#34;: &#34;input.xlsx&#34; },
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;options&#34;: {
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               &#34;cells&#34;: [
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">                   { &#34;rowIndex&#34;: 0, &#34;columnIndex&#34;: 0, &#34;value&#34;: &#34;Edited via GroupDocs Editor Cloud&#34; }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               ]
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">         }&#39;</span>
</span></span></code></pre></div></li>
<li>
<p><strong>Télécharger le fichier modifié</strong></p>
</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/output.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>        -o output.xlsx
</span></span></code></pre></div><p>Pour plus de détails sur les charges utiles de la requête, consultez la <a href="https://reference.groupdocs.cloud/editor/">documentation officielle de l&rsquo;API</a>.</p>
<h2 id="prérequis-et-configuration-pour-groupdocseditor-cloud-sdk-for-nodejs">Prérequis et configuration pour GroupDocs.Editor Cloud SDK for Node.js</h2>
<p>Pour commencer à utiliser le SDK, vous avez besoin de Node.js 14 ou une version ultérieure et d’un compte GroupDocs Cloud.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-editor-cloud
</span></span></code></pre></div><p>Vous pouvez également télécharger le dernier package depuis la <a href="https://releases.groupdocs.cloud/editor/nodejs/">page de publication</a>. Après l&rsquo;installation, créez un <code>client_id</code> et un <code>client_secret</code> dans votre tableau de bord GroupDocs Cloud et conservez‑les en sécurité.</p>
<h2 id="ce-qui-rend-groupdocseditor-cloud-sdk-for-nodejs-idéal-pour-modifier-les-feuilles-de-calcul-excel">Ce qui rend GroupDocs.Editor Cloud SDK for Node.js idéal pour modifier les feuilles de calcul Excel</h2>
<ul>
<li><strong>Full XLSX support</strong> - Chargez, modifiez et enregistrez les classeurs tout en préservant les formules, les styles et la validation des données.</li>
<li><strong>Cell‑level editing</strong> - Accédez aux cellules, lignes ou colonnes individuelles de manière programmatique, ce qui est idéal pour mettre à jour les rapports ou les tableaux de bord.</li>
<li><strong>Cloud storage integration</strong> - Travaillez directement avec les fichiers stockés dans GroupDocs Cloud sans les télécharger localement.</li>
<li><strong>Secure REST communication</strong> - Toutes les opérations se déroulent via HTTPS, et le SDK gère la gestion des jetons pour vous.</li>
</ul>
<p>Pour approfondir, consultez la <a href="https://docs.groupdocs.cloud/editor/">documentation</a>.</p>
<h2 id="affiner-les-options-dédition-excel-dans-groupdocseditor-cloud">Affiner les options d&rsquo;édition Excel dans GroupDocs.Editor Cloud</h2>
<p>Le SDK expose plusieurs options qui vous permettent de contrôler la façon dont le classeur modifié est enregistré.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// You can also set compression level, password protection, etc.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>});
</span></span></code></pre></div><ul>
<li><strong><code>outputPath</code></strong> - Chemin de destination dans le stockage cloud.</li>
<li><strong><code>compressionLevel</code></strong> - Réduire la taille du fichier pour les grands classeurs (disponible dans la référence API).</li>
<li><strong><code>password</code></strong> - Protéger le fichier résultant avec un mot de passe si nécessaire.</li>
</ul>
<p>Ajustez ces paramètres pour correspondre aux exigences de sécurité et de performance de votre projet.</p>
<h2 id="considérations-de-performance-pour-la-modification-de-classeurs-xlsx-via-rest">Considérations de performance pour la modification de classeurs XLSX via REST</h2>
<ol>
<li><strong>Réutiliser l&rsquo;objet de configuration</strong> - Créer une nouvelle <code>Configuration</code> pour chaque requête ajoute une surcharge. Conservez une instance unique pendant la durée de vie de votre application.</li>
<li><strong>Mise à jour groupée des cellules</strong> - Si vous devez modifier de nombreuses cellules, regroupez‑les dans un tableau et envoyez une seule requête de modification au lieu de plusieurs appels.</li>
<li><strong>Limiter la taille de la feuille de calcul</strong> - Les feuilles de calcul très volumineuses augmentent la consommation de mémoire. Envisagez de répartir les données sur plusieurs feuilles lorsque cela est possible.</li>
<li><strong>Éviter les sauvegardes inutiles</strong> - N&rsquo;appelez <code>saveDocument</code> qu&rsquo;après que toutes les modifications requises ont été appliquées afin de réduire les opérations d&rsquo;E/S.</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>Editing an Excel file in Node.js via REST becomes straightforward with the <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a>. Vous pouvez charger programmétiquement un classeur, modifier des cellules et enregistrer le résultat en utilisant seulement quelques appels d&rsquo;API ou de simples commandes cURL. L&rsquo;architecture cloud du SDK élimine le besoin d&rsquo;installations locales d&rsquo;Office et s&rsquo;adapte à la charge de travail de votre application. Pour les déploiements en production, achetez une licence adaptée à votre modèle d&rsquo;utilisation, et vous pouvez également obtenir une licence temporaire pour les tests depuis la <a href="https://purchase.groupdocs.cloud/temporary-license/">temporary license page</a>. Commencez à intégrer l&rsquo;édition Excel dès aujourd&rsquo;hui et rationalisez vos pipelines de traitement de données.</p>
<h2 id="faq">FAQ</h2>
<p><strong>Comment modifier un fichier Excel dans Node.js via REST sans écrire de code HTTP personnalisé ?</strong><br>
Utilisez le GroupDocs.Editor Cloud SDK for Node.js, qui abstrait les appels REST et vous permet de modifier un fichier Excel dans Node.js via REST avec de simples invocations de méthodes.</p>
<p><strong>Puis-je mettre à jour une feuille XLSX en utilisant l&rsquo;API REST Node.js pour les gros fichiers ?</strong><br>
Oui. Le SDK diffuse les données et prend en charge les mises à jour par lots, ce qui le rend adapté aux classeurs volumineux. Ajustez <code>compressionLevel</code> et les modifications de cellules par lots pour améliorer les performances.</p>
<p><strong>Quelle est la meilleure façon de modifier une feuille de calcul Excel de manière programmatique avec Node.js ?</strong><br>
Travaillez avec les objets <code>worksheet</code> et <code>cell</code> renvoyés par <code>editDocument</code>. Cela vous donne un contrôle complet sur les lignes, les colonnes et les valeurs des cellules sans quitter l’environnement Node.js.</p>
<p><strong>Où puis-je trouver les informations de tarification et de licence ?</strong><br>
Tous les détails de licence, y compris les niveaux de tarification et une licence temporaire pour l&rsquo;évaluation, sont disponibles sur la <a href="https://purchase.groupdocs.cloud/temporary-license/">page de licence temporaire</a>.</p>
<h2 id="en-savoir-plus">En savoir plus</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/fr/editor/edit-excel-sheet-via-rest-in-java/">Modifier une feuille Excel via REST en Java</a></li>
<li><a href="https://blog.groupdocs.cloud/fr/editor/edit-excel-sheet-using-rest-api-in-python/">Modifier une feuille Excel en utilisant l&rsquo;API REST en Python</a></li>
<li><a href="https://blog.groupdocs.cloud/fr/editor/best-practices-for-csv-editor-development-in-java/">Meilleures pratiques pour le développement d&rsquo;un éditeur CSV en Java</a></li>
</ul>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
