Skip to content

Commit 917d395

Browse files
authored
POST requests: how to use a Postman collection (#236)
1 parent 67be97f commit 917d395

File tree

7 files changed

+165
-0
lines changed

7 files changed

+165
-0
lines changed

api-reference/api-services/post-requests.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,49 @@ The API parameters are the same across all methods of accessing the Unstructured
4646
* Refer to the [Examples](/api-reference/api-services/examples) page for some inspiration on using the parameters.
4747

4848
[//]: # (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)
49+
50+
## Postman collection
51+
52+
import UseTheCorrectAPIKey from '/snippets/general-shared-text/api-key-differences.mdx';
53+
54+
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.
55+
56+
1. [Install Postman](https://learning.postman.com/docs/getting-started/installation/installation-and-updates/).
57+
2. [Sign in to Postman](https://learning.postman.com/docs/getting-started/installation/postman-account/#signing-in-to-postman).
58+
3. In your workspace, click **Import**.
59+
60+
![Import a Postman collection](/img/api/post/import.png)
61+
62+
4. In the **Paste cURL, Raw text or URL** box, enter the following URL, and then press `Enter`:
63+
64+
```
65+
https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-POST.postman_collection.json
66+
```
67+
68+
5. On the sidebar, click **Collections**.
69+
70+
![Collections icon in the sidebar](/img/api/post/collection.png)
71+
72+
6. Expand **Unstructured POST**.
73+
7. Click one of the following:
74+
75+
- To call the Unstructured Serverless API, click **(Serverless API) Basic Request**.
76+
- To call the Free Unstructured API, click **(Free API) Basic Request**.
77+
78+
8. On the **Headers** tab, next to `unstructured-api-key`, enter your Unstructured API key in the **Value** column.
79+
80+
![Headers tab in the request area](/img/api/post/headers.png)
81+
82+
<UseTheCorrectAPIKey />
83+
84+
9. On the **Body** tab, next to `files`, click the **Select files** box in the **Value** column.
85+
86+
![Body tab in the request area](/img/api/post/body.png)
87+
88+
11. Click **New file from local machine**.
89+
12. Browse to and select the file that you want Unstructured to process.
90+
13. Click **Send**.
91+
92+
To download the processed data to your local machine, in the response area, click the ellipses, and then click **Save response to file**.
93+
94+
![Save response to file in the response area](/img/api/post/save.png)
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"info": {
3+
"_postman_id": "9cfd731e-2818-465b-b0ec-875586dbf4f0",
4+
"name": "Unstructured POST",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6+
"_exporter_id": "38317384"
7+
},
8+
"item": [
9+
{
10+
"name": "(Serverless API) Basic Request",
11+
"request": {
12+
"method": "POST",
13+
"header": [
14+
{
15+
"key": "Accept",
16+
"value": "application/json",
17+
"type": "text"
18+
},
19+
{
20+
"key": "Content",
21+
"value": "multipart/form-data",
22+
"type": "text"
23+
},
24+
{
25+
"key": "unstructured-api-key",
26+
"value": "",
27+
"type": "text"
28+
}
29+
],
30+
"body": {
31+
"mode": "formdata",
32+
"formdata": [
33+
{
34+
"key": "files",
35+
"type": "file",
36+
"src": []
37+
},
38+
{
39+
"key": "strategy",
40+
"value": "hi_res",
41+
"type": "text"
42+
}
43+
]
44+
},
45+
"url": {
46+
"raw": "https://api.unstructuredapp.io/general/v0/general",
47+
"protocol": "https",
48+
"host": [
49+
"api",
50+
"unstructuredapp",
51+
"io"
52+
],
53+
"path": [
54+
"general",
55+
"v0",
56+
"general"
57+
]
58+
}
59+
},
60+
"response": []
61+
},
62+
{
63+
"name": "(Free API) Basic Request",
64+
"request": {
65+
"auth": {
66+
"type": "noauth"
67+
},
68+
"method": "POST",
69+
"header": [
70+
{
71+
"key": "Accept",
72+
"value": "application/json",
73+
"type": "text"
74+
},
75+
{
76+
"key": "Content-Type",
77+
"value": "multipart/form-data",
78+
"type": "text"
79+
},
80+
{
81+
"key": "unstructured-api-key",
82+
"value": "",
83+
"type": "text"
84+
}
85+
],
86+
"body": {
87+
"mode": "formdata",
88+
"formdata": [
89+
{
90+
"key": "files",
91+
"type": "file",
92+
"src": []
93+
},
94+
{
95+
"key": "strategy",
96+
"value": "hi_res",
97+
"type": "text"
98+
}
99+
]
100+
},
101+
"url": {
102+
"raw": "https://api.unstructured.io/general/v0/general",
103+
"protocol": "https",
104+
"host": [
105+
"api",
106+
"unstructured",
107+
"io"
108+
],
109+
"path": [
110+
"general",
111+
"v0",
112+
"general"
113+
]
114+
}
115+
},
116+
"response": []
117+
}
118+
]
119+
}

img/api/post/body.png

44.6 KB
Loading

img/api/post/collection.png

31.1 KB
Loading

img/api/post/headers.png

53.8 KB
Loading

img/api/post/import.png

13.4 KB
Loading

img/api/post/save.png

23.8 KB
Loading

0 commit comments

Comments
 (0)