When you run script or code to call an Unstructured API, you might get one of the following warnings or errors:
You might also get the following related warnings or errors in your logs:
For the API URL, this URL was provided to you when your Unstructured account was created. If you do not have this URL, contact Unstructured Sales at sales@unstructured.io.
The default URL for the Unstructured Worfklow Endpoint is http://platform.unstructuredapp.io/api/v1
.
The default URL for the Unstructured Partition Endpoint is http://api.unstructuredapp.io/general/v0/general
.
However, you should always use the URLs that were provided to you when your Unstructured account was created.
For the API key, the same API key works for both the Unstructured Workflow Endpoint and the Unstructured Partition Endpoint. To access your key:
Sign in to your Unstructured account:
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.
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 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.
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:
Sign in to your Unstructured account:
In the Unstructured UI, click API Keys on the sidebar.
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 or the Unstructured Partition Endpoint, respectively.
If you signed up through the For 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.
If you still believe you have the correct API URL and API key, try the following steps:
Check your script or code to see where the API URL and API key are specified, as follows:
For a POST request
unstructured-api-key
header. Make sure it is set to the right API key, or an environment variable representing the right API key.For the Unstructured Python SDK
server_url
parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL.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
UnstructuredClient
object’s serverURL
parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL.UnstructuredClient
object’s security: { apiKeyAuth }
parameter. Make sure it is set to the right API key, or an environment variable representing the right API key.If you follow the recommended approach to use environment variables to represent the API key and API URL instead of hard-coding them into your script or code, check your session to see if these environment variables have been loaded, for example:
If you are still getting this issue, contact us directly.