Nutrient

SDK

Cloud

Low-Code

Workflow

Getting Started with Other Languages

Nutrient DWS API is offered as a simple HTTP-based API. That means it can be used from any programming language capable of POSTing multipart/form-data payloads. Here, we'll outline the general steps that apply, regardless of the language you choose.

To make use of Nutrient DWS API, you essentially have to perform the following steps:

  1. 1
    Create your instructions object. Refer to the API reference for more information on how instructions needs to look. You can also look at any of our tools pages to see how to use a specific function.
  2. 2
    Encode the instructions object as a JSON object, if you didn't already.
  3. 3
    Next, assemble your multipart/form-data payload. Here, you need to include both the instructions object with the name instructions, and any assets with the name you use to refer to them, in the instructions object.
  4. 4
    Finally, POST your multipart payload to https://api.nutrient.io/build, making sure to include your API key in the authorization header.

To help you picture this more clearly, here are code samples for flattening a PDF in multiple languages. They all follow the general approach for using Nutrient DWS API:

curl -X POST https://api.nutrient.io/build \
  -H "Authorization: Bearer your_api_key_here" \
  -o result.pdf \
  --fail \
  -F document.pdf=@document.pdf \
  -F instructions='{
      "parts": [
        {
          "file": "document.pdf"
        }
      ],
      "actions": [
        {
          "type": "flatten"
        }
      ]
    }'