diff --git a/docs/ocr/api-ref/ALL_META.TXT.json b/docs/ocr/api-ref/ALL_META.TXT.json new file mode 100644 index 00000000..dee60c76 --- /dev/null +++ b/docs/ocr/api-ref/ALL_META.TXT.json @@ -0,0 +1,365 @@ +[ + { + "dockw":"API Reference" + }, + { + "uri":"ocr_03_0060.html", + "node_id":"ocr_03_0060.xml", + "product_code":"ocr", + "code":"1", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Before You Start", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Before You Start", + "githuburl":"" + }, + { + "uri":"ocr_03_0046.html", + "node_id":"ocr_03_0046.xml", + "product_code":"ocr", + "code":"2", + "des":"Optical Character Recognition (OCR) detects and extracts text from images and converts the text into an editable JSON format.OCR is provided to you through open APIs. You", + "doc_type":"api", + "kw":"Overview,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Overview", + "githuburl":"" + }, + { + "uri":"ocr_03_0061.html", + "node_id":"ocr_03_0061.xml", + "product_code":"ocr", + "code":"3", + "des":"OCR offers REST APIs that support HTTPS requests. For information on how to call an API, see API Calling.", + "doc_type":"api", + "kw":"API Calling,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"API Calling", + "githuburl":"" + }, + { + "uri":"ocr_03_0062.html", + "node_id":"ocr_03_0062.xml", + "product_code":"ocr", + "code":"4", + "des":"An endpoint is the request address used to call an API. Different services have different endpoints for different regions. You can query all service endpoints at Regions ", + "doc_type":"api", + "kw":"Endpoint,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Endpoint", + "githuburl":"" + }, + { + "uri":"ocr_03_0063.html", + "node_id":"ocr_03_0063.xml", + "product_code":"ocr", + "code":"5", + "des":"Only images in PNG, JPG, JPEG, BMP, or TIFF format can be recognized.No side of the image can be smaller than 15 or larger than 8,192 pixels.The area to be recognized mus", + "doc_type":"api", + "kw":"Constraints and Limitations,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Constraints and Limitations", + "githuburl":"" + }, + { + "uri":"ocr_03_0064.html", + "node_id":"ocr_03_0064.xml", + "product_code":"ocr", + "code":"6", + "des":"AccountAn account refers to the username created during user registration and has complete access to all resources and cloud services. It can reset user passwords and ass", + "doc_type":"api", + "kw":"Basic Concepts,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Basic Concepts", + "githuburl":"" + }, + { + "uri":"ocr_03_0047.html", + "node_id":"ocr_03_0047.xml", + "product_code":"ocr", + "code":"7", + "des":"All OCR APIs are proprietary. By calling such APIs, you can use the OCR functions described in Table 1.", + "doc_type":"api", + "kw":"API Overview,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"API Overview", + "githuburl":"" + }, + { + "uri":"ocr_03_0001.html", + "node_id":"ocr_03_0001.xml", + "product_code":"ocr", + "code":"8", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"API Calling", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"API Calling", + "githuburl":"" + }, + { + "uri":"ocr_03_0043.html", + "node_id":"ocr_03_0043.xml", + "product_code":"ocr", + "code":"9", + "des":"Log in to the OCR management console.Select a region based on your business needs. For details about the regions where services are deployed, see Regions and Endpoints.Se", + "doc_type":"api", + "kw":"Subscribing to an OCR Service,API Calling,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Subscribing to an OCR Service", + "githuburl":"" + }, + { + "uri":"ocr_03_0002.html", + "node_id":"ocr_03_0002.xml", + "product_code":"ocr", + "code":"10", + "des":"This section describes the structure of a REST API request, and uses the API for obtaining a user token as an example to demonstrate how to call an API. The obtained toke", + "doc_type":"api", + "kw":"Making an API Request,API Calling,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Making an API Request", + "githuburl":"" + }, + { + "uri":"ocr_03_0005.html", + "node_id":"ocr_03_0005.xml", + "product_code":"ocr", + "code":"11", + "des":"A token is valid for 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.A token is used to acquire temporary permissions.", + "doc_type":"api", + "kw":"Authentication,API Calling,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Authentication", + "githuburl":"" + }, + { + "uri":"ocr_03_0006.html", + "node_id":"ocr_03_0006.xml", + "product_code":"ocr", + "code":"12", + "des":"After sending a request, you will receive a response, including a status code, response header, and response body.A status code is a group of digits, ranging from 1xx to ", + "doc_type":"api", + "kw":"Response,API Calling,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Response", + "githuburl":"" + }, + { + "uri":"ocr_03_0014.html", + "node_id":"ocr_03_0014.xml", + "product_code":"ocr", + "code":"13", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"API", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"API", + "githuburl":"" + }, + { + "uri":"ocr_03_0042.html", + "node_id":"ocr_03_0042.xml", + "product_code":"ocr", + "code":"14", + "des":"This API detects and extracts text from images and converts the text and coordinates into JSON format. It can be used in various scenarios, such as scanned documents, ele", + "doc_type":"api", + "kw":"General Text,API,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"General Text", + "githuburl":"" + }, + { + "uri":"ocr_03_0031.html", + "node_id":"ocr_03_0031.xml", + "product_code":"ocr", + "code":"15", + "des":"This API detects and extracts text from table images and converts the text into JSON format. The returned results include two types of image area (words_region): text are", + "doc_type":"api", + "kw":"General Table,API,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"General Table", + "githuburl":"" + }, + { + "uri":"ocr_03_0048.html", + "node_id":"ocr_03_0048.xml", + "product_code":"ocr", + "code":"16", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Common Parameters", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Common Parameters", + "githuburl":"" + }, + { + "uri":"ocr_03_0090.html", + "node_id":"ocr_03_0090.xml", + "product_code":"ocr", + "code":"17", + "des":"An HTTP status code consists of three digits, which is classified into five categories: 1xx: related information; 2xx: operation successful; 3xx: redirection; 4xx: client", + "doc_type":"api", + "kw":"Status Codes,Common Parameters,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Status Codes", + "githuburl":"" + }, + { + "uri":"ocr_03_0028.html", + "node_id":"ocr_03_0028.xml", + "product_code":"ocr", + "code":"18", + "des":"No data will be returned if an API fails to be called. You can locate the error cause based on the error code of each API. When an API call fails, HTTPS status code 4xx o", + "doc_type":"api", + "kw":"Error Codes,Common Parameters,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Error Codes", + "githuburl":"" + }, + { + "uri":"ocr_03_0130.html", + "node_id":"ocr_03_0130.xml", + "product_code":"ocr", + "code":"19", + "des":"A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.Log in to the management console.In the up", + "doc_type":"api", + "kw":"Obtaining the Project ID,Common Parameters,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Obtaining the Project ID", + "githuburl":"" + }, + { + "uri":"ocr_03_0029.html", + "node_id":"ocr_03_0029.xml", + "product_code":"ocr", + "code":"20", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Change History,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"ocr" + } + ], + "title":"Change History", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/ocr/api-ref/CLASS.TXT.json b/docs/ocr/api-ref/CLASS.TXT.json new file mode 100644 index 00000000..19e30760 --- /dev/null +++ b/docs/ocr/api-ref/CLASS.TXT.json @@ -0,0 +1,182 @@ +[ + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"ocr", + "title":"Before You Start", + "uri":"ocr_03_0060.html", + "doc_type":"api", + "p_code":"", + "code":"1" + }, + { + "desc":"Optical Character Recognition (OCR) detects and extracts text from images and converts the text into an editable JSON format.OCR is provided to you through open APIs. You", + "product_code":"ocr", + "title":"Overview", + "uri":"ocr_03_0046.html", + "doc_type":"api", + "p_code":"1", + "code":"2" + }, + { + "desc":"OCR offers REST APIs that support HTTPS requests. For information on how to call an API, see API Calling.", + "product_code":"ocr", + "title":"API Calling", + "uri":"ocr_03_0061.html", + "doc_type":"api", + "p_code":"1", + "code":"3" + }, + { + "desc":"An endpoint is the request address used to call an API. Different services have different endpoints for different regions. You can query all service endpoints at Regions ", + "product_code":"ocr", + "title":"Endpoint", + "uri":"ocr_03_0062.html", + "doc_type":"api", + "p_code":"1", + "code":"4" + }, + { + "desc":"Only images in PNG, JPG, JPEG, BMP, or TIFF format can be recognized.No side of the image can be smaller than 15 or larger than 8,192 pixels.The area to be recognized mus", + "product_code":"ocr", + "title":"Constraints and Limitations", + "uri":"ocr_03_0063.html", + "doc_type":"api", + "p_code":"1", + "code":"5" + }, + { + "desc":"AccountAn account refers to the username created during user registration and has complete access to all resources and cloud services. It can reset user passwords and ass", + "product_code":"ocr", + "title":"Basic Concepts", + "uri":"ocr_03_0064.html", + "doc_type":"api", + "p_code":"1", + "code":"6" + }, + { + "desc":"All OCR APIs are proprietary. By calling such APIs, you can use the OCR functions described in Table 1.", + "product_code":"ocr", + "title":"API Overview", + "uri":"ocr_03_0047.html", + "doc_type":"api", + "p_code":"", + "code":"7" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"ocr", + "title":"API Calling", + "uri":"ocr_03_0001.html", + "doc_type":"api", + "p_code":"", + "code":"8" + }, + { + "desc":"Log in to the OCR management console.Select a region based on your business needs. For details about the regions where services are deployed, see Regions and Endpoints.Se", + "product_code":"ocr", + "title":"Subscribing to an OCR Service", + "uri":"ocr_03_0043.html", + "doc_type":"api", + "p_code":"8", + "code":"9" + }, + { + "desc":"This section describes the structure of a REST API request, and uses the API for obtaining a user token as an example to demonstrate how to call an API. The obtained toke", + "product_code":"ocr", + "title":"Making an API Request", + "uri":"ocr_03_0002.html", + "doc_type":"api", + "p_code":"8", + "code":"10" + }, + { + "desc":"A token is valid for 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.A token is used to acquire temporary permissions.", + "product_code":"ocr", + "title":"Authentication", + "uri":"ocr_03_0005.html", + "doc_type":"api", + "p_code":"8", + "code":"11" + }, + { + "desc":"After sending a request, you will receive a response, including a status code, response header, and response body.A status code is a group of digits, ranging from 1xx to ", + "product_code":"ocr", + "title":"Response", + "uri":"ocr_03_0006.html", + "doc_type":"api", + "p_code":"8", + "code":"12" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"ocr", + "title":"API", + "uri":"ocr_03_0014.html", + "doc_type":"api", + "p_code":"", + "code":"13" + }, + { + "desc":"This API detects and extracts text from images and converts the text and coordinates into JSON format. It can be used in various scenarios, such as scanned documents, ele", + "product_code":"ocr", + "title":"General Text", + "uri":"ocr_03_0042.html", + "doc_type":"api", + "p_code":"13", + "code":"14" + }, + { + "desc":"This API detects and extracts text from table images and converts the text into JSON format. The returned results include two types of image area (words_region): text are", + "product_code":"ocr", + "title":"General Table", + "uri":"ocr_03_0031.html", + "doc_type":"api", + "p_code":"13", + "code":"15" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"ocr", + "title":"Common Parameters", + "uri":"ocr_03_0048.html", + "doc_type":"api", + "p_code":"", + "code":"16" + }, + { + "desc":"An HTTP status code consists of three digits, which is classified into five categories: 1xx: related information; 2xx: operation successful; 3xx: redirection; 4xx: client", + "product_code":"ocr", + "title":"Status Codes", + "uri":"ocr_03_0090.html", + "doc_type":"api", + "p_code":"16", + "code":"17" + }, + { + "desc":"No data will be returned if an API fails to be called. You can locate the error cause based on the error code of each API. When an API call fails, HTTPS status code 4xx o", + "product_code":"ocr", + "title":"Error Codes", + "uri":"ocr_03_0028.html", + "doc_type":"api", + "p_code":"16", + "code":"18" + }, + { + "desc":"A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.Log in to the management console.In the up", + "product_code":"ocr", + "title":"Obtaining the Project ID", + "uri":"ocr_03_0130.html", + "doc_type":"api", + "p_code":"16", + "code":"19" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"ocr", + "title":"Change History", + "uri":"ocr_03_0029.html", + "doc_type":"api", + "p_code":"", + "code":"20" + } +] \ No newline at end of file diff --git a/docs/ocr/api-ref/PARAMETERS.txt b/docs/ocr/api-ref/PARAMETERS.txt new file mode 100644 index 00000000..6da8d5f0 --- /dev/null +++ b/docs/ocr/api-ref/PARAMETERS.txt @@ -0,0 +1,3 @@ +version="" +language="en-us" +type="" \ No newline at end of file diff --git a/docs/ocr/api-ref/en-us_image_0000001704007332.gif b/docs/ocr/api-ref/en-us_image_0000001704007332.gif new file mode 100644 index 00000000..cfbc91a4 Binary files /dev/null and b/docs/ocr/api-ref/en-us_image_0000001704007332.gif differ diff --git a/docs/ocr/api-ref/en-us_image_0000001744559845.png b/docs/ocr/api-ref/en-us_image_0000001744559845.png new file mode 100644 index 00000000..c0f16671 Binary files /dev/null and b/docs/ocr/api-ref/en-us_image_0000001744559845.png differ diff --git a/docs/ocr/api-ref/en-us_image_0000001750904201.png b/docs/ocr/api-ref/en-us_image_0000001750904201.png new file mode 100644 index 00000000..73f64ccb Binary files /dev/null and b/docs/ocr/api-ref/en-us_image_0000001750904201.png differ diff --git a/docs/ocr/api-ref/ocr_03_0001.html b/docs/ocr/api-ref/ocr_03_0001.html new file mode 100644 index 00000000..1a948b1c --- /dev/null +++ b/docs/ocr/api-ref/ocr_03_0001.html @@ -0,0 +1,17 @@ + + +
This section describes the structure of a REST API request, and uses the API for obtaining a user token as an example to demonstrate how to call an API. The obtained token can then be used to authenticate the calling of other APIs.
+A request URI is in the following format:
+{URI-scheme} :// {Endpoint} / {resource-path} ? {query-string}
+ +Parameter + |
+Description + |
+
---|---|
URI-scheme + |
+Protocol used to transmit requests. All APIs use HTTPS. + |
+
Endpoint + |
+Domain name or IP address of the server for the REST service endpoint. The endpoint varies depending on services in different regions. It can be obtained in Endpoint. + |
+
resource-path + |
+Access path of an API. Obtain the path from the URI of an API. For example, the resource-path of the API for obtaining a user token is /v3/auth/tokens. + |
+
query-string + |
+(Optional) Query parameter. Put a question mark (?) at the beginning. The format is Parameter name=Parameter value. For example, ? limit=10 indicates that a maximum of 10 data records will be displayed. + |
+
To simplify the URI display, each API is provided with only a resource-path and a request method. All API URI schemes are HTTPS and the endpoints are the same in the same region.
+HTTP defines the following request modes that can be used to send a request to the server:
+ +Method + |
+Description + |
+
---|---|
GET + |
+Request the server to return a specific resource. + |
+
PUT + |
+Request the server to update a specific resource. + |
+
POST + |
+Request the server to create a new resource or perform a special operation. + |
+
DELETE + |
+Request the server to delete a specific resource, such as an object. + |
+
HEAD + |
+Request the server for the resource headers. + |
+
PATCH + |
+Request the server to update a portion of the resource content. +PATCH may create a new resource if it does not exist. + |
+
For example, if you use the POST method to obtain the URI of a user token, the request is as follows:
+POST https://{iam-endpoint}/v3/auth/tokens+
You can add additional fields, for example, the fields required by a specified URI or HTTP method, to a request header. For example, add Content-Type, which specifies the request body type, to a request for the authentication information.
+Table 3 describes the common request header fields to be added to the request.
+ +Header + |
+Description + |
+Mandatory + |
+Example + |
+
---|---|---|---|
Content-type + |
+Message body type (format). The default value is application/json. + |
+Yes + |
+application/json + |
+
X-Auth-Token + |
+User token +Response for calling the Obtaining a User Token API. This API is the only one that does not require authentication. After the request is processed, the value of X-Subject-Token in the response header (Header) is the token value. + |
+Mandatory for token-based authentication + |
+MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ + |
+
The API used to obtain a user token does not require authentication. Therefore, only the Content-Type field needs to be added to requests for calling the API. An example of such requests is as follows:
+POST https://{iam-endpoint}/v3/auth/tokens +Content-Type: application/json+
The body of a request is often sent in a structured format (JSON or XML) as specified in the Content-Type header field. The request body transfers content except the request header.
+For an API, the request parameters and parameter description are available in the request. The following provides an example request with a body included. Replace user_name, domain_name, ******** (login password), and xxxxxxxx (project ID) with the actual values. To learn how to obtain a project ID, see Obtaining the Project ID.
+The scope parameter specifies where a token takes effect. In the example, the token takes effect only for the resources in a specified project. OCR uses a region-specific endpoint to call this API. Set scope to project. You can set scope to an account or a project under an account.
+POST https://{iam-endpoint}/v3/auth/tokens +Content-Type:application/json +{ + "auth": { + "identity": { + "methods": ["password"], + "password": { + "user": { + "name": "user_name", + "password": "********", + "domain": { + "name": "domain_name" + } + } + } + }, + "scope": { + "project": { + "name": "xxxxxxxx" + } + } + } +}+
If all data required for the API request is available, you can send the request to call the API through curl, Postman, or coding. x-subject-token in the response header is the desired user token. This token can then be used to authenticate the calling of other APIs.
+A token is valid for 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.
+A token is used to acquire temporary permissions. During API authentication using a token, the token is added to a request to get permissions for calling the API.
+To call an API to obtain a user token, you need to set auth.scope to project in the request body.
+{ + "auth": { + "identity": { + "methods": [ + "password" + ], + "password": { + "user": { + "name": "user_name", + "password": "********", + "domain": { + "name": "domain_name" + } + } + } + }, + "scope": { + "project": { + "name": "xxxxxxxx" + } + } + } +}+
After a token is obtained, the X-Auth-Token header must be added to requests to specify the token when calling other APIs. For example, if the token is ABCDEFJ...., add X-Auth-Token: ABCDEFJ.... to a request as follows:
+Content-Type: application/json +X-Auth-Token: ABCDEFJ....+
After sending a request, you will receive a response, including a status code, response header, and response body.
+A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see Status Codes.
+If status code 201 is returned, the request is successful.
+Similar to a request, a response also has a header, for example, Content-Type.
+ +Header + |
+Description + |
+Mandatory + |
+
---|---|---|
Content-Type + |
+Media type of the response body sent to a recipient +Type: string +Default value: application/json; charset=UTF-8 + |
+Yes + |
+
X-request-id + |
+Request ID for task tracing +Type: string request_id-timestamp-hostname (request_id is the UUID generated on the server. timestamp indicates the current timestamp, and hostname is the name of the server that processes the current API.) +Default value: none + |
+No + |
+
X-ratelimit + |
+Total number of flow control requests +Type: integer +Default value: none + |
+No + |
+
X-ratelimit-used + |
+Number of remaining requests +Type: integer +Default value: none + |
+No + |
+
X-ratelimit-window + |
+Flow control unit +Type: string. The unit is in minute, hour, or day. +Default value: hour + |
+No + |
+
The message header shown in Figure 3-1 is returned.
+x-subject-token is the desired user token. This token can then be used to authenticate the calling of other APIs.
+A response body conveys information other than the response header and is generally sent in a structured format (for example, JSON or XML) defined by the Content-Type field in the response header.
+The following message body is returned. The following is part of the response body:
+{ + "token": { + "expires_at": "2019-02-13T06:52:13.855000Z", + "methods": [ + "password" + ], + "catalog": [ + { + "endpoints": [ + { + "region_id": "********", +......+
If an error occurs during API calling, an error code and error message will be displayed. An error response body is shown as follows:
+{ + "error_msg": "The input parameter is invalid.", + "error_code": "AIS.0101" +}+
In the error response body, error_code is an error code, and error_msg provides information about the error. For more information, see Error Codes.
+No data will be returned if an API fails to be called. You can locate the error cause based on the error code of each API. When an API call fails, HTTPS status code 4xx or 5xx is returned. The returned message body contains the specific error code and error information. If you fail to locate the cause of the error, contact technical support and provide the error code for troubleshooting.
+If an error occurs during API calling, an error code and error message will be displayed. An error response body is shown as follows:
+{ + "error_msg": "The input parameter is invalid.", + "error_code": "AIS.0101" +}+
In the error response, error_code indicates an error code, and error_msg describes the error.
+Category + |
+Error Code + |
+Error Message + |
+Description + |
+Solution + |
+
---|---|---|---|---|
OCR + |
+AIS.0101 + |
+The input parameter is invalid. + |
+The input parameter does not meet the requirements. + |
+Check whether the input parameters are correct. Possible causes are as follows: +
For details about the parameter value format, see the request parameter description of each API. + |
+
AIS.0102 + |
+The image format is not supported. + |
+The image format is not supported. + |
+Check the image format. For details about the image format supported by each service, see "Constraints and Limitations" in the related API section. + |
+|
AIS.0103 + |
+The image size does not meet the requirements. + |
+The image size does not meet the requirements. + |
+Check the image size. For details about the image size supported by each service, see "Constraints and Limitations" in the related API section. + |
+|
AIS.0104 + |
+The image is not supported or the image quality is poor. + |
+The image is not supported or is of poor quality. + |
+Check the image type and quality. +Check whether the called API is correct. + |
+|
AIS.0105 + |
+Recognition failed. + |
+Algorithm calculation failed. + |
+Contact technical support. + |
+|
Platform + |
+ModelArts.0203 + |
+Invalid token. + |
+Invalid token. + |
+Ensure that the token is correct. + |
+
ModelArts.4101 + |
+Token header cannot be empty. + |
+The token is empty. + |
+The HTTP request header does not contain the token request authentication information of x-auth-token. Check the request. + |
+|
ModelArts.4102 + |
+Parse Token error. + |
+Failed to parse the token. + |
+The token request authentication information of x-auth-token in the HTTP request header is incorrect. Check the sent request and token. + |
+|
ModelArts.4103 + |
+Invalid Token header. + |
+The token is invalid. + |
+The token request authentication information of x-auth-token in the HTTP request header is incorrect. Check the sent request and token. + |
+|
ModelArts.4104 + |
+Invalid Request Content Length. + |
+The length of the request body is invalid. + |
+Check the request body length. The size cannot exceed 10 MB. + |
+|
ModelArts.4105 + |
+The JSON format of the input data is incorrect. + |
+The JSON format of the request body is incorrect. + |
+Check the JSON format of the request body. + |
+|
ModelArts.4201 + |
+Request url need service id. + |
+The request URL does not contain the service ID. + |
+Check the service ID in the request URL. + |
+|
ModelArts.4202 + |
+Request url format invalid. + |
+The request URL format is invalid. + |
+Check the request URL format. + |
+|
ModelArts.4203 + |
+Access denied! You do not have permission. + |
+No access permission. + |
+Check the access permission. + |
+|
ModelArts.4204 + |
+Request api error! The API XXX is not subscribed. + |
+Failed to request the service because the service has not been subscribed. + |
+
|
+|
ModelArts.4301 + |
+Have error when get ai-service admin token. + |
+Failed to obtain the admin token of the service. + |
+Contact technical support. + |
+|
ModelArts.4302 + |
+Gateway forwarding error. + |
+The serviced failed to be accessed. + |
+Contact technical support. + |
+|
ModelArts.4401 + |
+Max concurrency error. + |
+The number of concurrent requests exceeds the upper limit. + |
+Contact technical support. + |
+|
ModelArts.4402 + |
+Backend service timeout error. + |
+Service processing timed out. + |
+Contact technical support. + |
+|
ModelArts.4403 + |
+Backend service unavailable error. + |
+The service is unavailable because it failed to respond or its failure rate is high. + |
+Contact technical support. + |
+|
ModelArts.4502 + |
+Backend service response error. + |
+The service failed to respond. + |
+Contact technical support. + |
+|
ModelArts.4503 + |
+Backend service found error. + |
+The service does not exist. + |
+Contact technical support. + |
+|
ModelArts.4504 + |
+Backend service api not found. + |
+The API to be accessed does not exist. + |
+Contact technical support. + |
+|
ModelArts.4505 + |
+Backend service internal error. + |
+Internal server error. + |
+Contact technical support. + |
+|
ModelArts.4506 + |
+SubService service found error. + |
+The subservice corresponding to the API does not exist. + |
+Contact technical support. + |
+|
ModelArts.4508 + |
+Service not start. + |
+The service does not exist or is stopped. + |
+Contact technical support. + |
+|
ModelArts.4601 + |
+The URL is not allowed. + |
+The external URL is invalid. + |
+Check the format of the entered download address. + |
+|
ModelArts.4603 + |
+Obtaining the file from the URL failed. + |
+Failed to download files from the external URL. + |
+Check the network and URL. + |
+|
ModelArts.4702 + |
+Query Obs agency failed. + |
+Failed to query the OBS agency. + |
+Check whether the OBS agency has been enabled for the service. + |
+|
ModelArts.4703 + |
+The Obs URL is invalid. + |
+The OBS URL is invalid. + |
+Check the OBS URL. + |
+|
ModelArts.4704 + |
+Obtaining the file from the OBS failed. + |
+The OBS file failed to be obtained. + |
+Check the OBS file. + |
+|
ModelArts.4705 + |
+The file stored on the OBS is oversized. + |
+The OBS file is oversized. + |
+Check the size of the OBS file and ensure that the file does not exceed the size limit. + |
+|
ModelArts.4706 + |
+The Obs file is not exist. + |
+The OBS file does not exist. + |
+Check whether the corresponding file exists. + |
+|
APIG + |
+APIG.0101 + |
+The API does not exist or has not been published in the environment. + |
+The API does not exist or has not been published. + |
+
|
+
APIG.0201 + |
+Backend timeout. + |
+Request timed out. + |
+
|
+|
APIG.0301 + |
+Incorrect IAM authentication information. + |
+The IAM authentication information is incorrect. +
|
+
|
+|
APIG.0308 + |
+The throttling threshold has been reached: policy user over ratelimit,limit:XX,time:1 minute. + |
+The request exceeds the default rate limit of the service. + |
+Rectify the fault using either of the following methods: +
|
+|
Other + |
+If other error codes cannot be rectified, contact technical support. + |
+
Release Date + |
+What's New + |
+
---|---|
2024-01-08 + |
+This issue is the first official release. + |
+
This API detects and extracts text from table images and converts the text into JSON format. The returned results include two types of image area (words_region): text area (text) and table area (table). They also include table structures (rows and columns) and text information.
+POST /v2/{project_id}/ocr/general-table
+ +Parameter + |
+Mandatory + |
+Description + |
+
---|---|---|
endpoint + |
+Yes + |
+Endpoint, which is the request address for calling an API. +The endpoint varies depending on services in different regions. For more details, see Endpoint. + |
+
project_id + |
+Yes + |
+Project ID, which can be obtained by referring to Obtaining the Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +Used to obtain the permission to call APIs. The token is the value of X-Subject-Token in the response header in Authentication. + |
+
Content-Type + |
+Yes + |
+String + |
+MIME type of the request body. The value is application/json. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
image + |
+No + |
+String + |
+Set either this parameter or url. +Base64-encoded image file. The image file has a size limit of 10 MB. +No side of the image can be smaller than 15 or larger than 8,192 pixels. Only images in JPEG, JPG, PNG, BMP, or TIFF format can be recognized. +An example is /9j/4AAQSkZJRgABAg.... If the image data contains an unnecessary prefix, the error "The image format is not supported" is reported. + |
+
url + |
+No + |
+String + |
+Set either this parameter or image. Image URL. Currently, the following URLs are supported: +
NOTE:
+
|
+
return_text_location + |
+No + |
+Boolean + |
+Whether to return coordinates of text blocks and cells. Possible values are as follows: +
If this parameter is not specified, false is used by default. + |
+
return_char_location + |
+No + |
+Boolean + |
+Coordinate information of a single character. The options are as follows: +
If this parameter is not specified, false is used by default. If this parameter is set to true, return_text_location must be true. + |
+
return_confidence + |
+No + |
+Boolean + |
+Whether the confidence will be returned. The options are as follows: +
If this parameter is not specified, false is used by default. In this case, the confidence will not be returned. + |
+
return_excel + |
+No + |
+Boolean + |
+Whether to return the Base64-encoded field for converting a table into a Microsoft Excel file. The options are as follows: +
You can use the Python function base64.b64decode to decode the returned Excel code and save it as an .xlsx file. + |
+
return_rectification_matrix + |
+No + |
+Boolean + |
+The options are as follows: +
If this parameter is not specified, false is used by default. In this case, the perspective transformation matrix will not be returned. + |
+
with_borders + |
+No + |
+Boolean + |
+The options are as follows: +
If this parameter is not specified, the default value false is used. If the input image contains only bordered tables, set this parameter to true to achieve more accurate recognition results. + |
+
The status code may vary depending on the recognition results. For example, 200 indicates that the API is successfully called, and 400 indicates that the API fails to be called. The following describes the status codes and corresponding response parameters.
+Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
result + |
++ | +Calling result of a successful API call +This parameter is not included when the API fails to be called. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
words_region_count + |
+Integer + |
+Number of text areas + |
+
words_region_list + |
+Array of Table 6 + |
+List of recognition results in text areas. The output sequence is from left to right and from top to bottom. + |
+
excel + |
+String + |
+The table image is converted into the Base64 code of the Excel file. The text and table in the image are written into the Excel file by position. You can use base64.b64decode to decode the returned Excel code and save it as an .xlsx file. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
type + |
+String + |
+Type of the text identification area. The options are as follows: +
|
+
words_block_count + |
+Integer + |
+Number of text blocks recognized in a sub-area + |
+
words_block_list + |
+Array of Table 7 + |
+List of text blocks recognized in a sub-area. The output sequence is from left to right and from top to bottom. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
words + |
+String + |
+Recognition result of a text block + |
+
confidence + |
+Float + |
+Average confidence of fields. A higher confidence indicates a higher accuracy of the field identified. The confidence is calculated using algorithms and is not the measured accuracy. + |
+
location + |
+Array<Array<Integer>> + |
+Text block location information, in list format, indicating the X and Y coordinates of the four vertices in a text block. The coordinate origin is the upper left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
words_list + |
+Array of Table 8 + |
+List of the character blocks in a cell. The text is from left to right and from top to bottom. This parameter is available only when the input parameter return_text_location is set to true. + |
+
rows + |
+Array of integers + |
+Rows occupied by text. The values start from 0 and are displayed in a list. The data type is Integer. This parameter is valid only in table recognition areas, that is, this parameter is valid only when type is table. + |
+
columns + |
+Array of integers + |
+Columns occupied by text. The values start from 0 and are displayed in a list. The data type is Integer. This parameter is valid only in table recognition areas, that is, this parameter is valid only when type is table. + |
+
cell_location + |
+Array<Array<Integer>> + |
+Cell position information, in list format, indicating the X and Y coordinates of the four vertices in a cell. The coordinate origin is the upper left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
words + |
+String + |
+Recognition result of a text block + |
+
confidence + |
+Float + |
+Average confidence of fields. A higher confidence indicates a higher accuracy of the field identified. The confidence is calculated using algorithms and is not the measured accuracy. + |
+
location + |
+Array<Array<Integer>> + |
+Text block location information, in list format, indicating the X and Y coordinates of the four vertices in a text block. The coordinate origin is the upper left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
char_list + |
+Array of Table 9 + |
+List of the character blocks in a cell. The text is from left to right and from top to bottom. This parameter is available only when the input parameters return_text_location and return_char_location are both set to true. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
char + |
+String + |
+Recognition result of a single character + |
+
char_confidence + |
+Float + |
+Confidence of a single character. A higher confidence indicates a higher accuracy of the field identified. The confidence is calculated using algorithms and is not equal to the accuracy. + |
+
char_location + |
+Array<Array<Integer>> + |
+Location information of a single character, in list format, indicating the X and Y coordinates of the four vertices in a text block. The coordinate origin is the upper left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when calling the API failed +This parameter is not returned when the API is successfully called. + |
+
error_msg + |
+String + |
+Error message when the API call fails +This parameter is not included when the API is successfully called. + |
+
POST https://{endpoint}/v2/{project_id}/ocr/general-table + Request Header: + Content-Type: application/json + X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG... + Request Body: + { + "image":"/9j/4AAQSkZJRgABAgEASABIAAD/4RFZRXhpZgAATU0AKgAAAAg...", + "return_confidence":false + }+
POST https://{endpoint}/v2/{project_id}/ocr/general-table + Request Header: + Content-Type: application/json + X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG... + Request Body: + { + "url":"https://BucketName.obs.xxxx.com/ObjectName", + "return_confidence":false + }+
Status code: 200
+Example response for a successful request
+{ + "result" : { + "words_region_count" : 2, + "words_region_list" : [ { + "type" : "text", + "words_block_count" : 1, + "words_block_list" : [ { + "words": "Text block 1 recognized in the text area", + "confidence" : 0.9991 + } ] + }, { + "type" : "table", + "words_block_count" : 2, + "words_block_list" : [ { + "words": "Text block 1 recognized in the table area", + "confidence" : 0.9942, + "rows" : [ 0 ], + "columns" : [ 0 ] + }, { + "words": "Text block 2 recognized in the table area", + "confidence" : 0.914, + "rows" : [ 0 ], + "columns" : [ 1, 2 ] + } ] + } ] + } +}+
Status code: 400
+Example response for a failed request
+{ + "result" : { + "error_code" : "AIS.0103", + "error_msg" : "The image size does not meet the requirements." + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Response for a successful request + |
+
400 + |
+Response for a failed request + |
+
See Status Codes.
+See Error Codes.
+This API detects and extracts text from images and converts the text and coordinates into JSON format. It can be used in various scenarios, such as scanned documents, electronic documents, books, receipts, and forms.
+POST /v2/{project_id}/ocr/general-text
+ +Parameter + |
+Mandatory + |
+Description + |
+
---|---|---|
endpoint + |
+Yes + |
+Endpoint, which is the request address for calling an API. +The endpoint varies depending on services in different regions. For more details, see Endpoint. + |
+
project_id + |
+Yes + |
+Project ID, which can be obtained by referring to Obtaining the Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +Used to obtain the permission to use APIs. The token is the value of X-Subject-Token in the response header in Authentication. + |
+
Content-Type + |
+Yes + |
+String + |
+MIME type of the request body. The value is application/json. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
image + |
+No + |
+String + |
+Set either this parameter or url. +Base64-encoded image file. The image file has a size limit of 10 MB. +No side of the image can be smaller than 15 or larger than 8,192 pixels. Only images in JPEG, JPG, PNG, BMP, GIF, or TIFF format can be recognized. +An example is /9j/4AAQSkZJRgABAg.... If the image data contains an unnecessary prefix, the error "The image format is not supported" is reported. + |
+
url + |
+No + |
+String + |
+Set either this parameter or image. Image URL. Currently, the following URLs are supported: +
NOTE:
+
|
+
detect_direction + |
+No + |
+Boolean + |
+Whether to align the tilted image. The options are as follows: +
An image tilted to any angle can be aligned. If this parameter is not specified, false is used by default. +If the image to be recognized is tilted, you are advised to set this parameter to true. + |
+
quick_mode + |
+No + |
+Boolean + |
+Whether to enable the quick mode. For a single-line text image (the image contains only one line of text and the text area occupies more than 50% of the image), the recognition results can be returned more quickly when this quick mode is enabled. The options are as follows: +
If this parameter is not specified, false is used by default. + |
+
character_mode + |
+No + |
+Boolean + |
+Whether to enable the single-character mode. The options are as follows: +
If this parameter is not transferred, the default value false is used, and information about a single character that occupies a text line is not returned. + |
+
language + |
+No + |
+String + |
+Language. If this parameter is not specified, Chinese and English will be used by default. The options are as follows: +
|
+
single_orientation_mode + |
+No + |
+Boolean + |
+Whether to enable the single direction mode. The options are as follows: +
If this parameter is not specified, false is used by default. In this case, the fields in the image are recognized as in multiple directions by default. + |
+
The status code may vary depending on the recognition results. For example, 200 indicates that the API is successfully called, and 400 indicates that the API fails to be called. The following describes the status codes and corresponding response parameters.
+Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
result + |
++ | +Recognition result +This parameter is not returned when the API fails to be called. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
direction + |
+Float + |
+Image direction +
|
+
words_block_count + |
+Integer + |
+Number of detected text blocks + |
+
words_block_list + |
+Array of Table 6 + |
+List of recognized text blocks. The output sequence is from left to right and from top to bottom. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
words + |
+String + |
+Recognition result of a text block + |
+
location + |
+Array<Array<Integer>> + |
+List of location information about a text block, including the 2D coordinates (x, y) of four vertexes in the text area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
confidence + |
+Float + |
+Confidence of a recognized text block + |
+
char_list + |
+Array of Table 7 + |
+Single-character recognition list corresponding to a text block. The output sequence is from left to right and from top to bottom. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
char + |
+String + |
+Recognition result of a single character + |
+
char_location + |
+Array<Array<Integer>> + |
+List of location information about a single character, including the 2D coordinates (x, y) of four vertexes in the character area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical. + |
+
char_confidence + |
+Float + |
+Confidence of a recognized character + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when calling the API failed +This parameter is not returned when the API is successfully called. + |
+
error_msg + |
+String + |
+Error message when the API call fails +This parameter is not returned when the API is successfully called. + |
+
POST https://{endpoint}/v2/{project_id}/ocr/general-text + Request Header: + Content-Type: application/json + X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG... + Request Body: + { + "image":"/9j/4AAQSkZJRgABAgEASABIAAD/4RFZRXhpZgAATU0AKgAAAA...", + "detect_direction":false, + "quick_mode":false + }+
POST https://{endpoint}/v2/{project_id}/ocr/general-text + Request Header: + Content-Type: application/json + X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG... + Request Body: + { + "url":"https://BucketName.obs.xxxx.com/ObjectName", + "detect_direction":false, + "quick_mode":false + }+
Status code: 200
+Example response for a successful request
+{ + "result" : { + "direction" : 67.6506, + "words_block_count" : 1, + "words_block_list" : [ { + "words": "Word", + "confidence" : 0.9999, + "location" : [ [ 517, 447 ], [ 540, 504 ], [ 505, 518 ], [ 482, 461 ] ], + "char_list" : [ { + "char": "Character", + "char_location" : [ [ 517, 447 ], [ 530, 479 ], [ 495, 493 ], [ 482, 461 ] ], + "char_confidence" : 0.9999 + }, { + "char": "Character", + "char_location" : [ [ 530, 479 ], [ 540, 504 ], [ 505, 518 ], [ 495, 493 ] ], + "char_confidence" : 0.9999 + } ] + } ] + } +}+
Status code: 400
+Example response for a failed request
+{ + "error_code": "AIS.0103", + "error_msg": "The image size does not meet the requirements." +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Response for a successful request + |
+
400 + |
+Response for a failed request + |
+
See Status Codes.
+See Error Codes.
+Select a region based on your business needs. For details about the regions where services are deployed, see Regions and Endpoints.
+Optical Character Recognition (OCR) detects and extracts text from images and converts the text into an editable JSON format.
+OCR is provided to you through open APIs. You can access and call APIs in real-time to obtain inference results, which helps you automatically collect key data and build intelligent business systems, ultimately improving business efficiency.
+Before calling an OCR API, make sure you have a thorough understanding of the relevant concepts listed in Basic Concepts.
+All OCR APIs are proprietary. By calling such APIs, you can use the OCR functions described in Table 1.
+ + +OCR offers REST APIs that support HTTPS requests. For information on how to call an API, see API Calling.
+An endpoint is the request address used to call an API. Different services have different endpoints for different regions. You can query all service endpoints at Regions and Endpoints.
+An account refers to the username created during user registration and has complete access to all resources and cloud services. It can reset user passwords and assign user permissions. To ensure account security, it is recommended that you do not use the account for daily management tasks. Instead, create IAM users and use them for such purposes.
+A user is created in IAM using an account and is a person who uses cloud services with identity credentials such as a password and access key. Typically, when authorizing API calls, you will need to provide information such as the account name, username, and password.
+A region is a physical location where a cloud service is deployed. Availability zones (AZs) in the same region can communicate with each other over an intranet but AZs in different regions cannot communicate with each other. By creating cloud resources in different regions, you can design applications to better meet customer requirements and comply with local laws and regulations.
+An AZ contains one or more physical data centers. It has independent cooling, fire extinguishing, moisture-proof, and electricity facilities. Within an AZ, compute network, storage, and other resources are logically divided into multiple clusters. AZs within a region are interconnected using high-speed optical fibers to allow you to build cross-AZ high-availability systems.
+Projects group and isolate resources (including compute, storage, and network resources) across physical regions. A default project is provided for each region, and subprojects can be created under each default project. Users can be granted permissions to access all resources in a specific project. If you need more refined access control, create subprojects under a default project and purchase resources in subprojects. Then you can assign users the permissions required to access only the resources in the specific subprojects.
+Consumption checkpoint. When an application consumes data, the latest SN of the consumed data is recorded as a checkpoint. When the data is consumed again, the consumption can be continued based on this checkpoint.
+Application identifier. Multiple applications can access data in the same stream. Checkpoints generated for each application are used to record the consumed data in the stream by each application.
+An HTTP status code consists of three digits, which is classified into five categories: 1xx: related information; 2xx: operation successful; 3xx: redirection; 4xx: client error; 5xx: server error.
+The following table lists the common status codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
100 + |
+Continue + |
+The client should proceed with the request. +This interim response is used to inform the client that part of the request has been received and has not yet been rejected by the server. + |
+
101 + |
+Switching Protocols + |
+The server is switching to a new protocol. The target protocol must be more advanced than the original one. +For example, a later version of HTTPS is used. + |
+
200 + |
+OK + |
+The server has successfully processed the request. + |
+
201 + |
+Created + |
+The request has been fulfilled and resulted in a new resource being created. + |
+
202 + |
+Accepted + |
+The request has been accepted, but the processing has not been completed. + |
+
203 + |
+Non-Authoritative Information + |
+The request has been fulfilled. + |
+
204 + |
+No Content + |
+The server has successfully processed the request, but does not return any content. +The status code is returned in response to an HTTP OPTIONS request. + |
+
205 + |
+Reset Content + |
+The server has fulfilled the request and requires the client to reset the content. + |
+
206 + |
+Partial Content + |
+The server has fulfilled the partial GET request for the resource. + |
+
300 + |
+Multiple Choices + |
+There are multiple options for the location of the requested resource. The response contains a list of resource characteristics and addresses from which the user or user agent (such as a browser) can choose the most appropriate one. + |
+
301 + |
+Moved Permanently + |
+This and all future requests have been permanently moved to the given URI indicated in this response. + |
+
302 + |
+Found + |
+The requested resource has been temporarily moved. + |
+
303 + |
+See Other + |
+The response to the request can be found under a different URI, and should be retrieved using a GET or POST method. + |
+
304 + |
+Not Modified + |
+The requested resource has not been modified. When the server returns this status code, no resource is returned. + |
+
305 + |
+Use Proxy + |
+The requested resource is available only through a proxy. + |
+
306 + |
+Unused + |
+The HTTP status code is no longer used. + |
+
400 + |
+Bad Request + |
+Invalid request. +Modify the request directly and do not attempt to retry it. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
402 + |
+Payment Required + |
+Reserved request. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received and understood the request, but refused to respond to it. Modify the request directly and do not attempt to retry it. + |
+
404 + |
+Not Found + |
+The requested resource does not exist. +Modify the request directly and do not attempt to retry it. + |
+
405 + |
+Method Not Allowed + |
+The request contains a method that is not supported by the resource. +Modify the request directly and do not attempt to retry it. + |
+
406 + |
+Not Acceptable + |
+The server could not fulfil the request based on the characteristics of the request. + |
+
407 + |
+Proxy Authentication Required + |
+This status code is similar to 401, but the client must be authenticated using a proxy. + |
+
408 + |
+Request Timeout + |
+The request timed out. +The client can resubmit the request at any time without making any changes. + |
+
409 + |
+Conflict + |
+The server encountered a conflict fulfilling the request. +This status code indicates that the resource the client is attempting to create already exists, or that the update operation requested cannot be completed due to a conflict. + |
+
410 + |
+Gone + |
+The resource requested by the client no longer exists. +This status code indicates that the requested resource has been permanently deleted. + |
+
411 + |
+Length Required + |
+The server refuses to process the request without a defined Content-Length. + |
+
412 + |
+Precondition Failed + |
+The server did not satisfy one of the preconditions set by the requester in the request. + |
+
413 + |
+Request Entity Too Large + |
+The server refused the request because the request was too large. The server may close the connection to prevent the client from continuously sending the request. If the server is only temporarily unable to process the request, a response message with Retry-After will be included. + |
+
414 + |
+Request URI Too Long + |
+The URI requested by the client is too long for the server to process. + |
+
415 + |
+Unsupported Media Type + |
+The server cannot process the media format attached to the request. + |
+
416 + |
+Requested Range Not Satisfiable + |
+The range requested by the client is invalid. + |
+
417 + |
+Expectation Failed + |
+The expectation given in the request's Expect header could not be met. + |
+
422 + |
+Unprocessable Entity + |
+The request format is correct, but cannot be responded to due to semantic errors. + |
+
429 + |
+Too Many Requests + |
+The client has sent more requests than the rate limit allowed within a given amount of time, or the server has received more requests than it is able to process within a given amount of time. In this case, the client should repeat requests after the time specified in the Retry-After header of the response expires. + |
+
500 + |
+Internal Server Error + |
+The server can be accessed by the request, but it cannot understand the user's request. + |
+
501 + |
+Not Implemented + |
+The server does not support the requested function and cannot fulfill the request. + |
+
502 + |
+Bad Gateway + |
+As a gateway or proxy, the server has received an invalid request from a remote server. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +Modify the request directly and do not attempt to retry it. + |
+
504 + |
+Gateway Timeout + |
+The request cannot be fulfilled within the given duration. The client will only receive this response when a timeout parameter is specified for the request. + |
+
505 + |
+HTTP Version Not Supported + |
+The server does not support the requested version of the HTTPS protocol and cannot fulfill the request. + |
+
A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.
+If there are multiple projects, unfold the target region and obtain the project ID from the Project ID column.
+You can obtain a project ID by calling the API used to query project information based on the specified criteria.
+The API for obtaining a project ID is GET https://{iam-endpoint}/v3/projects. {iam-endpoint} indicates the endpoint of IAM, which can be obtained from Endpoint. For details about how to obtain the IAM endpoint, see Authentication.
+The following is an example response. For example, if OCR is deployed in the xxx region, the value of name in the response body is xxx. The value of id in projects is the project ID. If there are multiple projects, unfold the target region and obtain the project ID from the Project ID column.
+{ + "projects": [ + { + "domain_id": "65382450e8f64ac0870cd180d14exxxx", + "is_domain": false, + "parent_id": "65382450e8f64ac0870cd180d14exxxx", + "name": "xxx", // Project name, which is the name of the deployment region. + "description": "", + "links": { + "next": null, + "previous": null, + "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897dxxxx" + }, + "id": "a4a5d4098fb4474fa22cd05f897dxxxx", // Project ID + "enabled": true + } + ], + "links": { + "next": null, + "previous": null, + "self": "https://www.example.com/v3/projects" + } +}+