summaryrefslogtreecommitdiff
path: root/data/en_us/documentparseservice/2026-04-14/api-docs.php
blob: bc618ed16136fb33bd7b824d9db7c2c9b0728f84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php return [
    'version' => '1.0',
    'info' => ['style' => 'RPC', 'product' => 'DocumentParseService', 'version' => '2026-04-14'],
    'directories' => ['DocumentParseOnlineApi'],
    'components' => [
        'schemas' => [],
    ],
    'apis' => [
        'DocumentParseOnlineApi' => [
            'methods' => ['post'],
            'schemes' => ['https'],
            'security' => [
                [
                    'AK' => [],
                ],
            ],
            'operationType' => 'readAndWrite',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'paid', 'tenantRelevance' => 'tenant'],
            'parameters' => [
                [
                    'name' => 'Type',
                    'in' => 'query',
                    'schema' => [
                        'title' => '',
                        'description' => 'Valid values:'."\n"
                            ."\n"
                            .'0: JSON with bounding box and content'."\n"
                            ."\n"
                            .'1: JSON with bounding box only'."\n"
                            ."\n"
                            .'2: Markdown.',
                        'enumValueTitles' => ['JSON with bounding box and content.', 'JSON with bounding box only.', 'markdown'],
                        'type' => 'integer',
                        'format' => 'int64',
                        'example' => '0',
                        'required' => false,
                    ],
                ],
                [
                    'name' => 'ImageUrl',
                    'in' => 'query',
                    'schema' => ['title' => '', 'description' => 'The URL of the document image to be parsed. The URL must be publicly accessible.', 'type' => 'string', 'example' => 'https://maas-multimodal.oss-cn-hangzhou.aliyuncs.com/yuhui%2Ftmp%2Fsample500%2Ftmp%2F01e67f7c18d739a47f09d6c6b4a3d478_35.jpg?OSSAccessKeyId=LTAI5tGFE7dDsowkX8eWZMEe&Expires=1779229955&Signature=8sjYEYUHOsqCV11hC2MN%2Bs%2BguSI%3D', 'required' => false],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'title' => '',
                        'description' => 'The output parameters.',
                        'type' => 'object',
                        'properties' => [
                            'RequestId' => ['title' => '', 'description' => 'The request ID.', 'type' => 'string', 'example' => 'E1AD60F1-BAC7-546B-9533-E7AD02B16E3F'],
                            'Code' => ['title' => '', 'description' => 'The error code. This parameter is not returned if the call is successful.', 'type' => 'string', 'example' => '200'],
                            'Success' => ['title' => '', 'description' => 'Indicates whether the call is successful. Valid values:'."\n"
                                .'- true: The call is successful.'."\n"
                                .'- false: The call failed.', 'type' => 'boolean', 'example' => 'true'],
                            'Message' => ['title' => '', 'description' => 'The error message. This parameter is not returned if the call is successful.', 'type' => 'string', 'example' => 'OK'],
                            'Data' => [
                                'title' => '',
                                'description' => 'The annotation result in JSON format.',
                                'type' => 'object',
                                'properties' => [
                                    'Content' => ['title' => '', 'description' => 'The parsing result.', 'type' => 'string', 'example' => '<img src=\\"images/bbox_1_0_118_158.jpg\\" />\\n\\nSichuan Normal University\\n\\n## ➔ 性质\\n\\n性质一:还原性\\n\\n常温下与氧立即反应生成 $NO_{2}$:\\n\\n$$ 2NO+O_{2}\\\\rightarrow2NO_{2}\\\\ ( 红棕色 ) $$\\n\\n《无机化学》- 氢磷砷\\n\\nCollege of Chemistry & Materials Science'],
                                    'Usage' => [
                                        'title' => '',
                                        'description' => 'The token consumption information for this request.',
                                        'type' => 'object',
                                        'properties' => [
                                            'TotalTokens' => ['title' => '', 'description' => 'The total number of tokens consumed.', 'type' => 'integer', 'format' => 'int32', 'example' => '1753'],
                                            'InputTokens' => ['title' => '', 'description' => 'The number of input tokens.', 'type' => 'integer', 'format' => 'int32', 'example' => '1657'],
                                            'OutputTokens' => ['title' => '', 'description' => 'The number of output tokens.', 'type' => 'integer', 'format' => 'int32', 'example' => '96'],
                                        ],
                                        'example' => '',
                                    ],
                                    'RequestId' => ['title' => '', 'description' => 'The request ID.', 'type' => 'string', 'example' => '604d486c-5cdb-9261-a23b-f2f08149fece'],
                                ],
                                'example' => '',
                            ],
                        ],
                        'example' => '',
                    ],
                ],
            ],
            'errorCodes' => [
                200 => [
                    ['errorCode' => '101', 'errorMessage' => 'IMAGE_SIZE_ERROR.', 'description' => ''],
                    ['errorCode' => '102', 'errorMessage' => 'IMAGE_FILE_SIZE_ERROR.', 'description' => ''],
                    ['errorCode' => '103', 'errorMessage' => 'IMAGE_URL_ERROR.', 'description' => ''],
                    ['errorCode' => '104', 'errorMessage' => 'IMAGE_FORM_ERROR.', 'description' => ''],
                    ['errorCode' => '105', 'errorMessage' => 'IMAGE_BASE64_ERROR.', 'description' => ''],
                    ['errorCode' => '400', 'errorMessage' => 'invalid parameter.', 'description' => ''],
                    ['errorCode' => '402', 'errorMessage' => 'not authorized.', 'description' => ''],
                    ['errorCode' => '429', 'errorMessage' => 'RATE_LIMIT_ERROR.', 'description' => ''],
                    ['errorCode' => '500', 'errorMessage' => 'The service is temporarily unavailable.', 'description' => ''],
                    ['errorCode' => '630', 'errorMessage' => 'INPUT_IMAGE_NUMBER_EXCEED.', 'description' => ''],
                ],
            ],
            'staticInfo' => ['returnType' => 'synchronous'],
            'title' => 'Intelligent document parsing',
            'summary' => 'Extracts text from images in natural reading order and outputs formatted results with support for bounding boxes and content. Output formats include JSON and Markdown.',
            'description' => 'To access this API, visit [https://common-buy.aliyun.com/?commodityCode=agent_documentocr_public_cn](https://common-buy.aliyun.com/?commodityCode=agent_documentocr_public_cn) to activate the service.',
            'requestParamsDescription' => 'None.',
            'changeSet' => [],
            'flowControl' => [
                'flowControlList' => [],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"RequestId\\": \\"E1AD60F1-BAC7-546B-9533-E7AD02B16E3F\\",\\n  \\"Code\\": \\"200\\",\\n  \\"Success\\": true,\\n  \\"Message\\": \\"OK\\",\\n  \\"Data\\": {\\n    \\"Content\\": \\"<img src=\\\\\\\\\\\\\\"images/bbox_1_0_118_158.jpg\\\\\\\\\\\\\\" />\\\\\\\\n\\\\\\\\nSichuan Normal University\\\\\\\\n\\\\\\\\n## ➔ 性质\\\\\\\\n\\\\\\\\n性质一:还原性\\\\\\\\n\\\\\\\\n常温下与氧立即反应生成 $NO_{2}$:\\\\\\\\n\\\\\\\\n$$ 2NO+O_{2}\\\\\\\\\\\\\\\\rightarrow2NO_{2}\\\\\\\\\\\\\\\\ ( 红棕色 ) $$\\\\\\\\n\\\\\\\\n《无机化学》- 氢磷砷\\\\\\\\n\\\\\\\\nCollege of Chemistry & Materials Science\\",\\n    \\"Usage\\": {\\n      \\"TotalTokens\\": 1753,\\n      \\"InputTokens\\": 1657,\\n      \\"OutputTokens\\": 96\\n    },\\n    \\"RequestId\\": \\"604d486c-5cdb-9261-a23b-f2f08149fece\\"\\n  }\\n}","type":"json"}]',
        ],
    ],
    'endpoints' => [
        ['regionId' => 'cn-hangzhou', 'regionName' => 'China (Hangzhou)', 'areaId' => 'asiaPacific', 'areaName' => 'Asia Pacific', 'public' => 'documentparseservice.cn-hangzhou.aliyuncs.com', 'endpoint' => 'documentparseservice.cn-hangzhou.aliyuncs.com', 'vpc' => 'documentparseservice-vpc.cn-hangzhou.aliyuncs.com'],
    ],
    'errorCodes' => [],
    'changeSet' => [],
    'flowControl' => [
        'flowControlList' => [],
    ],
];