From e758f5c89084aac43c6aef8799480f1fdde64c8e Mon Sep 17 00:00:00 2001 From: Paul Cornell Date: Tue, 18 Mar 2025 15:17:00 -0700 Subject: [PATCH 1/2] Troubleshooting API keys/URLs: simplify solutions, clean up UI steps --- api-reference/troubleshooting/api-key-url.mdx | 59 ++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/api-reference/troubleshooting/api-key-url.mdx b/api-reference/troubleshooting/api-key-url.mdx index ff2bb64c..0b8fd2b3 100644 --- a/api-reference/troubleshooting/api-key-url.mdx +++ b/api-reference/troubleshooting/api-key-url.mdx @@ -5,7 +5,7 @@ sidebarTitle: API keys and URLs ## Issue -When you run script or code to call an Unstructured API, you get one of the following warnings or errors: +When you run script or code to call an Unstructured API, you might get one of the following warnings or errors: ``` UserWarning: If intending to use the paid API, please define `server_url` in your request. @@ -15,7 +15,7 @@ UserWarning: If intending to use the paid API, please define `server_url` in you ERROR: Server responded with 404 - {"detail":"Not Found"} ``` -You also get the following related warnings or errors in your logs: +You might also get the following related warnings or errors in your logs: ``` SDKError: API error occurred: Status 401 @@ -37,24 +37,50 @@ API error occurred: Status 404 For the API URL, note the following: -- For the [Unstructured Workflow Endpoint](/api-reference/workflow/overview), the API URL is typically `https://platform.unstructuredapp.io/api/v1`. -- For the [Unstructured Partition Endpoint](/api-reference/partition/overview), the API URL is typically `https://api.unstructuredapp.io/general/v0/general`. +- For the [Unstructured Workflow Endpoint](/api-reference/workflow/overview), the typical API URL is `https://platform.unstructuredapp.io/api/v1`. This is also + the default API URL that Unstructured Python SDK uses for the Workflow Endpoint. +- For the [Unstructured Partition Endpoint](/api-reference/partition/overview), the default API URL is `https://api.unstructuredapp.io/general/v0/general`. This is also + the default API URL that Unstructured Python SDK uses for the Partition Endpoint. -For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) key or [Unstructured Partition Endpoint](/api-reference/partition/overview). This API key is in your Unstructured account dashboard. To access your dashboard: + + If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, your API URL + might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io). + - ![Unstructured account settings](/img/ui/AccountSettings.png) +For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) key or [Unstructured Partition Endpoint](/api-reference/partition/overview). To access your key: - 1. Sign in to your Unstructured account, at [https://platform.unstructured.io](https://platform.unstructured.io). - 2. At the bottom of the sidebar, click your user icon, and then click **Account Settings**. - 3. On the **API Keys** tab, click the copy icon next to your key. +1. Go to [https://platform.unstructured.io](https://platform.unstructured.io) and use your email address, Google account, or GitHub account to + sign up for an Unstructured account (if you do not already have one) and sign into the account at the same time. The + [Unstructured user interface (UI)](/ui/overview) appears. +2. Get your Unstructured API key: + + a. In the Unstructured UI, click **API Keys** on the sidebar.
+ b. Click the **Copy** icon next to your target key to add the key to your system's clipboard. If you lose this key, simply return and click the **Copy** icon again.
+ +3. If you want or need to generate a new Unstructured API key at this point: + + a. Click **Generate API Key**.
+ b. Follow the on-screen instructions to finish generating the key.
+ c. Click the **Copy** icon next to your new key to add the key to your system's clipboard. If you lose this key, simply return and click the **Copy** icon again.
+ + + If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, the process for getting your API key + might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io). + -For the API URL, note the value of the the Unstructured **API URL** (for the Unstructured Workflow Endpoint) or the Unstructured **Serverless API URL** (for the Unstructured Partition Endpoint). +For the API URL, note the value of the Unstructured API URL for the Endpoint that you want to call. To access these API URLs: - ![Unstructured Serverless and API URLs](/img/ui/ServerlessPlatformAPIURL.png) +1. Go to [https://platform.unstructured.io](https://platform.unstructured.io) and use your email address, Google account, or GitHub account to + sign up for an Unstructured account (if you do not already have one) and sign into the account at the same time. The + [Unstructured user interface (UI)](/ui/overview) appears. +2. In the Unstructured UI, click **API Keys** on the sidebar. +3. Note the API URL for the **Unstructured Workflow Endpoint** or the **Unstructured Partition Endpoint**, depending on whether you want to call the + [Unstructured Workflow Endpoint](/api-reference/workflow/overview) or the [Unstructured Partition Endpoint](/api-reference/partition/overview), respectively. - 1. Sign in to your Unstructured account, at [https://platform.unstructured.io](https://platform.unstructured.io). - 2. At the bottom of the sidebar, click your user icon, and then click **Account Settings**. - 3. On the **API Keys** tab, note the correct API URL. These APIs are not interchangeable between the Workflow and Partition APIs. + + If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, your API URL + might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io). + If you still believe you have the correct API URL and API key, try the following steps: @@ -70,6 +96,11 @@ If you still believe you have the correct API URL and API key, try the following - Check the value of the `server_url` parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL. - Check the value of the `api_key_auth` parameter. Make sure it is set to the right API key, or an environment variable representing the right API key. + + If you are using the Unstructured Python SDK to call the Workflow Endpoint or the Partition Endpoint, you should not need to set the value of the + `server_url` parameter if you are using these Endpoints' default API URL. However, you might want to try setting this value anyway to see if it otherwise resolves your issue. + + **For the Unstructured JavaScript/TypeScript SDK** - Check the value of the `UnstructuredClient` object's `serverURL` parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL. From b005357302732ef9a32f7f6a5cabe4bbdd46af71 Mon Sep 17 00:00:00 2001 From: Paul Cornell Date: Tue, 18 Mar 2025 15:32:49 -0700 Subject: [PATCH 2/2] Forgot to save latest updates to Troubleshooting page --- api-reference/troubleshooting/api-key-url.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/troubleshooting/api-key-url.mdx b/api-reference/troubleshooting/api-key-url.mdx index 0b8fd2b3..e420b7b7 100644 --- a/api-reference/troubleshooting/api-key-url.mdx +++ b/api-reference/troubleshooting/api-key-url.mdx @@ -47,7 +47,7 @@ For the API URL, note the following: might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io). -For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) key or [Unstructured Partition Endpoint](/api-reference/partition/overview). To access your key: +For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) and the [Unstructured Partition Endpoint](/api-reference/partition/overview). To access your key: 1. Go to [https://platform.unstructured.io](https://platform.unstructured.io) and use your email address, Google account, or GitHub account to sign up for an Unstructured account (if you do not already have one) and sign into the account at the same time. The