Read this documentation topic, and you'll pull documents using document streaming. The process is similar to pulling renders from the API like normally.
However, when you stream the document, your end user can't download it on their device. It is a handy security feature that benefits those who do not want any data to float out of their organization.
- You have generated a PDF document
- You have the ID of this generated document
- You have a mock request tool like Postman or Insomnia available (or have your development environment set up to send requests)
- Your API key has the appropriate permissions (Renders.retrieve)
- Your API key has access to your folder if it is a private folder
Read more about:
Have the ID of the render you want to generate at hand. Also, have your API request tool open. For this tutorial, we are using Insomnia. But you can use any other request tool you like.
Your document ID will have the format of: "rend_" plus 22 non-spaced alphanumeric characters. So, for example, it may look like this:
Also, ensure that you have an API key with the appropriate permissions. If you do not, you will not be authorized to make the request.
Refer to the links under the prerequisites if you need a refresher.
- Open your mock request tool and make a new GET request.
- Input the correct endpoint and specify the Render you want to stream and what page number you want to be streamed. You can build the URL to input like the following:
https://api.inkit.com/v1/render/ + [yourRenderID] + /pdf?page= + [ThePageYouWantStreamed]
Here's an example:
- In the JSON headers of the request, you must include the API key. You can create a header parameter called X-Inkit-API-Token and fill in your API Key.
- Send your request.
Congrats! You successfully streamed a document. If you have a multi-page document, try inputting different page numbers in the request endpoint.
While this may seem very similar to pulling renders, the critical difference is that the render is transferred by streaming.
Updated 4 months ago