diff --git a/api-reference/api-services/post-requests.mdx b/api-reference/api-services/post-requests.mdx index 8b72dc9c..bab601e4 100644 --- a/api-reference/api-services/post-requests.mdx +++ b/api-reference/api-services/post-requests.mdx @@ -46,3 +46,49 @@ The API parameters are the same across all methods of accessing the Unstructured * Refer to the [Examples](/api-reference/api-services/examples) page for some inspiration on using the parameters. [//]: # (TODO: when we have the concepts page shared across products, link it from here for the users to learn about partition strategies, chunking strategies and other important shared concepts) + +## Postman collection + +import UseTheCorrectAPIKey from '/snippets/general-shared-text/api-key-differences.mdx'; + +Unstructured offers a [Postman collection](https://learning.postman.com/docs/collections/collections-overview/) that you can import into Postman to make POST requests through a graphical user interface. + +1. [Install Postman](https://learning.postman.com/docs/getting-started/installation/installation-and-updates/). +2. [Sign in to Postman](https://learning.postman.com/docs/getting-started/installation/postman-account/#signing-in-to-postman). +3. In your workspace, click **Import**. + + ![Import a Postman collection](/img/api/post/import.png) + +4. In the **Paste cURL, Raw text or URL** box, enter the following URL, and then press `Enter`: + + ``` + https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-POST.postman_collection.json + ``` + +5. On the sidebar, click **Collections**. + + ![Collections icon in the sidebar](/img/api/post/collection.png) + +6. Expand **Unstructured POST**. +7. Click one of the following: + + - To call the Unstructured Serverless API, click **(Serverless API) Basic Request**. + - To call the Free Unstructured API, click **(Free API) Basic Request**. + +8. On the **Headers** tab, next to `unstructured-api-key`, enter your Unstructured API key in the **Value** column. + + ![Headers tab in the request area](/img/api/post/headers.png) + + + +9. On the **Body** tab, next to `files`, click the **Select files** box in the **Value** column. + + ![Body tab in the request area](/img/api/post/body.png) + +11. Click **New file from local machine**. +12. Browse to and select the file that you want Unstructured to process. +13. Click **Send**. + +To download the processed data to your local machine, in the response area, click the ellipses, and then click **Save response to file**. + +![Save response to file in the response area](/img/api/post/save.png) \ No newline at end of file diff --git a/examplecode/codesamples/api/Unstructured-POST.postman_collection.json b/examplecode/codesamples/api/Unstructured-POST.postman_collection.json new file mode 100644 index 00000000..bf2fd103 --- /dev/null +++ b/examplecode/codesamples/api/Unstructured-POST.postman_collection.json @@ -0,0 +1,119 @@ +{ + "info": { + "_postman_id": "9cfd731e-2818-465b-b0ec-875586dbf4f0", + "name": "Unstructured POST", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "38317384" + }, + "item": [ + { + "name": "(Serverless API) Basic Request", + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content", + "value": "multipart/form-data", + "type": "text" + }, + { + "key": "unstructured-api-key", + "value": "", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "files", + "type": "file", + "src": [] + }, + { + "key": "strategy", + "value": "hi_res", + "type": "text" + } + ] + }, + "url": { + "raw": "https://api.unstructuredapp.io/general/v0/general", + "protocol": "https", + "host": [ + "api", + "unstructuredapp", + "io" + ], + "path": [ + "general", + "v0", + "general" + ] + } + }, + "response": [] + }, + { + "name": "(Free API) Basic Request", + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "multipart/form-data", + "type": "text" + }, + { + "key": "unstructured-api-key", + "value": "", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "files", + "type": "file", + "src": [] + }, + { + "key": "strategy", + "value": "hi_res", + "type": "text" + } + ] + }, + "url": { + "raw": "https://api.unstructured.io/general/v0/general", + "protocol": "https", + "host": [ + "api", + "unstructured", + "io" + ], + "path": [ + "general", + "v0", + "general" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/img/api/post/body.png b/img/api/post/body.png new file mode 100644 index 00000000..56df37e4 Binary files /dev/null and b/img/api/post/body.png differ diff --git a/img/api/post/collection.png b/img/api/post/collection.png new file mode 100644 index 00000000..efe25be7 Binary files /dev/null and b/img/api/post/collection.png differ diff --git a/img/api/post/headers.png b/img/api/post/headers.png new file mode 100644 index 00000000..e98cf487 Binary files /dev/null and b/img/api/post/headers.png differ diff --git a/img/api/post/import.png b/img/api/post/import.png new file mode 100644 index 00000000..651db3bf Binary files /dev/null and b/img/api/post/import.png differ diff --git a/img/api/post/save.png b/img/api/post/save.png new file mode 100644 index 00000000..adec47bd Binary files /dev/null and b/img/api/post/save.png differ