Skip to content

Commit 60f7770

Browse files
authored
UI/API: Zendesk source connector (#542)
1 parent 659dece commit 60f7770

File tree

12 files changed

+134
-4
lines changed

12 files changed

+134
-4
lines changed

api-reference/workflow/sources/overview.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ For the list of specific settings, see:
4242
- [Salesforce](/api-reference/workflow/sources/salesforce) (`SALESFORCE` for the Python SDK or `salesforce` for `curl` and Postman)
4343
- [SharePoint](/api-reference/workflow/sources/sharepoint) (`SHAREPOINT` for the Python SDK or `sharepoint` for `curl` and Postman)
4444
- [Snowflake](/api-reference/workflow/sources/snowflake) (`SNOWFLAKE` for the Python SDK or `snowflake` for `curl` and Postman)
45+
- [Zendesk](/api-reference/workflow/sources/zendesk) (`ZENDESK` for the Python SDK or `zendesk` for `curl` and Postman)
4546

4647

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Zendesk
3+
---
4+
5+
import FirstTimeAPISourceConnector from '/snippets/general-shared-text/first-time-api-source-connector.mdx';
6+
7+
<FirstTimeAPISourceConnector />
8+
9+
Ingest your files into Unstructured from Zendesk.
10+
11+
The requirements are as follows.
12+
13+
import ZendeskPrerequisites from '/snippets/general-shared-text/zendesk.mdx';
14+
15+
<ZendeskPrerequisites />
16+
17+
To create a Zendesk source connector, see the following examples.
18+
19+
import ZendeskSDK from '/snippets/source_connectors/zendesk_sdk.mdx';
20+
import ZendeskAPIRESTCreate from '/snippets/source_connectors/zendesk_rest_create.mdx';
21+
22+
<CodeGroup>
23+
<ZendeskSDK />
24+
<ZendeskAPIRESTCreate />
25+
</CodeGroup>
26+
27+
Replace the preceding placeholders as follows:
28+
29+
import ZendeskAPIPlaceholders from '/snippets/general-shared-text/zendesk-api-placeholders.mdx';
30+
31+
<ZendeskAPIPlaceholders />
32+

mint.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@
203203
"ui/sources/s3",
204204
"ui/sources/salesforce",
205205
"ui/sources/sharepoint",
206-
"ui/sources/snowflake"
206+
"ui/sources/snowflake",
207+
"ui/sources/zendesk"
207208
]
208209
},
209210
{
@@ -299,7 +300,8 @@
299300
"api-reference/workflow/sources/s3",
300301
"api-reference/workflow/sources/salesforce",
301302
"api-reference/workflow/sources/sharepoint",
302-
"api-reference/workflow/sources/snowflake"
303+
"api-reference/workflow/sources/snowflake",
304+
"api-reference/workflow/sources/zendesk"
303305
]
304306
},
305307
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- `<name>` (_required_) - A unique name for this connector.
2+
- `<subdomain>` (_required_): The subdomain of your Zendesk site, for example the `<organization>` part of `<organization>.zendesk.com`.
3+
- `<email>` (_required_): The email address of the user account that has access to the Zendesk subdomain.
4+
- `<api-token>` (_required_): The API token (not an OAuth token) for the user account. For more information, see [Managing access to the Zendesk API](https://support.zendesk.com/hc/en-us/articles/226022787-Generating-a-new-API-token).
5+
- `<item-type>`: The type of item to parse. Allowed values include `tickets` and `articles`. If no value is provided, the default is `tickets`.
6+
- `<batch-size>`: The maximum number of items to structure per batch. The default is `2`.

snippets/general-shared-text/zendesk-cli-api.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import AdditionalIngestDependencies from '/snippets/general-shared-text/ingest-d
1010

1111
The following environment variables:
1212

13-
- `ZENDESK_SUBDOMAIN` - The subdomain for your Zendesk account, represented by `--subdomain` (CLI) or `subdomain` (Python).
13+
- `ZENDESK_SUBDOMAIN` - The subdomain for your Zendesk account, represented by `--subdomain` (CLI) or `subdomain` (Python). This subdomain is the `<organization>` part of `<organization>.zendesk.com`.
1414
- `ZENDESK_EMAIL` - The login email address for your Zendesk account, represented by `--email` (CLI) or `email` (Python).
1515
- `ZENDESK_API_TOKEN` - The API token (not OAuth token) for your login email address, represented by `--api-token` (CLI) or `api_token` (Python).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Fill in the following fields:
2+
3+
- **Name** (_required_): A unique name for the connector.
4+
- **Subdomain** (_required_): The subdomain of your Zendesk site, for example the `<organization>` part of `<organization>.zendesk.com`.
5+
- **Email** (_required_): The email address of the user account that has access to the Zendesk subdomain.
6+
- **API Token** (_required_): The API token (not an OAuth token) for the user account. For more information, see [Managing access to the Zendesk API](https://support.zendesk.com/hc/en-us/articles/226022787-Generating-a-new-API-token).
7+
- **Item type**: The type of item to parse. Allowed values include `tickets` and `articles`. If no value is provided, the default is `tickets`.
8+
- **Batch size**: The maximum number of items to structure per batch. The default is `2`.

snippets/general-shared-text/zendesk.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ allowfullscreen
99
></iframe>
1010

1111
- A [Zendesk account](https://www.zendesk.com/register/).
12-
- Your [Zendesk subdomain](https://support.zendesk.com/hc/en-us/articles/4409381383578-Where-can-I-find-my-Zendesk-subdomain).
12+
- Your [Zendesk subdomain](https://support.zendesk.com/hc/en-us/articles/4409381383578-Where-can-I-find-my-Zendesk-subdomain), for example, the `<organization>` part of `<organization>.zendesk.com`.
1313
- The login email address for your Zendesk account.
1414
- An [API token](https://support.zendesk.com/hc/en-us/articles/4408889192858-Managing-access-to-the-Zendesk-API#topic_tcb_fk1_2yb) (not an OAuth token) for your login email address.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```bash curl
2+
curl --request 'POST' --location \
3+
"$UNSTRUCTURED_API_URL/sources" \
4+
--header 'accept: application/json' \
5+
--header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
6+
--header 'content-type: application/json' \
7+
--data \
8+
'{
9+
"name": "<name>",
10+
"type": "zendesk",
11+
"config": {
12+
"subdomain": "<subdomain>",
13+
"email": "<email>",
14+
"api-token": "<api-token>",
15+
"item-type": "<item-type>",
16+
"batch-size": <batch-size>
17+
}
18+
}'
19+
```
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
```python Python SDK
2+
import os
3+
4+
from unstructured_client import UnstructuredClient
5+
from unstructured_client.models.operations import CreateSourceRequest
6+
from unstructured_client.models.shared import (
7+
CreateSourceConnector,
8+
SourceConnectorType,
9+
ZendeskSourceConnectorConfigInput
10+
)
11+
12+
with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as client:
13+
response = client.sources.create_source(
14+
request=CreateSourceRequest(
15+
create_source_connector=CreateSourceConnector(
16+
name="<name>",
17+
type=SourceConnectorType.ZENDESK,
18+
config=ZendeskSourceConnectorConfigInput(
19+
subdomain="<subdomain>",
20+
email="<email>",
21+
api_token="<api-token>",
22+
item_type="<item-type>",
23+
batch_size=<batch-size>
24+
)
25+
)
26+
)
27+
)
28+
29+
print(response.source_connector_information)
30+
```

ui/connectors.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Unstructured supports connecting to the following source and destination types.
3030
- [Salesforce](/ui/sources/salesforce)
3131
- [SharePoint](/ui/sources/sharepoint)
3232
- [Snowflake](/ui/sources/snowflake)
33+
- [Zendesk](/ui/sources/zendesk)
3334

3435
If your source is not listed here, you might still be able to connect Unstructured to it through scripts or code by using the
3536
[Unstructured Ingest CLI](/ingestion/overview#unstructured-ingest-cli) or the

ui/sources/overview.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ To create a source connector:
4141
- [Salesforce](/ui/sources/salesforce)
4242
- [SharePoint](/ui/sources/sharepoint)
4343
- [Snowflake](/ui/sources/snowflake)
44+
- [Zendesk](/ui/sources/zendesk)
4445

4546
8. If a **Continue** button appears, click it, and fill in any additional settings fields.
4647
9. Click **Save and Test**.

ui/sources/zendesk.mdx

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Zendesk
3+
---
4+
5+
import FirstTimeUISourceConnector from '/snippets/general-shared-text/first-time-ui-source-connector.mdx';
6+
7+
<FirstTimeUISourceConnector />
8+
9+
Ingest your files into Unstructured from Zendesk.
10+
11+
The requirements are as follows.
12+
13+
import ZendeskPrerequisites from '/snippets/general-shared-text/zendesk.mdx';
14+
15+
<ZendeskPrerequisites />
16+
17+
To create the source connector:
18+
19+
1. On the sidebar, click **Connectors**.
20+
2. Click **Sources**.
21+
3. Cick **New** or **Create Connector**.
22+
4. Give the connector some unique **Name**.
23+
5. In the **Provider** area, click **Zendesk**.
24+
6. Click **Continue**.
25+
7. Follow the on-screen instructions to fill in the fields as described later on this page.
26+
8. Click **Save and Test**.
27+
28+
import ZendeskFields from '/snippets/general-shared-text/zendesk-platform.mdx';
29+
30+
<ZendeskFields />

0 commit comments

Comments
 (0)