title: Is it possible to insert a Horizontal Rule with Google Docs API?
body: <p>I've been working on a project that needs to insert both text and other types of elements into a Google Docs Document, using PHP. I'm able to insert text using the following code:</p>
  
  <pre><code>    $requests = [];
      ```
      $requests[] = new \Google_Service_Docs_Request(
          ['insertText' =&gt; ['text' =&gt; 'Text to insert',
                            'location' =&gt; ['index' =&gt; $insertionIndex],
                            ],
           ]);
      ```
      $batchUpdateRequest = new \Google_Service_Docs_BatchUpdateDocumentRequest(['requests' =&gt; $requests]);
      $docsService-&gt;documents-&gt;batchUpdate($documentID, $batchUpdateRequest);
  </code></pre>
  
  <p>I can also insert a page break with a similar call:</p>
  
  <pre><code>    $requests = [];
      ```
      $requests[] = new \Google_Service_Docs_Request(
          ['insertPageBreak' =&gt; ['location' =&gt; ['index' =&gt; $insertionIndex],
                                 ],
           ]);
      ```
      $batchUpdateRequest = new \Google_Service_Docs_BatchUpdateDocumentRequest(['requests' =&gt; $requests]);
      $docsService-&gt;documents-&gt;batchUpdate($documentID, $batchUpdateRequest);
  </code></pre>
  
  <p>Both of the above work fine (and as per Google's recommendations when I am carrying out multiple insertions I am working backwards). What I need to be able to do is add a horizontal rule to the document. I know Google Docs allows the manual insertion of them and Apps Script supports insertHorizontalRule but the Docs API doesn't seem to have an equivalent. I have searched here, Google, and the API documentation and can't find any reference to it. Could someone tell me if it is possible? If it is possible, what is the correct request type?</p>
  
  <p>It's seems additionally strange that there isn't a documented way of inserting them, and yet you can query the contents of an existing document and any that are in the document are reported back to you as part of its structure.</p>
  
  <p>For clarity of purpose, I am trying to append the contents of one Google Doc to the another. If anyone knows of a better way to do this than consuming the source document element by element and creating a request to add those elements to the destination document, that would bypass the need to handle inserting a horizontal rule.</p>