Documentation Index
Fetch the complete documentation index at: https://docs-docflow.textin.ai/llms.txt
Use this file to discover all available pages before exploring further.
01 Access Credential Acquisition
1.1 Public Cloud Usage
DocFlow uses TextIn accounts. Please register on TextIn first, then obtainx-ti-app-id and x-ti-secret-code on the TextIn Homepage - Account & Billing - Account & Developer Information page for request authentication.
1.2 Private Cloud Usage
Please contact the technical support personnel you are working with to obtain API call credentials for on-prem deployment.02 Request Authentication
DocFlow interface supports two request authentication methods:- Simple Authentication. This method is simple but has limited security, usually used for quick integration to experience DocFlow processes and effects.
- Signature Authentication. This method is complex but has higher security. It can prevent access credentials from being obtained by man-in-the-middle attacks and tampering with requests.
2.1 Simple Authentication
Usex-ti-app-id and x-ti-secret-code as HTTP headers for authentication.
Example:
2.2 Signature Authentication
Authenticate requests using signatures, requiring 3 HTTP Headers:| Header | Description |
|---|---|
x-ti-app-id | x-ti-app-id obtained from TextIn developer information |
x-ti-timestamp | Unix Epoch timestamp, in seconds |
x-ti-signature | Request signature, calculation method described below |
Signature Calculation
The signature calculation method is:lower()is the lowercase letter conversion functionhex()converts byte array to hexadecimal stringHMAC_SHA256is a cryptographic hash function, refer to libraries in various development languagessigning_key = HMAC_SHA256(x-ti-secret-code, epoch). Wherex-ti-secret-codeis the TextIn developer credential.epochis the Unix Epoch timestamp (seconds).string_to_sign, detailed explanation below
string_to_sign
string_to_sign is a string concatenated from the following content:
-
HTTP method is uppercase, e.g.,
GET,POST -
Request URL, the path part of the URL (excluding protocol and domain), e.g.,
/api/app-api/sip/platform/v2/file/upload -
URL parameter sorting sorts all request parameters in ascending order by parameter name dictionary order (ASCII code). Parameter values do not participate in sorting. For example:
Suppose the parameters are
workspace_id=12345&batch_num=54321&file_name=invoice.pdf,
The sorted result isbatch_num=54321&file_name=invoice.pdf&workspace_id=12345. Important:- Parameter values do not need url encoding when performing signature calculation
- Parameters are joined with
&, with no&at the end

