Open Document Upload UI

This endpoint allows you to get a pre-logged in URL for a file upload browser user interface. By using this endpoint, you can quickly provide users with a one-click opened interface to upload large numbers of documents.

POST Parameters

ParameterRequiredValueDescription
api_key{key}An API key that has access to the resource you want to query for
workflow_id{integer}The ID of a workflow you want to open the interface for
expire{integer}The number of seconds that the generated URL is valid for

Code Examples

The cURL, PHP, Python, Node.js, and C# examples call Xtracta from a trusted server. The React example calls an application-defined backend proxy so the API key is never exposed in browser code.

Warning

Store XTRACTA_API_KEY as a server-side environment variable. Never embed it in browser-delivered code.

curl --request POST 'https://api-app.xtracta.com/v1/documents/upload/ui' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'api_key=<API_KEY>' \
  --data-urlencode 'workflow_id=<WORKFLOW_ID>' \
  --data-urlencode 'expire=1200'

Sample Request

POST https://api-app.xtracta.com/v1/documents/upload/ui HTTP/1.1
api_key=123&workflow_id=456789
expire=1200

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<documents_response>
    <status>200</status>
    <message>The request has been successfully processed</message>
    <url>https://api-app.xtracta.com/v1/documents/upload/ui.html?t=...</url>
    <expire>1425900862</expire>
</documents_response>

Schema Definition

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:simpleType name="ConfidenceType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0"/>
          <xs:maxInclusive value="100"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value=""/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <xs:element name="documents_response">
    <xs:complexType>
      <xs:sequence>
      <xs:element name="status" type="xs:integer" minOccurs="0"/>
      <xs:element name="message" type="xs:string" minOccurs="0"/>
      <xs:element name="url" type="xs:anyURI" minOccurs="0"/>
      <xs:element name="expire" type="xs:integer" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Error Responses

For JSON and XML responses generated by this endpoint, the response is wrapped in documents_response and includes the HTTP status code and a message.

StatusMessageDescription
400workflow_id is requiredSupply the workflow whose upload interface should be opened.
400workflow_id must be natural numberUse a positive integer workflow ID.
400expire must be natural number / expire must be greater than ... / expire must be less than ...Supply a positive expiry duration within the configured URL-expiry range.
500Internal server error occurred. Please try again later or contact support@xtracta.comRetry the request. If it persists, contact support with the workflow ID and request timestamp.
Information Circle

Authentication, permission, IP-access-control, and rate-limit failures can be returned before this endpoint processes the request. Confirm that the API key is active and can access the workflow.