cas-parser-node-mcp 1.10.5 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.js +268 -268
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +268 -268
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/local-docs-search.ts +293 -293
- package/src/server.ts +1 -1
package/local-docs-search.mjs
CHANGED
|
@@ -15,28 +15,28 @@ const EMBEDDED_METHODS = [
|
|
|
15
15
|
response: '{ enabled_features?: string[]; is_unlimited?: boolean; limit?: number; remaining?: number; resets_at?: string; used?: number; }',
|
|
16
16
|
markdown: "## check\n\n`client.credits.check(): { enabled_features?: string[]; is_unlimited?: boolean; limit?: number; remaining?: number; resets_at?: string; used?: number; }`\n\n**post** `/v1/credits`\n\nCheck your remaining API credits and usage for the current billing period.\n\nReturns:\n- Number of API calls used and remaining credits\n- Credit limit and reset date\n- List of enabled features for your plan\n\nCredits reset at the start of each billing period.\n\n\n### Returns\n\n- `{ enabled_features?: string[]; is_unlimited?: boolean; limit?: number; remaining?: number; resets_at?: string; used?: number; }`\n\n - `enabled_features?: string[]`\n - `is_unlimited?: boolean`\n - `limit?: number`\n - `remaining?: number`\n - `resets_at?: string`\n - `used?: number`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.credits.check();\n\nconsole.log(response);\n```",
|
|
17
17
|
perLanguage: {
|
|
18
|
-
|
|
19
|
-
method: 'client.
|
|
20
|
-
example:
|
|
18
|
+
typescript: {
|
|
19
|
+
method: 'client.credits.check',
|
|
20
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.credits.check();\n\nconsole.log(response.enabled_features);",
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
python: {
|
|
23
|
+
method: 'credits.check',
|
|
24
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.credits.check()\nprint(response.enabled_features)',
|
|
24
25
|
},
|
|
25
26
|
java: {
|
|
26
27
|
method: 'credits().check',
|
|
27
28
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n CreditCheckResponse response = client.credits().check();\n }\n}',
|
|
28
29
|
},
|
|
30
|
+
go: {
|
|
31
|
+
method: 'client.Credits.Check',
|
|
32
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Credits.Check(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.EnabledFeatures)\n}\n',
|
|
33
|
+
},
|
|
29
34
|
php: {
|
|
30
35
|
method: 'credits->check',
|
|
31
36
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->credits->check();\n\nvar_dump($response);",
|
|
32
37
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.credits.check()\nprint(response.enabled_features)',
|
|
36
|
-
},
|
|
37
|
-
typescript: {
|
|
38
|
-
method: 'client.credits.check',
|
|
39
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.credits.check();\n\nconsole.log(response.enabled_features);",
|
|
38
|
+
http: {
|
|
39
|
+
example: 'curl https://api.casparser.in/v1/credits \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
},
|
|
@@ -52,28 +52,28 @@ const EMBEDDED_METHODS = [
|
|
|
52
52
|
response: '{ count?: number; logs?: { credits?: number; feature?: string; path?: string; request_id?: string; status_code?: number; timestamp?: string; }[]; status?: string; }',
|
|
53
53
|
markdown: "## create\n\n`client.logs.create(end_time?: string, limit?: number, start_time?: string): { count?: number; logs?: object[]; status?: string; }`\n\n**post** `/v1/usage`\n\nRetrieve detailed API usage logs for your account.\n\nReturns a list of API calls with timestamps, features used, status codes, and credits consumed.\nUseful for monitoring usage patterns and debugging.\n\n**Legacy path:** `/logs` (still supported)\n\n\n### Parameters\n\n- `end_time?: string`\n End time filter (ISO 8601). Defaults to now.\n\n- `limit?: number`\n Maximum number of logs to return\n\n- `start_time?: string`\n Start time filter (ISO 8601). Defaults to 30 days ago.\n\n### Returns\n\n- `{ count?: number; logs?: { credits?: number; feature?: string; path?: string; request_id?: string; status_code?: number; timestamp?: string; }[]; status?: string; }`\n\n - `count?: number`\n - `logs?: { credits?: number; feature?: string; path?: string; request_id?: string; status_code?: number; timestamp?: string; }[]`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst log = await client.logs.create();\n\nconsole.log(log);\n```",
|
|
54
54
|
perLanguage: {
|
|
55
|
-
|
|
56
|
-
method: 'client.
|
|
57
|
-
example:
|
|
55
|
+
typescript: {
|
|
56
|
+
method: 'client.logs.create',
|
|
57
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst log = await client.logs.create();\n\nconsole.log(log.count);",
|
|
58
58
|
},
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
python: {
|
|
60
|
+
method: 'logs.create',
|
|
61
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nlog = client.logs.create()\nprint(log.count)',
|
|
61
62
|
},
|
|
62
63
|
java: {
|
|
63
64
|
method: 'logs().create',
|
|
64
65
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.logs.LogCreateParams;\nimport com.cas_parser.api.models.logs.LogCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n LogCreateResponse log = client.logs().create();\n }\n}',
|
|
65
66
|
},
|
|
67
|
+
go: {
|
|
68
|
+
method: 'client.Logs.New',
|
|
69
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tlog, err := client.Logs.New(context.TODO(), casparser.LogNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", log.Count)\n}\n',
|
|
70
|
+
},
|
|
66
71
|
php: {
|
|
67
72
|
method: 'logs->create',
|
|
68
73
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$log = $client->logs->create(\n endTime: new \\DateTimeImmutable('2026-01-31T23:59:59Z'),\n limit: 1,\n startTime: new \\DateTimeImmutable('2026-01-01T00:00:00Z'),\n);\n\nvar_dump($log);",
|
|
69
74
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nlog = client.logs.create()\nprint(log.count)',
|
|
73
|
-
},
|
|
74
|
-
typescript: {
|
|
75
|
-
method: 'client.logs.create',
|
|
76
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst log = await client.logs.create();\n\nconsole.log(log.count);",
|
|
75
|
+
http: {
|
|
76
|
+
example: 'curl https://api.casparser.in/v1/usage \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
},
|
|
@@ -89,28 +89,28 @@ const EMBEDDED_METHODS = [
|
|
|
89
89
|
response: '{ status?: string; summary?: { by_feature?: { credits?: number; feature?: string; requests?: number; }[]; total_credits?: number; total_requests?: number; }; }',
|
|
90
90
|
markdown: "## get_summary\n\n`client.logs.getSummary(end_time?: string, start_time?: string): { status?: string; summary?: object; }`\n\n**post** `/v1/usage/summary`\n\nGet aggregated usage statistics grouped by feature.\n\nUseful for understanding which API features are being used most and tracking usage trends.\n\n**Legacy path:** `/logs/summary` (still supported)\n\n\n### Parameters\n\n- `end_time?: string`\n End time filter (ISO 8601). Defaults to now.\n\n- `start_time?: string`\n Start time filter (ISO 8601). Defaults to start of current month.\n\n### Returns\n\n- `{ status?: string; summary?: { by_feature?: { credits?: number; feature?: string; requests?: number; }[]; total_credits?: number; total_requests?: number; }; }`\n\n - `status?: string`\n - `summary?: { by_feature?: { credits?: number; feature?: string; requests?: number; }[]; total_credits?: number; total_requests?: number; }`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.logs.getSummary();\n\nconsole.log(response);\n```",
|
|
91
91
|
perLanguage: {
|
|
92
|
-
|
|
93
|
-
method: 'client.
|
|
94
|
-
example:
|
|
92
|
+
typescript: {
|
|
93
|
+
method: 'client.logs.getSummary',
|
|
94
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.logs.getSummary();\n\nconsole.log(response.status);",
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
python: {
|
|
97
|
+
method: 'logs.get_summary',
|
|
98
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.logs.get_summary()\nprint(response.status)',
|
|
98
99
|
},
|
|
99
100
|
java: {
|
|
100
101
|
method: 'logs().getSummary',
|
|
101
102
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.logs.LogGetSummaryParams;\nimport com.cas_parser.api.models.logs.LogGetSummaryResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n LogGetSummaryResponse response = client.logs().getSummary();\n }\n}',
|
|
102
103
|
},
|
|
104
|
+
go: {
|
|
105
|
+
method: 'client.Logs.GetSummary',
|
|
106
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Logs.GetSummary(context.TODO(), casparser.LogGetSummaryParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Status)\n}\n',
|
|
107
|
+
},
|
|
103
108
|
php: {
|
|
104
109
|
method: 'logs->getSummary',
|
|
105
110
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->logs->getSummary(\n endTime: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n startTime: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($response);",
|
|
106
111
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.logs.get_summary()\nprint(response.status)',
|
|
110
|
-
},
|
|
111
|
-
typescript: {
|
|
112
|
-
method: 'client.logs.getSummary',
|
|
113
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.logs.getSummary();\n\nconsole.log(response.status);",
|
|
112
|
+
http: {
|
|
113
|
+
example: 'curl https://api.casparser.in/v1/usage/summary \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
},
|
|
@@ -126,28 +126,28 @@ const EMBEDDED_METHODS = [
|
|
|
126
126
|
response: '{ access_token?: string; expires_in?: number; token_type?: string; }',
|
|
127
127
|
markdown: "## create\n\n`client.accessToken.create(expiry_minutes?: number): { access_token?: string; expires_in?: number; token_type?: string; }`\n\n**post** `/v1/token`\n\nGenerate a short-lived access token from your API key.\n\n**Use this endpoint from your backend** to create tokens that can be safely passed to frontend/SDK.\n\n**Legacy path:** `/v1/access-token` (still supported)\n\nAccess tokens:\n- Are prefixed with `at_` for easy identification\n- Valid for up to 60 minutes\n- Can be used in place of API keys on all v4 endpoints\n- Cannot be used to generate other access tokens\n\n\n### Parameters\n\n- `expiry_minutes?: number`\n Token validity in minutes (max 60)\n\n### Returns\n\n- `{ access_token?: string; expires_in?: number; token_type?: string; }`\n\n - `access_token?: string`\n - `expires_in?: number`\n - `token_type?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst accessToken = await client.accessToken.create();\n\nconsole.log(accessToken);\n```",
|
|
128
128
|
perLanguage: {
|
|
129
|
-
|
|
130
|
-
method: 'client.
|
|
131
|
-
example:
|
|
129
|
+
typescript: {
|
|
130
|
+
method: 'client.accessToken.create',
|
|
131
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst accessToken = await client.accessToken.create();\n\nconsole.log(accessToken.access_token);",
|
|
132
132
|
},
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
python: {
|
|
134
|
+
method: 'access_token.create',
|
|
135
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\naccess_token = client.access_token.create()\nprint(access_token.access_token)',
|
|
135
136
|
},
|
|
136
137
|
java: {
|
|
137
138
|
method: 'accessToken().create',
|
|
138
139
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.accesstoken.AccessTokenCreateParams;\nimport com.cas_parser.api.models.accesstoken.AccessTokenCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n AccessTokenCreateResponse accessToken = client.accessToken().create();\n }\n}',
|
|
139
140
|
},
|
|
141
|
+
go: {
|
|
142
|
+
method: 'client.AccessToken.New',
|
|
143
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\taccessToken, err := client.AccessToken.New(context.TODO(), casparser.AccessTokenNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accessToken.AccessToken)\n}\n',
|
|
144
|
+
},
|
|
140
145
|
php: {
|
|
141
146
|
method: 'accessToken->create',
|
|
142
147
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$accessToken = $client->accessToken->create(expiryMinutes: 60);\n\nvar_dump($accessToken);",
|
|
143
148
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\naccess_token = client.access_token.create()\nprint(access_token.access_token)',
|
|
147
|
-
},
|
|
148
|
-
typescript: {
|
|
149
|
-
method: 'client.accessToken.create',
|
|
150
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst accessToken = await client.accessToken.create();\n\nconsole.log(accessToken.access_token);",
|
|
149
|
+
http: {
|
|
150
|
+
example: 'curl https://api.casparser.in/v1/token \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
151
151
|
},
|
|
152
152
|
},
|
|
153
153
|
},
|
|
@@ -162,28 +162,28 @@ const EMBEDDED_METHODS = [
|
|
|
162
162
|
response: '{ error?: string; masked_api_key?: string; valid?: boolean; }',
|
|
163
163
|
markdown: "## verify\n\n`client.verifyToken.verify(): { error?: string; masked_api_key?: string; valid?: boolean; }`\n\n**post** `/v1/token/verify`\n\nVerify an access token and check if it's still valid.\nUseful for debugging token issues.\n\n\n### Returns\n\n- `{ error?: string; masked_api_key?: string; valid?: boolean; }`\n\n - `error?: string`\n - `masked_api_key?: string`\n - `valid?: boolean`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.verifyToken.verify();\n\nconsole.log(response);\n```",
|
|
164
164
|
perLanguage: {
|
|
165
|
-
|
|
166
|
-
method: 'client.
|
|
167
|
-
example:
|
|
165
|
+
typescript: {
|
|
166
|
+
method: 'client.verifyToken.verify',
|
|
167
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.verifyToken.verify();\n\nconsole.log(response.valid);",
|
|
168
168
|
},
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
python: {
|
|
170
|
+
method: 'verify_token.verify',
|
|
171
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.verify_token.verify()\nprint(response.valid)',
|
|
171
172
|
},
|
|
172
173
|
java: {
|
|
173
174
|
method: 'verifyToken().verify',
|
|
174
175
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.verifytoken.VerifyTokenVerifyParams;\nimport com.cas_parser.api.models.verifytoken.VerifyTokenVerifyResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n VerifyTokenVerifyResponse response = client.verifyToken().verify();\n }\n}',
|
|
175
176
|
},
|
|
177
|
+
go: {
|
|
178
|
+
method: 'client.VerifyToken.Verify',
|
|
179
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.VerifyToken.Verify(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Valid)\n}\n',
|
|
180
|
+
},
|
|
176
181
|
php: {
|
|
177
182
|
method: 'verifyToken->verify',
|
|
178
183
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->verifyToken->verify();\n\nvar_dump($response);",
|
|
179
184
|
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.verify_token.verify()\nprint(response.valid)',
|
|
183
|
-
},
|
|
184
|
-
typescript: {
|
|
185
|
-
method: 'client.verifyToken.verify',
|
|
186
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.verifyToken.verify();\n\nconsole.log(response.valid);",
|
|
185
|
+
http: {
|
|
186
|
+
example: 'curl https://api.casparser.in/v1/token/verify \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
187
187
|
},
|
|
188
188
|
},
|
|
189
189
|
},
|
|
@@ -199,28 +199,28 @@ const EMBEDDED_METHODS = [
|
|
|
199
199
|
response: "{ demat_accounts?: { additional_info?: object; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: object; linked_holders?: linked_holder[]; value?: number; }[]; insurance?: { life_insurance_policies?: object[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: object; }; mutual_funds?: { additional_info?: object; amc?: string; folio_number?: string; linked_holders?: linked_holder[]; registrar?: string; schemes?: object[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: object[]; linked_holders?: linked_holder[]; pran?: string; value?: number; }[]; summary?: { accounts?: object; total_value?: number; }; }",
|
|
200
200
|
markdown: "## parse\n\n`client.camsKfintech.parse(password?: string, pdf_file?: string, pdf_url?: string): { demat_accounts?: object[]; insurance?: object; investor?: object; meta?: object; mutual_funds?: object[]; nps?: object[]; summary?: object; }`\n\n**post** `/v4/cams_kfintech/parse`\n\nThis endpoint specifically parses CAMS/KFintech CAS (Consolidated Account Statement) PDF files and returns data in a unified format.\nUse this endpoint when you know the PDF is from CAMS or KFintech.\n\n\n### Parameters\n\n- `password?: string`\n Password for the PDF file (if required)\n\n- `pdf_file?: string`\n Base64 encoded CAS PDF file (required if pdf_url not provided)\n\n- `pdf_url?: string`\n URL to the CAS PDF file (required if pdf_file not provided)\n\n### Returns\n\n- `{ demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: object[]; corporate_bonds?: object[]; demat_mutual_funds?: object[]; equities?: object[]; government_securities?: object[]; }; linked_holders?: object[]; value?: number; }[]; insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }; mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: object[]; registrar?: string; schemes?: { additional_info?: object; cost?: number; gain?: object; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: transaction[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: object; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: object[]; pran?: string; value?: number; }[]; summary?: { accounts?: { demat?: object; insurance?: object; mutual_funds?: object; nps?: object; }; total_value?: number; }; }`\n\n - `demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; corporate_bonds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; demat_mutual_funds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; equities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; government_securities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; }; linked_holders?: { name?: string; pan?: string; }[]; value?: number; }[]`\n - `insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }`\n - `investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }`\n - `meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }`\n - `mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: { name?: string; pan?: string; }[]; registrar?: string; schemes?: { additional_info?: { advisor?: string; amfi?: string; close_units?: number; open_units?: number; rta_code?: string; }; cost?: number; gain?: { absolute?: number; percentage?: number; }; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: { additional_info?: object; amount?: number; balance?: number; date?: string; description?: string; dividend_rate?: number; nav?: number; type?: string; units?: number; }[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]`\n - `nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: { manager?: string; tier?: 1 | 2; }; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: { name?: string; pan?: string; }[]; pran?: string; value?: number; }[]`\n - `summary?: { accounts?: { demat?: { count?: number; total_value?: number; }; insurance?: { count?: number; total_value?: number; }; mutual_funds?: { count?: number; total_value?: number; }; nps?: { count?: number; total_value?: number; }; }; total_value?: number; }`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst unifiedResponse = await client.camsKfintech.parse();\n\nconsole.log(unifiedResponse);\n```",
|
|
201
201
|
perLanguage: {
|
|
202
|
-
|
|
203
|
-
method: 'client.
|
|
204
|
-
example:
|
|
202
|
+
typescript: {
|
|
203
|
+
method: 'client.camsKfintech.parse',
|
|
204
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.camsKfintech.parse();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
205
205
|
},
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
python: {
|
|
207
|
+
method: 'cams_kfintech.parse',
|
|
208
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.cams_kfintech.parse()\nprint(unified_response.demat_accounts)',
|
|
208
209
|
},
|
|
209
210
|
java: {
|
|
210
211
|
method: 'camsKfintech().parse',
|
|
211
212
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;\nimport com.cas_parser.api.models.camskfintech.UnifiedResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n UnifiedResponse unifiedResponse = client.camsKfintech().parse();\n }\n}',
|
|
212
213
|
},
|
|
214
|
+
go: {
|
|
215
|
+
method: 'client.CamsKfintech.Parse',
|
|
216
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tunifiedResponse, err := client.CamsKfintech.Parse(context.TODO(), casparser.CamsKfintechParseParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unifiedResponse.DematAccounts)\n}\n',
|
|
217
|
+
},
|
|
213
218
|
php: {
|
|
214
219
|
method: 'camsKfintech->parse',
|
|
215
220
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$unifiedResponse = $client->camsKfintech->parse(\n password: 'password', pdfFile: 'pdf_file', pdfURL: 'https://example.com'\n);\n\nvar_dump($unifiedResponse);",
|
|
216
221
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.cams_kfintech.parse()\nprint(unified_response.demat_accounts)',
|
|
220
|
-
},
|
|
221
|
-
typescript: {
|
|
222
|
-
method: 'client.camsKfintech.parse',
|
|
223
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.camsKfintech.parse();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
222
|
+
http: {
|
|
223
|
+
example: "curl https://api.casparser.in/v4/cams_kfintech/parse \\\n -H 'Content-Type: application/json' \\\n -H \"x-api-key: $CAS_PARSER_API_KEY\" \\\n -d '{}'",
|
|
224
224
|
},
|
|
225
225
|
},
|
|
226
226
|
},
|
|
@@ -236,28 +236,28 @@ const EMBEDDED_METHODS = [
|
|
|
236
236
|
response: "{ demat_accounts?: { additional_info?: object; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: object; linked_holders?: linked_holder[]; value?: number; }[]; insurance?: { life_insurance_policies?: object[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: object; }; mutual_funds?: { additional_info?: object; amc?: string; folio_number?: string; linked_holders?: linked_holder[]; registrar?: string; schemes?: object[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: object[]; linked_holders?: linked_holder[]; pran?: string; value?: number; }[]; summary?: { accounts?: object; total_value?: number; }; }",
|
|
237
237
|
markdown: "## parse_pdf\n\n`client.cdsl.parsePdf(password?: string, pdf_file?: string, pdf_url?: string): { demat_accounts?: object[]; insurance?: object; investor?: object; meta?: object; mutual_funds?: object[]; nps?: object[]; summary?: object; }`\n\n**post** `/v4/cdsl/parse`\n\nThis endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.\nUse this endpoint when you know the PDF is from CDSL.\n\n\n### Parameters\n\n- `password?: string`\n Password for the PDF file (if required)\n\n- `pdf_file?: string`\n Base64 encoded CAS PDF file (required if pdf_url not provided)\n\n- `pdf_url?: string`\n URL to the CAS PDF file (required if pdf_file not provided)\n\n### Returns\n\n- `{ demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: object[]; corporate_bonds?: object[]; demat_mutual_funds?: object[]; equities?: object[]; government_securities?: object[]; }; linked_holders?: object[]; value?: number; }[]; insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }; mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: object[]; registrar?: string; schemes?: { additional_info?: object; cost?: number; gain?: object; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: transaction[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: object; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: object[]; pran?: string; value?: number; }[]; summary?: { accounts?: { demat?: object; insurance?: object; mutual_funds?: object; nps?: object; }; total_value?: number; }; }`\n\n - `demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; corporate_bonds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; demat_mutual_funds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; equities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; government_securities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; }; linked_holders?: { name?: string; pan?: string; }[]; value?: number; }[]`\n - `insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }`\n - `investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }`\n - `meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }`\n - `mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: { name?: string; pan?: string; }[]; registrar?: string; schemes?: { additional_info?: { advisor?: string; amfi?: string; close_units?: number; open_units?: number; rta_code?: string; }; cost?: number; gain?: { absolute?: number; percentage?: number; }; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: { additional_info?: object; amount?: number; balance?: number; date?: string; description?: string; dividend_rate?: number; nav?: number; type?: string; units?: number; }[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]`\n - `nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: { manager?: string; tier?: 1 | 2; }; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: { name?: string; pan?: string; }[]; pran?: string; value?: number; }[]`\n - `summary?: { accounts?: { demat?: { count?: number; total_value?: number; }; insurance?: { count?: number; total_value?: number; }; mutual_funds?: { count?: number; total_value?: number; }; nps?: { count?: number; total_value?: number; }; }; total_value?: number; }`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst unifiedResponse = await client.cdsl.parsePdf();\n\nconsole.log(unifiedResponse);\n```",
|
|
238
238
|
perLanguage: {
|
|
239
|
-
|
|
240
|
-
method: 'client.
|
|
241
|
-
example:
|
|
239
|
+
typescript: {
|
|
240
|
+
method: 'client.cdsl.parsePdf',
|
|
241
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.cdsl.parsePdf();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
242
242
|
},
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
python: {
|
|
244
|
+
method: 'cdsl.parse_pdf',
|
|
245
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.cdsl.parse_pdf()\nprint(unified_response.demat_accounts)',
|
|
245
246
|
},
|
|
246
247
|
java: {
|
|
247
248
|
method: 'cdsl().parsePdf',
|
|
248
249
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.camskfintech.UnifiedResponse;\nimport com.cas_parser.api.models.cdsl.CdslParsePdfParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n UnifiedResponse unifiedResponse = client.cdsl().parsePdf();\n }\n}',
|
|
249
250
|
},
|
|
251
|
+
go: {
|
|
252
|
+
method: 'client.Cdsl.ParsePdf',
|
|
253
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tunifiedResponse, err := client.Cdsl.ParsePdf(context.TODO(), casparser.CdslParsePdfParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unifiedResponse.DematAccounts)\n}\n',
|
|
254
|
+
},
|
|
250
255
|
php: {
|
|
251
256
|
method: 'cdsl->parsePdf',
|
|
252
257
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$unifiedResponse = $client->cdsl->parsePdf(\n password: 'password', pdfFile: 'pdf_file', pdfURL: 'https://example.com'\n);\n\nvar_dump($unifiedResponse);",
|
|
253
258
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.cdsl.parse_pdf()\nprint(unified_response.demat_accounts)',
|
|
257
|
-
},
|
|
258
|
-
typescript: {
|
|
259
|
-
method: 'client.cdsl.parsePdf',
|
|
260
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.cdsl.parsePdf();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
259
|
+
http: {
|
|
260
|
+
example: "curl https://api.casparser.in/v4/cdsl/parse \\\n -H 'Content-Type: application/json' \\\n -H \"x-api-key: $CAS_PARSER_API_KEY\" \\\n -d '{}'",
|
|
261
261
|
},
|
|
262
262
|
},
|
|
263
263
|
},
|
|
@@ -273,28 +273,28 @@ const EMBEDDED_METHODS = [
|
|
|
273
273
|
response: '{ msg?: string; session_id?: string; status?: string; }',
|
|
274
274
|
markdown: "## request_otp\n\n`client.cdsl.fetch.requestOtp(bo_id: string, dob: string, pan: string): { msg?: string; session_id?: string; status?: string; }`\n\n**post** `/v4/cdsl/fetch`\n\n**Step 1 of 2**: Request OTP for CDSL CAS fetch.\n\nThis endpoint:\n1. Solves reCAPTCHA automatically (~15-20 seconds)\n2. Submits login credentials to CDSL portal\n3. Triggers OTP to user's registered mobile number\n\nAfter user receives OTP, call `/v4/cdsl/fetch/{session_id}/verify` to complete.\n\n\n### Parameters\n\n- `bo_id: string`\n CDSL BO ID (16 digits)\n\n- `dob: string`\n Date of birth (YYYY-MM-DD)\n\n- `pan: string`\n PAN number\n\n### Returns\n\n- `{ msg?: string; session_id?: string; status?: string; }`\n\n - `msg?: string`\n - `session_id?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.cdsl.fetch.requestOtp({\n bo_id: '1234567890123456',\n dob: '1990-01-15',\n pan: 'ABCDE1234F',\n});\n\nconsole.log(response);\n```",
|
|
275
275
|
perLanguage: {
|
|
276
|
-
|
|
277
|
-
method: 'client.
|
|
278
|
-
example:
|
|
276
|
+
typescript: {
|
|
277
|
+
method: 'client.cdsl.fetch.requestOtp',
|
|
278
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cdsl.fetch.requestOtp({\n bo_id: '1234567890123456',\n dob: '1990-01-15',\n pan: 'ABCDE1234F',\n});\n\nconsole.log(response.session_id);",
|
|
279
279
|
},
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
python: {
|
|
281
|
+
method: 'cdsl.fetch.request_otp',
|
|
282
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cdsl.fetch.request_otp(\n bo_id="1234567890123456",\n dob="1990-01-15",\n pan="ABCDE1234F",\n)\nprint(response.session_id)',
|
|
282
283
|
},
|
|
283
284
|
java: {
|
|
284
285
|
method: 'cdsl().fetch().requestOtp',
|
|
285
286
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpParams;\nimport com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n FetchRequestOtpParams params = FetchRequestOtpParams.builder()\n .boId("1234567890123456")\n .dob("1990-01-15")\n .pan("ABCDE1234F")\n .build();\n FetchRequestOtpResponse response = client.cdsl().fetch().requestOtp(params);\n }\n}',
|
|
286
287
|
},
|
|
288
|
+
go: {
|
|
289
|
+
method: 'client.Cdsl.Fetch.RequestOtp',
|
|
290
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Cdsl.Fetch.RequestOtp(context.TODO(), casparser.CdslFetchRequestOtpParams{\n\t\tBoID: "1234567890123456",\n\t\tDob: "1990-01-15",\n\t\tPan: "ABCDE1234F",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n',
|
|
291
|
+
},
|
|
287
292
|
php: {
|
|
288
293
|
method: 'cdsl->fetch->requestOtp',
|
|
289
294
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->cdsl->fetch->requestOtp(\n boID: '1234567890123456', dob: '1990-01-15', pan: 'ABCDE1234F'\n);\n\nvar_dump($response);",
|
|
290
295
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cdsl.fetch.request_otp(\n bo_id="1234567890123456",\n dob="1990-01-15",\n pan="ABCDE1234F",\n)\nprint(response.session_id)',
|
|
294
|
-
},
|
|
295
|
-
typescript: {
|
|
296
|
-
method: 'client.cdsl.fetch.requestOtp',
|
|
297
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cdsl.fetch.requestOtp({\n bo_id: '1234567890123456',\n dob: '1990-01-15',\n pan: 'ABCDE1234F',\n});\n\nconsole.log(response.session_id);",
|
|
296
|
+
http: {
|
|
297
|
+
example: 'curl https://api.casparser.in/v4/cdsl/fetch \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "bo_id": "1234567890123456",\n "dob": "1990-01-15",\n "pan": "ABCDE1234F"\n }\'',
|
|
298
298
|
},
|
|
299
299
|
},
|
|
300
300
|
},
|
|
@@ -310,28 +310,28 @@ const EMBEDDED_METHODS = [
|
|
|
310
310
|
response: '{ files?: { filename?: string; url?: string; }[]; msg?: string; status?: string; }',
|
|
311
311
|
markdown: "## verify_otp\n\n`client.cdsl.fetch.verifyOtp(session_id: string, otp: string, num_periods?: number): { files?: object[]; msg?: string; status?: string; }`\n\n**post** `/v4/cdsl/fetch/{session_id}/verify`\n\n**Step 2 of 2**: Verify OTP and retrieve CDSL CAS files.\n\nAfter successful verification, CAS PDFs are fetched from CDSL portal,\nuploaded to cloud storage, and returned as direct download URLs.\n\n\n### Parameters\n\n- `session_id: string`\n\n- `otp: string`\n OTP received on mobile\n\n- `num_periods?: number`\n Number of monthly statements to fetch (default 6)\n\n### Returns\n\n- `{ files?: { filename?: string; url?: string; }[]; msg?: string; status?: string; }`\n\n - `files?: { filename?: string; url?: string; }[]`\n - `msg?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.cdsl.fetch.verifyOtp('session_id', { otp: '123456' });\n\nconsole.log(response);\n```",
|
|
312
312
|
perLanguage: {
|
|
313
|
-
|
|
314
|
-
method: 'client.
|
|
315
|
-
example:
|
|
313
|
+
typescript: {
|
|
314
|
+
method: 'client.cdsl.fetch.verifyOtp',
|
|
315
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cdsl.fetch.verifyOtp('session_id', { otp: '123456' });\n\nconsole.log(response.files);",
|
|
316
316
|
},
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
python: {
|
|
318
|
+
method: 'cdsl.fetch.verify_otp',
|
|
319
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cdsl.fetch.verify_otp(\n session_id="session_id",\n otp="123456",\n)\nprint(response.files)',
|
|
319
320
|
},
|
|
320
321
|
java: {
|
|
321
322
|
method: 'cdsl().fetch().verifyOtp',
|
|
322
323
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.cdsl.fetch.FetchVerifyOtpParams;\nimport com.cas_parser.api.models.cdsl.fetch.FetchVerifyOtpResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n FetchVerifyOtpParams params = FetchVerifyOtpParams.builder()\n .sessionId("session_id")\n .otp("123456")\n .build();\n FetchVerifyOtpResponse response = client.cdsl().fetch().verifyOtp(params);\n }\n}',
|
|
323
324
|
},
|
|
325
|
+
go: {
|
|
326
|
+
method: 'client.Cdsl.Fetch.VerifyOtp',
|
|
327
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Cdsl.Fetch.VerifyOtp(\n\t\tcontext.TODO(),\n\t\t"session_id",\n\t\tcasparser.CdslFetchVerifyOtpParams{\n\t\t\tOtp: "123456",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Files)\n}\n',
|
|
328
|
+
},
|
|
324
329
|
php: {
|
|
325
330
|
method: 'cdsl->fetch->verifyOtp',
|
|
326
331
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->cdsl->fetch->verifyOtp(\n 'session_id', otp: '123456', numPeriods: 6\n);\n\nvar_dump($response);",
|
|
327
332
|
},
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cdsl.fetch.verify_otp(\n session_id="session_id",\n otp="123456",\n)\nprint(response.files)',
|
|
331
|
-
},
|
|
332
|
-
typescript: {
|
|
333
|
-
method: 'client.cdsl.fetch.verifyOtp',
|
|
334
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cdsl.fetch.verifyOtp('session_id', { otp: '123456' });\n\nconsole.log(response.files);",
|
|
333
|
+
http: {
|
|
334
|
+
example: 'curl https://api.casparser.in/v4/cdsl/fetch/$SESSION_ID/verify \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "otp": "123456",\n "num_periods": 6\n }\'',
|
|
335
335
|
},
|
|
336
336
|
},
|
|
337
337
|
},
|
|
@@ -352,28 +352,28 @@ const EMBEDDED_METHODS = [
|
|
|
352
352
|
response: '{ data?: { broker_info?: object; charges_summary?: object; client_info?: object; contract_note_info?: object; derivatives_transactions?: object[]; detailed_trades?: object[]; equity_transactions?: object[]; }; msg?: string; status?: string; }',
|
|
353
353
|
markdown: "## parse\n\n`client.contractNote.parse(broker_type?: 'zerodha' | 'groww' | 'upstox' | 'icici', password?: string, pdf_file?: string, pdf_url?: string): { data?: object; msg?: string; status?: string; }`\n\n**post** `/v4/contract_note/parse`\n\nThis endpoint parses Contract Note PDF files from various brokers including Zerodha, Groww, Upstox, ICICI Securities, and others.\n\n**What is a Contract Note?**\nA contract note is a legal document that provides details of all trades executed by an investor. It includes:\n- Trade details with timestamps, quantities, and prices\n- Brokerage and charges breakdown\n- Settlement information\n- Regulatory compliance details\n\n**Supported Brokers:**\n- Zerodha Broking Limited\n- Groww Invest Tech Private Limited \n- Upstox (RKSV Securities)\n- ICICI Securities Limited\n- Auto-detection for unknown brokers\n\n**Key Features:**\n- **Auto-detection**: Automatically identifies broker type from PDF content\n- **Comprehensive parsing**: Extracts equity transactions, derivatives transactions, detailed trades, and charges\n- **Flexible input**: Accepts both file upload and URL-based PDF input\n- **Password protection**: Supports password-protected PDFs\n\nThe API returns structured data including contract note information, client details, transaction summaries, and detailed trade-by-trade breakdowns.\n\n\n### Parameters\n\n- `broker_type?: 'zerodha' | 'groww' | 'upstox' | 'icici'`\n Optional broker type override. If not provided, system will auto-detect.\n\n- `password?: string`\n Password for the PDF file (usually PAN number for Zerodha)\n\n- `pdf_file?: string`\n Base64 encoded contract note PDF file\n\n- `pdf_url?: string`\n URL to the contract note PDF file\n\n### Returns\n\n- `{ data?: { broker_info?: { broker_type?: 'zerodha' | 'groww' | 'upstox' | 'icici' | 'unknown'; name?: string; sebi_registration?: string; }; charges_summary?: { cgst?: number; exchange_transaction_charges?: number; igst?: number; net_amount_receivable_payable?: number; pay_in_pay_out_obligation?: number; sebi_turnover_fees?: number; securities_transaction_tax?: number; sgst?: number; stamp_duty?: number; taxable_value_brokerage?: number; }; client_info?: { address?: string; gst_state_code?: string; name?: string; pan?: string; place_of_supply?: string; ucc?: string; }; contract_note_info?: { contract_note_number?: string; settlement_date?: string; settlement_number?: string; trade_date?: string; }; derivatives_transactions?: { brokerage_per_unit?: number; buy_sell_bf_cf?: string; closing_rate_per_unit?: number; contract_description?: string; net_total?: number; quantity?: number; wap_per_unit?: number; }[]; detailed_trades?: { brokerage?: number; buy_sell?: string; closing_rate_per_unit?: number; exchange?: string; net_rate_per_unit?: number; net_total?: number; order_number?: string; order_time?: string; quantity?: number; remarks?: string; security_description?: string; trade_number?: string; trade_time?: string; }[]; equity_transactions?: { buy_quantity?: number; buy_total_value?: number; buy_wap?: number; isin?: string; net_obligation?: number; security_name?: string; security_symbol?: string; sell_quantity?: number; sell_total_value?: number; sell_wap?: number; }[]; }; msg?: string; status?: string; }`\n\n - `data?: { broker_info?: { broker_type?: 'zerodha' | 'groww' | 'upstox' | 'icici' | 'unknown'; name?: string; sebi_registration?: string; }; charges_summary?: { cgst?: number; exchange_transaction_charges?: number; igst?: number; net_amount_receivable_payable?: number; pay_in_pay_out_obligation?: number; sebi_turnover_fees?: number; securities_transaction_tax?: number; sgst?: number; stamp_duty?: number; taxable_value_brokerage?: number; }; client_info?: { address?: string; gst_state_code?: string; name?: string; pan?: string; place_of_supply?: string; ucc?: string; }; contract_note_info?: { contract_note_number?: string; settlement_date?: string; settlement_number?: string; trade_date?: string; }; derivatives_transactions?: { brokerage_per_unit?: number; buy_sell_bf_cf?: string; closing_rate_per_unit?: number; contract_description?: string; net_total?: number; quantity?: number; wap_per_unit?: number; }[]; detailed_trades?: { brokerage?: number; buy_sell?: string; closing_rate_per_unit?: number; exchange?: string; net_rate_per_unit?: number; net_total?: number; order_number?: string; order_time?: string; quantity?: number; remarks?: string; security_description?: string; trade_number?: string; trade_time?: string; }[]; equity_transactions?: { buy_quantity?: number; buy_total_value?: number; buy_wap?: number; isin?: string; net_obligation?: number; security_name?: string; security_symbol?: string; sell_quantity?: number; sell_total_value?: number; sell_wap?: number; }[]; }`\n - `msg?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.contractNote.parse();\n\nconsole.log(response);\n```",
|
|
354
354
|
perLanguage: {
|
|
355
|
-
|
|
356
|
-
method: 'client.
|
|
357
|
-
example:
|
|
355
|
+
typescript: {
|
|
356
|
+
method: 'client.contractNote.parse',
|
|
357
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contractNote.parse();\n\nconsole.log(response.data);",
|
|
358
358
|
},
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
python: {
|
|
360
|
+
method: 'contract_note.parse',
|
|
361
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.contract_note.parse()\nprint(response.data)',
|
|
361
362
|
},
|
|
362
363
|
java: {
|
|
363
364
|
method: 'contractNote().parse',
|
|
364
365
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.contractnote.ContractNoteParseParams;\nimport com.cas_parser.api.models.contractnote.ContractNoteParseResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n ContractNoteParseResponse response = client.contractNote().parse();\n }\n}',
|
|
365
366
|
},
|
|
367
|
+
go: {
|
|
368
|
+
method: 'client.ContractNote.Parse',
|
|
369
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.ContractNote.Parse(context.TODO(), casparser.ContractNoteParseParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
|
|
370
|
+
},
|
|
366
371
|
php: {
|
|
367
372
|
method: 'contractNote->parse',
|
|
368
373
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->contractNote->parse(\n brokerType: 'zerodha',\n password: 'FAXAK2545F',\n pdfFile: 'JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...',\n pdfURL: 'https://example.com/contract_note.pdf',\n);\n\nvar_dump($response);",
|
|
369
374
|
},
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.contract_note.parse()\nprint(response.data)',
|
|
373
|
-
},
|
|
374
|
-
typescript: {
|
|
375
|
-
method: 'client.contractNote.parse',
|
|
376
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.contractNote.parse();\n\nconsole.log(response.data);",
|
|
375
|
+
http: {
|
|
376
|
+
example: 'curl https://api.casparser.in/v4/contract_note/parse \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "broker_type": "zerodha",\n "password": "FAXAK2545F",\n "pdf_file": "JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwo...",\n "pdf_url": "https://example.com/contract_note.pdf"\n }\'',
|
|
377
377
|
},
|
|
378
378
|
},
|
|
379
379
|
},
|
|
@@ -394,28 +394,28 @@ const EMBEDDED_METHODS = [
|
|
|
394
394
|
response: "{ count?: number; files?: { cas_type?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'; expires_in?: number; filename?: string; message_date?: string; message_id?: string; original_filename?: string; sender_email?: string; size?: number; url?: string; }[]; status?: string; }",
|
|
395
395
|
markdown: "## list_cas_files\n\n`client.inbox.listCasFiles(x-inbox-token: string, cas_types?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[], end_date?: string, start_date?: string): { count?: number; files?: object[]; status?: string; }`\n\n**post** `/v4/inbox/cas`\n\nSearch the user's email inbox for CAS files from known senders\n(CAMS, KFintech, CDSL, NSDL).\n\nFiles are uploaded to temporary cloud storage. **URLs expire in 24 hours.**\n\nOptionally filter by CAS provider and date range.\n\n**Billing:** 0.2 credits per request (charged regardless of success or number of files found).\n\n\n### Parameters\n\n- `x-inbox-token: string`\n\n- `cas_types?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n Filter by CAS provider(s):\n- `cdsl` → eCAS@cdslstatement.com\n- `nsdl` → NSDL-CAS@nsdl.co.in\n- `cams` → donotreply@camsonline.com\n- `kfintech` → samfS@kfintech.com\n\n\n- `end_date?: string`\n End date in ISO format (YYYY-MM-DD). Defaults to today.\n\n- `start_date?: string`\n Start date in ISO format (YYYY-MM-DD). Defaults to 30 days ago.\n\n### Returns\n\n- `{ count?: number; files?: { cas_type?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'; expires_in?: number; filename?: string; message_date?: string; message_id?: string; original_filename?: string; sender_email?: string; size?: number; url?: string; }[]; status?: string; }`\n\n - `count?: number`\n - `files?: { cas_type?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'; expires_in?: number; filename?: string; message_date?: string; message_id?: string; original_filename?: string; sender_email?: string; size?: number; url?: string; }[]`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.listCasFiles({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response);\n```",
|
|
396
396
|
perLanguage: {
|
|
397
|
-
|
|
398
|
-
method: 'client.
|
|
399
|
-
example:
|
|
397
|
+
typescript: {
|
|
398
|
+
method: 'client.inbox.listCasFiles',
|
|
399
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.listCasFiles({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.count);",
|
|
400
400
|
},
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
python: {
|
|
402
|
+
method: 'inbox.list_cas_files',
|
|
403
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.list_cas_files(\n x_inbox_token="x-inbox-token",\n)\nprint(response.count)',
|
|
403
404
|
},
|
|
404
405
|
java: {
|
|
405
406
|
method: 'inbox().listCasFiles',
|
|
406
407
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inbox.InboxListCasFilesParams;\nimport com.cas_parser.api.models.inbox.InboxListCasFilesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboxListCasFilesParams params = InboxListCasFilesParams.builder()\n .xInboxToken("x-inbox-token")\n .build();\n InboxListCasFilesResponse response = client.inbox().listCasFiles(params);\n }\n}',
|
|
407
408
|
},
|
|
409
|
+
go: {
|
|
410
|
+
method: 'client.Inbox.ListCasFiles',
|
|
411
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.ListCasFiles(context.TODO(), casparser.InboxListCasFilesParams{\n\t\tXInboxToken: "x-inbox-token",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Count)\n}\n',
|
|
412
|
+
},
|
|
408
413
|
php: {
|
|
409
414
|
method: 'inbox->listCasFiles',
|
|
410
415
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->inbox->listCasFiles(\n xInboxToken: 'x-inbox-token',\n casTypes: ['cdsl', 'nsdl'],\n endDate: '2025-12-31',\n startDate: '2025-12-01',\n);\n\nvar_dump($response);",
|
|
411
416
|
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.list_cas_files(\n x_inbox_token="x-inbox-token",\n)\nprint(response.count)',
|
|
415
|
-
},
|
|
416
|
-
typescript: {
|
|
417
|
-
method: 'client.inbox.listCasFiles',
|
|
418
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.listCasFiles({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.count);",
|
|
417
|
+
http: {
|
|
418
|
+
example: 'curl https://api.casparser.in/v4/inbox/cas \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
419
419
|
},
|
|
420
420
|
},
|
|
421
421
|
},
|
|
@@ -431,28 +431,28 @@ const EMBEDDED_METHODS = [
|
|
|
431
431
|
response: '{ expires_in?: number; oauth_url?: string; status?: string; }',
|
|
432
432
|
markdown: "## connect_email\n\n`client.inbox.connectEmail(redirect_uri: string, state?: string): { expires_in?: number; oauth_url?: string; status?: string; }`\n\n**post** `/v4/inbox/connect`\n\nInitiate OAuth flow to connect user's email inbox.\n\nReturns an `oauth_url` that you should redirect the user to. After authorization,\nthey are redirected back to your `redirect_uri` with the following query parameters:\n\n**On success:**\n- `inbox_token` - Encrypted token to store client-side\n- `email` - Email address of the connected account\n- `state` - Your original state parameter (for CSRF verification)\n\n**On error:**\n- `error` - Error code (e.g., `access_denied`, `token_exchange_failed`)\n- `state` - Your original state parameter\n\n**Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.\n\n\n### Parameters\n\n- `redirect_uri: string`\n Your callback URL to receive the inbox_token (must be http or https)\n\n- `state?: string`\n State parameter for CSRF protection (returned in redirect)\n\n### Returns\n\n- `{ expires_in?: number; oauth_url?: string; status?: string; }`\n\n - `expires_in?: number`\n - `oauth_url?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.connectEmail({ redirect_uri: 'https://yourapp.com/oauth-callback' });\n\nconsole.log(response);\n```",
|
|
433
433
|
perLanguage: {
|
|
434
|
-
|
|
435
|
-
method: 'client.
|
|
436
|
-
example:
|
|
434
|
+
typescript: {
|
|
435
|
+
method: 'client.inbox.connectEmail',
|
|
436
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.connectEmail({\n redirect_uri: 'https://yourapp.com/oauth-callback',\n});\n\nconsole.log(response.expires_in);",
|
|
437
437
|
},
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
python: {
|
|
439
|
+
method: 'inbox.connect_email',
|
|
440
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.connect_email(\n redirect_uri="https://yourapp.com/oauth-callback",\n)\nprint(response.expires_in)',
|
|
440
441
|
},
|
|
441
442
|
java: {
|
|
442
443
|
method: 'inbox().connectEmail',
|
|
443
444
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inbox.InboxConnectEmailParams;\nimport com.cas_parser.api.models.inbox.InboxConnectEmailResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboxConnectEmailParams params = InboxConnectEmailParams.builder()\n .redirectUri("https://yourapp.com/oauth-callback")\n .build();\n InboxConnectEmailResponse response = client.inbox().connectEmail(params);\n }\n}',
|
|
444
445
|
},
|
|
446
|
+
go: {
|
|
447
|
+
method: 'client.Inbox.ConnectEmail',
|
|
448
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.ConnectEmail(context.TODO(), casparser.InboxConnectEmailParams{\n\t\tRedirectUri: "https://yourapp.com/oauth-callback",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ExpiresIn)\n}\n',
|
|
449
|
+
},
|
|
445
450
|
php: {
|
|
446
451
|
method: 'inbox->connectEmail',
|
|
447
452
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->inbox->connectEmail(\n redirectUri: 'https://yourapp.com/oauth-callback', state: 'abc123'\n);\n\nvar_dump($response);",
|
|
448
453
|
},
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.connect_email(\n redirect_uri="https://yourapp.com/oauth-callback",\n)\nprint(response.expires_in)',
|
|
452
|
-
},
|
|
453
|
-
typescript: {
|
|
454
|
-
method: 'client.inbox.connectEmail',
|
|
455
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.connectEmail({\n redirect_uri: 'https://yourapp.com/oauth-callback',\n});\n\nconsole.log(response.expires_in);",
|
|
454
|
+
http: {
|
|
455
|
+
example: 'curl https://api.casparser.in/v4/inbox/connect \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "redirect_uri": "https://yourapp.com/oauth-callback",\n "state": "abc123"\n }\'',
|
|
456
456
|
},
|
|
457
457
|
},
|
|
458
458
|
},
|
|
@@ -468,28 +468,28 @@ const EMBEDDED_METHODS = [
|
|
|
468
468
|
response: '{ msg?: string; status?: string; }',
|
|
469
469
|
markdown: "## disconnect_email\n\n`client.inbox.disconnectEmail(x-inbox-token: string): { msg?: string; status?: string; }`\n\n**post** `/v4/inbox/disconnect`\n\nRevoke email access and invalidate the token.\n\nThis calls the provider's token revocation API (e.g., Google's revoke endpoint)\nto ensure the user's consent is properly removed.\n\nAfter calling this, the `inbox_token` becomes unusable.\n\n\n### Parameters\n\n- `x-inbox-token: string`\n\n### Returns\n\n- `{ msg?: string; status?: string; }`\n\n - `msg?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.disconnectEmail({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response);\n```",
|
|
470
470
|
perLanguage: {
|
|
471
|
-
|
|
472
|
-
method: 'client.
|
|
473
|
-
example:
|
|
471
|
+
typescript: {
|
|
472
|
+
method: 'client.inbox.disconnectEmail',
|
|
473
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.disconnectEmail({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.msg);",
|
|
474
474
|
},
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
python: {
|
|
476
|
+
method: 'inbox.disconnect_email',
|
|
477
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.disconnect_email(\n x_inbox_token="x-inbox-token",\n)\nprint(response.msg)',
|
|
477
478
|
},
|
|
478
479
|
java: {
|
|
479
480
|
method: 'inbox().disconnectEmail',
|
|
480
481
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inbox.InboxDisconnectEmailParams;\nimport com.cas_parser.api.models.inbox.InboxDisconnectEmailResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboxDisconnectEmailParams params = InboxDisconnectEmailParams.builder()\n .xInboxToken("x-inbox-token")\n .build();\n InboxDisconnectEmailResponse response = client.inbox().disconnectEmail(params);\n }\n}',
|
|
481
482
|
},
|
|
483
|
+
go: {
|
|
484
|
+
method: 'client.Inbox.DisconnectEmail',
|
|
485
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.DisconnectEmail(context.TODO(), casparser.InboxDisconnectEmailParams{\n\t\tXInboxToken: "x-inbox-token",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Msg)\n}\n',
|
|
486
|
+
},
|
|
482
487
|
php: {
|
|
483
488
|
method: 'inbox->disconnectEmail',
|
|
484
489
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->inbox->disconnectEmail(xInboxToken: 'x-inbox-token');\n\nvar_dump($response);",
|
|
485
490
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.disconnect_email(\n x_inbox_token="x-inbox-token",\n)\nprint(response.msg)',
|
|
489
|
-
},
|
|
490
|
-
typescript: {
|
|
491
|
-
method: 'client.inbox.disconnectEmail',
|
|
492
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.disconnectEmail({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.msg);",
|
|
491
|
+
http: {
|
|
492
|
+
example: 'curl https://api.casparser.in/v4/inbox/disconnect \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
493
493
|
},
|
|
494
494
|
},
|
|
495
495
|
},
|
|
@@ -505,28 +505,28 @@ const EMBEDDED_METHODS = [
|
|
|
505
505
|
response: '{ connected?: boolean; email?: string; provider?: string; status?: string; }',
|
|
506
506
|
markdown: "## check_connection_status\n\n`client.inbox.checkConnectionStatus(x-inbox-token: string): { connected?: boolean; email?: string; provider?: string; status?: string; }`\n\n**post** `/v4/inbox/status`\n\nVerify if an `inbox_token` is still valid and check connection status.\n\nUse this to check if the user needs to re-authenticate (e.g., if they\nrevoked access in their email provider settings).\n\n\n### Parameters\n\n- `x-inbox-token: string`\n\n### Returns\n\n- `{ connected?: boolean; email?: string; provider?: string; status?: string; }`\n\n - `connected?: boolean`\n - `email?: string`\n - `provider?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.checkConnectionStatus({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response);\n```",
|
|
507
507
|
perLanguage: {
|
|
508
|
-
|
|
509
|
-
method: 'client.
|
|
510
|
-
example:
|
|
508
|
+
typescript: {
|
|
509
|
+
method: 'client.inbox.checkConnectionStatus',
|
|
510
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.checkConnectionStatus({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.provider);",
|
|
511
511
|
},
|
|
512
|
-
|
|
513
|
-
|
|
512
|
+
python: {
|
|
513
|
+
method: 'inbox.check_connection_status',
|
|
514
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.check_connection_status(\n x_inbox_token="x-inbox-token",\n)\nprint(response.provider)',
|
|
514
515
|
},
|
|
515
516
|
java: {
|
|
516
517
|
method: 'inbox().checkConnectionStatus',
|
|
517
518
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inbox.InboxCheckConnectionStatusParams;\nimport com.cas_parser.api.models.inbox.InboxCheckConnectionStatusResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboxCheckConnectionStatusParams params = InboxCheckConnectionStatusParams.builder()\n .xInboxToken("x-inbox-token")\n .build();\n InboxCheckConnectionStatusResponse response = client.inbox().checkConnectionStatus(params);\n }\n}',
|
|
518
519
|
},
|
|
520
|
+
go: {
|
|
521
|
+
method: 'client.Inbox.CheckConnectionStatus',
|
|
522
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.CheckConnectionStatus(context.TODO(), casparser.InboxCheckConnectionStatusParams{\n\t\tXInboxToken: "x-inbox-token",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Provider)\n}\n',
|
|
523
|
+
},
|
|
519
524
|
php: {
|
|
520
525
|
method: 'inbox->checkConnectionStatus',
|
|
521
526
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->inbox->checkConnectionStatus(xInboxToken: 'x-inbox-token');\n\nvar_dump($response);",
|
|
522
527
|
},
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.check_connection_status(\n x_inbox_token="x-inbox-token",\n)\nprint(response.provider)',
|
|
526
|
-
},
|
|
527
|
-
typescript: {
|
|
528
|
-
method: 'client.inbox.checkConnectionStatus',
|
|
529
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.checkConnectionStatus({ 'x-inbox-token': 'x-inbox-token' });\n\nconsole.log(response.provider);",
|
|
528
|
+
http: {
|
|
529
|
+
example: 'curl https://api.casparser.in/v4/inbox/status \\\n -X POST \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
530
530
|
},
|
|
531
531
|
},
|
|
532
532
|
},
|
|
@@ -548,28 +548,28 @@ const EMBEDDED_METHODS = [
|
|
|
548
548
|
response: '{ msg?: string; status?: string; }',
|
|
549
549
|
markdown: "## generate_cas\n\n`client.kfintech.generateCas(email: string, from_date: string, password: string, to_date: string, pan_no?: string): { msg?: string; status?: string; }`\n\n**post** `/v4/kfintech/generate`\n\nGenerate CAS via KFintech mailback. The CAS PDF will be sent to the investor's email.\n\nThis is an async operation - the investor receives the CAS via email within a few minutes.\nFor instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`).\n\n\n### Parameters\n\n- `email: string`\n Email address to receive the CAS document\n\n- `from_date: string`\n Start date (YYYY-MM-DD)\n\n- `password: string`\n Password for the PDF\n\n- `to_date: string`\n End date (YYYY-MM-DD)\n\n- `pan_no?: string`\n PAN number (optional)\n\n### Returns\n\n- `{ msg?: string; status?: string; }`\n\n - `msg?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.kfintech.generateCas({\n email: 'user@example.com',\n from_date: '2023-01-01',\n password: 'Abcdefghi12$',\n to_date: '2023-12-31',\n});\n\nconsole.log(response);\n```",
|
|
550
550
|
perLanguage: {
|
|
551
|
-
|
|
552
|
-
method: 'client.
|
|
553
|
-
example:
|
|
551
|
+
typescript: {
|
|
552
|
+
method: 'client.kfintech.generateCas',
|
|
553
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.kfintech.generateCas({\n email: 'user@example.com',\n from_date: '2023-01-01',\n password: 'Abcdefghi12$',\n to_date: '2023-12-31',\n});\n\nconsole.log(response.msg);",
|
|
554
554
|
},
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
python: {
|
|
556
|
+
method: 'kfintech.generate_cas',
|
|
557
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.kfintech.generate_cas(\n email="user@example.com",\n from_date="2023-01-01",\n password="Abcdefghi12$",\n to_date="2023-12-31",\n)\nprint(response.msg)',
|
|
557
558
|
},
|
|
558
559
|
java: {
|
|
559
560
|
method: 'kfintech().generateCas',
|
|
560
561
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.kfintech.KfintechGenerateCasParams;\nimport com.cas_parser.api.models.kfintech.KfintechGenerateCasResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n KfintechGenerateCasParams params = KfintechGenerateCasParams.builder()\n .email("user@example.com")\n .fromDate("2023-01-01")\n .password("Abcdefghi12$")\n .toDate("2023-12-31")\n .build();\n KfintechGenerateCasResponse response = client.kfintech().generateCas(params);\n }\n}',
|
|
561
562
|
},
|
|
563
|
+
go: {
|
|
564
|
+
method: 'client.Kfintech.GenerateCas',
|
|
565
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Kfintech.GenerateCas(context.TODO(), casparser.KfintechGenerateCasParams{\n\t\tEmail: "user@example.com",\n\t\tFromDate: "2023-01-01",\n\t\tPassword: "Abcdefghi12$",\n\t\tToDate: "2023-12-31",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Msg)\n}\n',
|
|
566
|
+
},
|
|
562
567
|
php: {
|
|
563
568
|
method: 'kfintech->generateCas',
|
|
564
569
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->kfintech->generateCas(\n email: 'user@example.com',\n fromDate: '2023-01-01',\n password: 'Abcdefghi12$',\n toDate: '2023-12-31',\n panNo: 'ABCDE1234F',\n);\n\nvar_dump($response);",
|
|
565
570
|
},
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.kfintech.generate_cas(\n email="user@example.com",\n from_date="2023-01-01",\n password="Abcdefghi12$",\n to_date="2023-12-31",\n)\nprint(response.msg)',
|
|
569
|
-
},
|
|
570
|
-
typescript: {
|
|
571
|
-
method: 'client.kfintech.generateCas',
|
|
572
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.kfintech.generateCas({\n email: 'user@example.com',\n from_date: '2023-01-01',\n password: 'Abcdefghi12$',\n to_date: '2023-12-31',\n});\n\nconsole.log(response.msg);",
|
|
571
|
+
http: {
|
|
572
|
+
example: 'curl https://api.casparser.in/v4/kfintech/generate \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "email": "user@example.com",\n "from_date": "2023-01-01",\n "password": "Abcdefghi12$",\n "to_date": "2023-12-31",\n "pan_no": "ABCDE1234F"\n }\'',
|
|
573
573
|
},
|
|
574
574
|
},
|
|
575
575
|
},
|
|
@@ -585,28 +585,28 @@ const EMBEDDED_METHODS = [
|
|
|
585
585
|
response: "{ demat_accounts?: { additional_info?: object; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: object; linked_holders?: linked_holder[]; value?: number; }[]; insurance?: { life_insurance_policies?: object[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: object; }; mutual_funds?: { additional_info?: object; amc?: string; folio_number?: string; linked_holders?: linked_holder[]; registrar?: string; schemes?: object[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: object[]; linked_holders?: linked_holder[]; pran?: string; value?: number; }[]; summary?: { accounts?: object; total_value?: number; }; }",
|
|
586
586
|
markdown: "## parse\n\n`client.nsdl.parse(password?: string, pdf_file?: string, pdf_url?: string): { demat_accounts?: object[]; insurance?: object; investor?: object; meta?: object; mutual_funds?: object[]; nps?: object[]; summary?: object; }`\n\n**post** `/v4/nsdl/parse`\n\nThis endpoint specifically parses NSDL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.\nUse this endpoint when you know the PDF is from NSDL.\n\n\n### Parameters\n\n- `password?: string`\n Password for the PDF file (if required)\n\n- `pdf_file?: string`\n Base64 encoded CAS PDF file (required if pdf_url not provided)\n\n- `pdf_url?: string`\n URL to the CAS PDF file (required if pdf_file not provided)\n\n### Returns\n\n- `{ demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: object[]; corporate_bonds?: object[]; demat_mutual_funds?: object[]; equities?: object[]; government_securities?: object[]; }; linked_holders?: object[]; value?: number; }[]; insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }; mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: object[]; registrar?: string; schemes?: { additional_info?: object; cost?: number; gain?: object; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: transaction[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: object; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: object[]; pran?: string; value?: number; }[]; summary?: { accounts?: { demat?: object; insurance?: object; mutual_funds?: object; nps?: object; }; total_value?: number; }; }`\n\n - `demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; corporate_bonds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; demat_mutual_funds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; equities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; government_securities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; }; linked_holders?: { name?: string; pan?: string; }[]; value?: number; }[]`\n - `insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }`\n - `investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }`\n - `meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }`\n - `mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: { name?: string; pan?: string; }[]; registrar?: string; schemes?: { additional_info?: { advisor?: string; amfi?: string; close_units?: number; open_units?: number; rta_code?: string; }; cost?: number; gain?: { absolute?: number; percentage?: number; }; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: { additional_info?: object; amount?: number; balance?: number; date?: string; description?: string; dividend_rate?: number; nav?: number; type?: string; units?: number; }[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]`\n - `nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: { manager?: string; tier?: 1 | 2; }; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: { name?: string; pan?: string; }[]; pran?: string; value?: number; }[]`\n - `summary?: { accounts?: { demat?: { count?: number; total_value?: number; }; insurance?: { count?: number; total_value?: number; }; mutual_funds?: { count?: number; total_value?: number; }; nps?: { count?: number; total_value?: number; }; }; total_value?: number; }`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst unifiedResponse = await client.nsdl.parse();\n\nconsole.log(unifiedResponse);\n```",
|
|
587
587
|
perLanguage: {
|
|
588
|
-
|
|
589
|
-
method: 'client.
|
|
590
|
-
example:
|
|
588
|
+
typescript: {
|
|
589
|
+
method: 'client.nsdl.parse',
|
|
590
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.nsdl.parse();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
591
591
|
},
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
python: {
|
|
593
|
+
method: 'nsdl.parse',
|
|
594
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.nsdl.parse()\nprint(unified_response.demat_accounts)',
|
|
594
595
|
},
|
|
595
596
|
java: {
|
|
596
597
|
method: 'nsdl().parse',
|
|
597
598
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.camskfintech.UnifiedResponse;\nimport com.cas_parser.api.models.nsdl.NsdlParseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n UnifiedResponse unifiedResponse = client.nsdl().parse();\n }\n}',
|
|
598
599
|
},
|
|
600
|
+
go: {
|
|
601
|
+
method: 'client.Nsdl.Parse',
|
|
602
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tunifiedResponse, err := client.Nsdl.Parse(context.TODO(), casparser.NsdlParseParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unifiedResponse.DematAccounts)\n}\n',
|
|
603
|
+
},
|
|
599
604
|
php: {
|
|
600
605
|
method: 'nsdl->parse',
|
|
601
606
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$unifiedResponse = $client->nsdl->parse(\n password: 'password', pdfFile: 'pdf_file', pdfURL: 'https://example.com'\n);\n\nvar_dump($unifiedResponse);",
|
|
602
607
|
},
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.nsdl.parse()\nprint(unified_response.demat_accounts)',
|
|
606
|
-
},
|
|
607
|
-
typescript: {
|
|
608
|
-
method: 'client.nsdl.parse',
|
|
609
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.nsdl.parse();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
608
|
+
http: {
|
|
609
|
+
example: "curl https://api.casparser.in/v4/nsdl/parse \\\n -H 'Content-Type: application/json' \\\n -H \"x-api-key: $CAS_PARSER_API_KEY\" \\\n -d '{}'",
|
|
610
610
|
},
|
|
611
611
|
},
|
|
612
612
|
},
|
|
@@ -622,28 +622,28 @@ const EMBEDDED_METHODS = [
|
|
|
622
622
|
response: "{ demat_accounts?: { additional_info?: object; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: object; linked_holders?: linked_holder[]; value?: number; }[]; insurance?: { life_insurance_policies?: object[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: object; }; mutual_funds?: { additional_info?: object; amc?: string; folio_number?: string; linked_holders?: linked_holder[]; registrar?: string; schemes?: object[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: object[]; linked_holders?: linked_holder[]; pran?: string; value?: number; }[]; summary?: { accounts?: object; total_value?: number; }; }",
|
|
623
623
|
markdown: "## parse_cas_pdf\n\n`client.smart.parseCasPdf(password?: string, pdf_file?: string, pdf_url?: string): { demat_accounts?: object[]; insurance?: object; investor?: object; meta?: object; mutual_funds?: object[]; nps?: object[]; summary?: object; }`\n\n**post** `/v4/smart/parse`\n\nThis endpoint parses CAS (Consolidated Account Statement) PDF files from NSDL, CDSL, or CAMS/KFintech and returns data in a unified format.\nIt auto-detects the CAS type and transforms the data into a consistent structure regardless of the source.\n\n\n### Parameters\n\n- `password?: string`\n Password for the PDF file (if required)\n\n- `pdf_file?: string`\n Base64 encoded CAS PDF file (required if pdf_url not provided)\n\n- `pdf_url?: string`\n URL to the CAS PDF file (required if pdf_file not provided)\n\n### Returns\n\n- `{ demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: object[]; corporate_bonds?: object[]; demat_mutual_funds?: object[]; equities?: object[]; government_securities?: object[]; }; linked_holders?: object[]; value?: number; }[]; insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }; investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }; meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }; mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: object[]; registrar?: string; schemes?: { additional_info?: object; cost?: number; gain?: object; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: transaction[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]; nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: object; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: object[]; pran?: string; value?: number; }[]; summary?: { accounts?: { demat?: object; insurance?: object; mutual_funds?: object; nps?: object; }; total_value?: number; }; }`\n\n - `demat_accounts?: { additional_info?: { bo_status?: string; bo_sub_status?: string; bo_type?: string; bsda?: string; email?: string; linked_pans?: string[]; nominee?: string; status?: string; }; bo_id?: string; client_id?: string; demat_type?: 'NSDL' | 'CDSL'; dp_id?: string; dp_name?: string; holdings?: { aifs?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; corporate_bonds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; demat_mutual_funds?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; equities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; government_securities?: { additional_info?: { close_units?: number; open_units?: number; }; isin?: string; name?: string; transactions?: object[]; units?: number; value?: number; }[]; }; linked_holders?: { name?: string; pan?: string; }[]; value?: number; }[]`\n - `insurance?: { life_insurance_policies?: { additional_info?: object; life_assured?: string; policy_name?: string; policy_number?: string; premium_amount?: number; premium_frequency?: string; provider?: string; status?: string; sum_assured?: number; }[]; }`\n - `investor?: { address?: string; cas_id?: string; email?: string; mobile?: string; name?: string; pan?: string; pincode?: string; }`\n - `meta?: { cas_type?: 'NSDL' | 'CDSL' | 'CAMS_KFINTECH'; generated_at?: string; statement_period?: { from?: string; to?: string; }; }`\n - `mutual_funds?: { additional_info?: { kyc?: string; pan?: string; pankyc?: string; }; amc?: string; folio_number?: string; linked_holders?: { name?: string; pan?: string; }[]; registrar?: string; schemes?: { additional_info?: { advisor?: string; amfi?: string; close_units?: number; open_units?: number; rta_code?: string; }; cost?: number; gain?: { absolute?: number; percentage?: number; }; isin?: string; name?: string; nav?: number; nominees?: string[]; transactions?: { additional_info?: object; amount?: number; balance?: number; date?: string; description?: string; dividend_rate?: number; nav?: number; type?: string; units?: number; }[]; type?: 'Equity' | 'Debt' | 'Hybrid' | 'Other'; units?: number; value?: number; }[]; value?: number; }[]`\n - `nps?: { additional_info?: object; cra?: string; funds?: { additional_info?: { manager?: string; tier?: 1 | 2; }; cost?: number; name?: string; nav?: number; units?: number; value?: number; }[]; linked_holders?: { name?: string; pan?: string; }[]; pran?: string; value?: number; }[]`\n - `summary?: { accounts?: { demat?: { count?: number; total_value?: number; }; insurance?: { count?: number; total_value?: number; }; mutual_funds?: { count?: number; total_value?: number; }; nps?: { count?: number; total_value?: number; }; }; total_value?: number; }`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst unifiedResponse = await client.smart.parseCasPdf();\n\nconsole.log(unifiedResponse);\n```",
|
|
624
624
|
perLanguage: {
|
|
625
|
-
|
|
626
|
-
method: 'client.
|
|
627
|
-
example:
|
|
625
|
+
typescript: {
|
|
626
|
+
method: 'client.smart.parseCasPdf',
|
|
627
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.smart.parseCasPdf();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
628
628
|
},
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
python: {
|
|
630
|
+
method: 'smart.parse_cas_pdf',
|
|
631
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.smart.parse_cas_pdf()\nprint(unified_response.demat_accounts)',
|
|
631
632
|
},
|
|
632
633
|
java: {
|
|
633
634
|
method: 'smart().parseCasPdf',
|
|
634
635
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.camskfintech.UnifiedResponse;\nimport com.cas_parser.api.models.smart.SmartParseCasPdfParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n UnifiedResponse unifiedResponse = client.smart().parseCasPdf();\n }\n}',
|
|
635
636
|
},
|
|
637
|
+
go: {
|
|
638
|
+
method: 'client.Smart.ParseCasPdf',
|
|
639
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tunifiedResponse, err := client.Smart.ParseCasPdf(context.TODO(), casparser.SmartParseCasPdfParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unifiedResponse.DematAccounts)\n}\n',
|
|
640
|
+
},
|
|
636
641
|
php: {
|
|
637
642
|
method: 'smart->parseCasPdf',
|
|
638
643
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$unifiedResponse = $client->smart->parseCasPdf(\n password: 'password', pdfFile: 'pdf_file', pdfURL: 'https://example.com'\n);\n\nvar_dump($unifiedResponse);",
|
|
639
644
|
},
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nunified_response = client.smart.parse_cas_pdf()\nprint(unified_response.demat_accounts)',
|
|
643
|
-
},
|
|
644
|
-
typescript: {
|
|
645
|
-
method: 'client.smart.parseCasPdf',
|
|
646
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst unifiedResponse = await client.smart.parseCasPdf();\n\nconsole.log(unifiedResponse.demat_accounts);",
|
|
645
|
+
http: {
|
|
646
|
+
example: "curl https://api.casparser.in/v4/smart/parse \\\n -H 'Content-Type: application/json' \\\n -H \"x-api-key: $CAS_PARSER_API_KEY\" \\\n -d '{}'",
|
|
647
647
|
},
|
|
648
648
|
},
|
|
649
649
|
},
|
|
@@ -659,28 +659,28 @@ const EMBEDDED_METHODS = [
|
|
|
659
659
|
response: "{ inbound_emails?: { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }[]; limit?: number; offset?: number; status?: string; total?: number; }",
|
|
660
660
|
markdown: "## list\n\n`client.inboundEmail.list(limit?: number, offset?: number, status?: 'active' | 'paused' | 'all'): { inbound_emails?: object[]; limit?: number; offset?: number; status?: string; total?: number; }`\n\n**get** `/v4/inbound-email`\n\nList all mailboxes associated with your API key.\nReturns active and inactive mailboxes (deleted mailboxes are excluded).\n\n\n### Parameters\n\n- `limit?: number`\n Maximum number of inbound emails to return\n\n- `offset?: number`\n Pagination offset\n\n- `status?: 'active' | 'paused' | 'all'`\n Filter by status\n\n### Returns\n\n- `{ inbound_emails?: { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }[]; limit?: number; offset?: number; status?: string; total?: number; }`\n\n - `inbound_emails?: { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }[]`\n - `limit?: number`\n - `offset?: number`\n - `status?: string`\n - `total?: number`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmails = await client.inboundEmail.list();\n\nconsole.log(inboundEmails);\n```",
|
|
661
661
|
perLanguage: {
|
|
662
|
-
|
|
663
|
-
method: 'client.
|
|
664
|
-
example:
|
|
662
|
+
typescript: {
|
|
663
|
+
method: 'client.inboundEmail.list',
|
|
664
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmails = await client.inboundEmail.list();\n\nconsole.log(inboundEmails.inbound_emails);",
|
|
665
665
|
},
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
python: {
|
|
667
|
+
method: 'inbound_email.list',
|
|
668
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_emails = client.inbound_email.list()\nprint(inbound_emails.inbound_emails)',
|
|
668
669
|
},
|
|
669
670
|
java: {
|
|
670
671
|
method: 'inboundEmail().list',
|
|
671
672
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailListParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailListResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailListResponse inboundEmails = client.inboundEmail().list();\n }\n}',
|
|
672
673
|
},
|
|
674
|
+
go: {
|
|
675
|
+
method: 'client.InboundEmail.List',
|
|
676
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tinboundEmails, err := client.InboundEmail.List(context.TODO(), casparser.InboundEmailListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmails.InboundEmails)\n}\n',
|
|
677
|
+
},
|
|
673
678
|
php: {
|
|
674
679
|
method: 'inboundEmail->list',
|
|
675
680
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmails = $client->inboundEmail->list(\n limit: 1, offset: 0, status: 'active'\n);\n\nvar_dump($inboundEmails);",
|
|
676
681
|
},
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_emails = client.inbound_email.list()\nprint(inbound_emails.inbound_emails)',
|
|
680
|
-
},
|
|
681
|
-
typescript: {
|
|
682
|
-
method: 'client.inboundEmail.list',
|
|
683
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmails = await client.inboundEmail.list();\n\nconsole.log(inboundEmails.inbound_emails);",
|
|
682
|
+
http: {
|
|
683
|
+
example: 'curl https://api.casparser.in/v4/inbound-email \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
684
684
|
},
|
|
685
685
|
},
|
|
686
686
|
},
|
|
@@ -689,41 +689,41 @@ const EMBEDDED_METHODS = [
|
|
|
689
689
|
endpoint: '/v4/inbound-email',
|
|
690
690
|
httpMethod: 'post',
|
|
691
691
|
summary: 'Create Inbound Email',
|
|
692
|
-
description: 'Create a dedicated inbound email address for collecting CAS statements
|
|
692
|
+
description: 'Create a dedicated inbound email address for collecting CAS statements\nvia email forwarding. When an investor forwards a CAS email to this\naddress, we verify the sender and make the file available to you.\n\n`callback_url` is **optional**:\n- **Set it** — we POST each parsed email to your webhook as it arrives.\n- **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files`\n without building a webhook consumer.\n',
|
|
693
693
|
stainlessPath: '(resource) inbound_email > (method) create',
|
|
694
694
|
qualified: 'client.inboundEmail.create',
|
|
695
695
|
params: [
|
|
696
|
-
'callback_url: string;',
|
|
697
696
|
'alias?: string;',
|
|
698
697
|
"allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[];",
|
|
698
|
+
'callback_url?: string;',
|
|
699
699
|
'metadata?: object;',
|
|
700
700
|
'reference?: string;',
|
|
701
701
|
],
|
|
702
702
|
response: "{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }",
|
|
703
|
-
markdown: "## create\n\n`client.inboundEmail.create(
|
|
703
|
+
markdown: "## create\n\n`client.inboundEmail.create(alias?: string, allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[], callback_url?: string, metadata?: object, reference?: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**post** `/v4/inbound-email`\n\nCreate a dedicated inbound email address for collecting CAS statements\nvia email forwarding. When an investor forwards a CAS email to this\naddress, we verify the sender and make the file available to you.\n\n`callback_url` is **optional**:\n- **Set it** — we POST each parsed email to your webhook as it arrives.\n- **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files`\n without building a webhook consumer.\n\n\n### Parameters\n\n- `alias?: string`\n Optional custom email prefix (e.g.\n`john-portfolio@import.casparser.in`). 3-32 chars,\nalphanumeric + hyphens, must start/end with a letter or\nnumber. If omitted, a random ID is generated.\n\n\n- `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n Filter emails by CAS provider. If omitted, accepts all providers.\n- `cdsl` → eCAS@cdslstatement.com\n- `nsdl` → NSDL-CAS@nsdl.co.in\n- `cams` → donotreply@camsonline.com\n- `kfintech` → samfS@kfintech.com\n\n\n- `callback_url?: string`\n Optional webhook URL where we POST parsed emails. Must be\nHTTPS in production (HTTP allowed for localhost). If omitted,\nretrieve files via `GET /v4/inbound-email/{id}/files`.\n\n\n- `metadata?: object`\n Optional key-value pairs (max 10) to include in webhook payload.\nUseful for passing context like plan_type, campaign_id, etc.\n\n\n- `reference?: string`\n Your internal identifier (e.g., user_id, account_id).\nReturned in webhook payload for correlation.\n\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.create();\n\nconsole.log(inboundEmail);\n```",
|
|
704
704
|
perLanguage: {
|
|
705
|
-
|
|
706
|
-
method: 'client.
|
|
707
|
-
example:
|
|
705
|
+
typescript: {
|
|
706
|
+
method: 'client.inboundEmail.create',
|
|
707
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.create();\n\nconsole.log(inboundEmail.inbound_email_id);",
|
|
708
708
|
},
|
|
709
|
-
|
|
710
|
-
|
|
709
|
+
python: {
|
|
710
|
+
method: 'inbound_email.create',
|
|
711
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.create()\nprint(inbound_email.inbound_email_id)',
|
|
711
712
|
},
|
|
712
713
|
java: {
|
|
713
714
|
method: 'inboundEmail().create',
|
|
714
|
-
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n
|
|
715
|
+
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailCreateResponse inboundEmail = client.inboundEmail().create();\n }\n}',
|
|
716
|
+
},
|
|
717
|
+
go: {
|
|
718
|
+
method: 'client.InboundEmail.New',
|
|
719
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tinboundEmail, err := client.InboundEmail.New(context.TODO(), casparser.InboundEmailNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\n}\n',
|
|
715
720
|
},
|
|
716
721
|
php: {
|
|
717
722
|
method: 'inboundEmail->create',
|
|
718
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmail = $client->inboundEmail->create(\n
|
|
719
|
-
},
|
|
720
|
-
python: {
|
|
721
|
-
method: 'inbound_email.create',
|
|
722
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.create(\n callback_url="https://api.yourapp.com/webhooks/cas-email",\n)\nprint(inbound_email.inbound_email_id)',
|
|
723
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmail = $client->inboundEmail->create(\n alias: 'john-portfolio',\n allowedSources: ['cdsl', 'nsdl'],\n callbackURL: 'https://api.yourapp.com/webhooks/cas-email',\n metadata: ['plan' => 'premium', 'source' => 'onboarding'],\n reference: 'user_12345',\n);\n\nvar_dump($inboundEmail);",
|
|
723
724
|
},
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.create({\n callback_url: 'https://api.yourapp.com/webhooks/cas-email',\n});\n\nconsole.log(inboundEmail.inbound_email_id);",
|
|
725
|
+
http: {
|
|
726
|
+
example: 'curl https://api.casparser.in/v4/inbound-email \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "alias": "john-portfolio",\n "allowed_sources": [\n "cdsl",\n "nsdl"\n ],\n "callback_url": "https://api.yourapp.com/webhooks/cas-email",\n "metadata": {\n "plan": "premium",\n "source": "onboarding"\n },\n "reference": "user_12345"\n }\'',
|
|
727
727
|
},
|
|
728
728
|
},
|
|
729
729
|
},
|
|
@@ -739,28 +739,28 @@ const EMBEDDED_METHODS = [
|
|
|
739
739
|
response: '{ msg?: string; status?: string; }',
|
|
740
740
|
markdown: "## delete\n\n`client.inboundEmail.delete(inbound_email_id: string): { msg?: string; status?: string; }`\n\n**delete** `/v4/inbound-email/{inbound_email_id}`\n\nPermanently delete an inbound email address. It will stop accepting emails.\n\n**Note:** Deletion is immediate and cannot be undone. Any emails received after\ndeletion will be rejected.\n\n\n### Parameters\n\n- `inbound_email_id: string`\n\n### Returns\n\n- `{ msg?: string; status?: string; }`\n\n - `msg?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.delete('inbound_email_id');\n\nconsole.log(inboundEmail);\n```",
|
|
741
741
|
perLanguage: {
|
|
742
|
-
|
|
743
|
-
method: 'client.
|
|
744
|
-
example:
|
|
742
|
+
typescript: {
|
|
743
|
+
method: 'client.inboundEmail.delete',
|
|
744
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.delete('inbound_email_id');\n\nconsole.log(inboundEmail.msg);",
|
|
745
745
|
},
|
|
746
|
-
|
|
747
|
-
|
|
746
|
+
python: {
|
|
747
|
+
method: 'inbound_email.delete',
|
|
748
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.delete(\n "inbound_email_id",\n)\nprint(inbound_email.msg)',
|
|
748
749
|
},
|
|
749
750
|
java: {
|
|
750
751
|
method: 'inboundEmail().delete',
|
|
751
752
|
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailDeleteParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailDeleteResponse inboundEmail = client.inboundEmail().delete("inbound_email_id");\n }\n}',
|
|
752
753
|
},
|
|
754
|
+
go: {
|
|
755
|
+
method: 'client.InboundEmail.Delete',
|
|
756
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tinboundEmail, err := client.InboundEmail.Delete(context.TODO(), "inbound_email_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.Msg)\n}\n',
|
|
757
|
+
},
|
|
753
758
|
php: {
|
|
754
759
|
method: 'inboundEmail->delete',
|
|
755
760
|
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmail = $client->inboundEmail->delete('inbound_email_id');\n\nvar_dump($inboundEmail);",
|
|
756
761
|
},
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.delete(\n "inbound_email_id",\n)\nprint(inbound_email.msg)',
|
|
760
|
-
},
|
|
761
|
-
typescript: {
|
|
762
|
-
method: 'client.inboundEmail.delete',
|
|
763
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.delete('inbound_email_id');\n\nconsole.log(inboundEmail.msg);",
|
|
762
|
+
http: {
|
|
763
|
+
example: 'curl https://api.casparser.in/v4/inbound-email/$INBOUND_EMAIL_ID \\\n -X DELETE \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
764
764
|
},
|
|
765
765
|
},
|
|
766
766
|
},
|
|
@@ -774,47 +774,39 @@ const EMBEDDED_METHODS = [
|
|
|
774
774
|
qualified: 'client.inboundEmail.retrieve',
|
|
775
775
|
params: ['inbound_email_id: string;'],
|
|
776
776
|
response: "{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }",
|
|
777
|
-
markdown: "## retrieve\n\n`client.inboundEmail.retrieve(inbound_email_id: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**get** `/v4/inbound-email/{inbound_email_id}`\n\nRetrieve details of a specific mailbox including statistics.\n\n\n### Parameters\n\n- `inbound_email_id: string`\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.retrieve('
|
|
777
|
+
markdown: "## retrieve\n\n`client.inboundEmail.retrieve(inbound_email_id: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**get** `/v4/inbound-email/{inbound_email_id}`\n\nRetrieve details of a specific mailbox including statistics.\n\n\n### Parameters\n\n- `inbound_email_id: string`\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.retrieve('inbound_email_id');\n\nconsole.log(inboundEmail);\n```",
|
|
778
778
|
perLanguage: {
|
|
779
|
-
|
|
780
|
-
method: 'client.
|
|
781
|
-
example:
|
|
779
|
+
typescript: {
|
|
780
|
+
method: 'client.inboundEmail.retrieve',
|
|
781
|
+
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.retrieve('inbound_email_id');\n\nconsole.log(inboundEmail.inbound_email_id);",
|
|
782
782
|
},
|
|
783
|
-
|
|
784
|
-
|
|
783
|
+
python: {
|
|
784
|
+
method: 'inbound_email.retrieve',
|
|
785
|
+
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.retrieve(\n "inbound_email_id",\n)\nprint(inbound_email.inbound_email_id)',
|
|
785
786
|
},
|
|
786
787
|
java: {
|
|
787
788
|
method: 'inboundEmail().retrieve',
|
|
788
|
-
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailRetrieveResponse inboundEmail = client.inboundEmail().retrieve("
|
|
789
|
+
example: 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailRetrieveResponse inboundEmail = client.inboundEmail().retrieve("inbound_email_id");\n }\n}',
|
|
790
|
+
},
|
|
791
|
+
go: {
|
|
792
|
+
method: 'client.InboundEmail.Get',
|
|
793
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tinboundEmail, err := client.InboundEmail.Get(context.TODO(), "inbound_email_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\n}\n',
|
|
789
794
|
},
|
|
790
795
|
php: {
|
|
791
796
|
method: 'inboundEmail->retrieve',
|
|
792
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmail = $client->inboundEmail->retrieve('
|
|
797
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$inboundEmail = $client->inboundEmail->retrieve('inbound_email_id');\n\nvar_dump($inboundEmail);",
|
|
793
798
|
},
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
example: 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\ninbound_email = client.inbound_email.retrieve(\n "ie_a1b2c3d4e5f6",\n)\nprint(inbound_email.inbound_email_id)',
|
|
797
|
-
},
|
|
798
|
-
typescript: {
|
|
799
|
-
method: 'client.inboundEmail.retrieve',
|
|
800
|
-
example: "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst inboundEmail = await client.inboundEmail.retrieve('ie_a1b2c3d4e5f6');\n\nconsole.log(inboundEmail.inbound_email_id);",
|
|
799
|
+
http: {
|
|
800
|
+
example: 'curl https://api.casparser.in/v4/inbound-email/$INBOUND_EMAIL_ID \\\n -H "x-api-key: $CAS_PARSER_API_KEY"',
|
|
801
801
|
},
|
|
802
802
|
},
|
|
803
803
|
},
|
|
804
804
|
];
|
|
805
805
|
const EMBEDDED_READMES = [
|
|
806
|
-
{
|
|
807
|
-
language: 'python',
|
|
808
|
-
content: '# Cas Parser Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/cas-parser-python/)\n\nThe Cas Parser Python library provides convenient access to the Cas Parser REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [casparser.in](https://casparser.in/docs). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install cas-parser-python\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\n\nresponse = client.credits.check()\nprint(response.enabled_features)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `CAS_PARSER_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncCasParser` instead of `CasParser` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom cas_parser import AsyncCasParser\n\nclient = AsyncCasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n response = await client.credits.check()\n print(response.enabled_features)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install cas-parser-python[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom cas_parser import DefaultAioHttpClient\nfrom cas_parser import AsyncCasParser\n\nasync def main() -> None:\n async with AsyncCasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n response = await client.credits.check()\n print(response.enabled_features)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cas_parser.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `cas_parser.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `cas_parser.APIError`.\n\n```python\nimport cas_parser\nfrom cas_parser import CasParser\n\nclient = CasParser()\n\ntry:\n client.credits.check()\nexcept cas_parser.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept cas_parser.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept cas_parser.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom cas_parser import CasParser\n\n# Configure the default for all requests:\nclient = CasParser(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).credits.check()\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom cas_parser import CasParser\n\n# Configure the default for all requests:\nclient = CasParser(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = CasParser(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).credits.check()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `CAS_PARSER_LOG` to `info`.\n\n```shell\n$ export CAS_PARSER_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom cas_parser import CasParser\n\nclient = CasParser()\nresponse = client.credits.with_raw_response.check()\nprint(response.headers.get(\'X-My-Header\'))\n\ncredit = response.parse() # get the object that `credits.check()` would have returned\nprint(credit.enabled_features)\n```\n\nThese methods return an [`APIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.credits.with_streaming_response.check() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom cas_parser import CasParser, DefaultHttpxClient\n\nclient = CasParser(\n # Or use the `CAS_PARSER_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom cas_parser import CasParser\n\nwith CasParser() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport cas_parser\nprint(cas_parser.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
809
|
-
},
|
|
810
806
|
{
|
|
811
807
|
language: 'go',
|
|
812
808
|
content: '# Cas Parser Go API Library\n\n<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go"><img src="https://pkg.go.dev/badge/github.com/CASParser/cas-parser-go.svg" alt="Go Reference"></a>\n\nThe Cas Parser Go library provides convenient access to the [Cas Parser REST API](https://casparser.in/docs)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n```go\nimport (\n\t"github.com/CASParser/cas-parser-go" // imported as SDK_PackageName\n)\n```\n\n<!-- x-release-please-end -->\n\nOr to pin the version:\n\n<!-- x-release-please-start-version -->\n\n```sh\ngo get -u \'github.com/CASParser/cas-parser-go@v0.0.1\'\n```\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("CAS_PARSER_API_KEY")\n\t)\n\tresponse, err := client.Credits.Check(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.EnabledFeatures)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Credits.Check(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/CASParser/cas-parser-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Credits.Check(context.TODO())\nif err != nil {\n\tvar apierr *casparser.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/v1/credits": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Credits.Check(\n\tctx,\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := casparser.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Credits.Check(context.TODO(), option.WithMaxRetries(5))\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nresponse, err := client.Credits.Check(context.TODO(), option.WithResponseInto(&response))\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", response)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
813
809
|
},
|
|
814
|
-
{
|
|
815
|
-
language: 'typescript',
|
|
816
|
-
content: "# Cas Parser TypeScript API Library\n\n[)](https://npmjs.org/package/cas-parser-node) \n\nThis library provides convenient access to the Cas Parser REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [casparser.in](https://casparser.in/docs). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install cas-parser-node\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.credits.check();\n\nconsole.log(response.enabled_features);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response: CasParser.CreditCheckResponse = await client.credits.check();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst response = await client.credits.check().catch(async (err) => {\n if (err instanceof CasParser.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new CasParser({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.credits.check({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new CasParser({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.credits.check({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new CasParser();\n\nconst response = await client.credits.check().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.credits.check().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.enabled_features);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `CAS_PARSER_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new CasParser({\n logger: logger.child({ name: 'CasParser' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.credits.check({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport fetch from 'my-fetch';\n\nconst client = new CasParser({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new CasParser({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport CasParser from 'npm:cas-parser-node';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new CasParser({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-node/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
817
|
-
},
|
|
818
810
|
{
|
|
819
811
|
language: 'java',
|
|
820
812
|
content: '# Cas Parser Java API Library\n\n<!-- x-release-please-start-version -->\n[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.0.1)\n[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.0.1)\n<!-- x-release-please-end -->\n\nThe Cas Parser Java SDK provides convenient access to the [Cas Parser REST API](https://casparser.in/docs) from applications written in Java.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n<!-- x-release-please-start-version -->\n\nThe REST API documentation can be found on [casparser.in](https://casparser.in/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.0.1).\n\n<!-- x-release-please-end -->\n\n## Installation\n\n<!-- x-release-please-start-version -->\n\n### Gradle\n\n~~~kotlin\nimplementation("com.cas_parser.api:cas-parser-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n<dependency>\n <groupId>com.cas_parser.api</groupId>\n <artifactId>cas-parser-java</artifactId>\n <version>0.0.1</version>\n</dependency>\n~~~\n\n<!-- x-release-please-end -->\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\n// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties\n// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables\nCasParserClient client = CasParserOkHttpClient.fromEnv();\n\nCreditCheckResponse response = client.credits().check();\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\n// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties\n// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables\nCasParserClient client = CasParserOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .apiKey("My API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n // Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties\n // Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------- | ------------------- | --------------------- | -------- | ---------------------------- |\n| `apiKey` | `casparser.apiKey` | `CAS_PARSER_API_KEY` | true | - |\n| `baseUrl` | `casparser.baseUrl` | `CAS_PARSER_BASE_URL` | true | `"https://api.casparser.in"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\n\nCasParserClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Cas Parser API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.credits().check(...)` should be called with an instance of `CreditCheckParams`, and it will return an instance of `CreditCheckResponse`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties\n// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables\nCasParserClient client = CasParserOkHttpClient.fromEnv();\n\nCompletableFuture<CreditCheckResponse> response = client.async().credits().check();\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.cas_parser.api.client.CasParserClientAsync;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClientAsync;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties\n// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables\nCasParserClientAsync client = CasParserOkHttpClientAsync.fromEnv();\n\nCompletableFuture<CreditCheckResponse> response = client.credits().check();\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.cas_parser.api.core.http.Headers;\nimport com.cas_parser.api.core.http.HttpResponseFor;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\nHttpResponseFor<CreditCheckResponse> response = client.credits().withRawResponse().check();\n\nint statusCode = response.statusCode();\nHeaders headers = response.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\nCreditCheckResponse parsedResponse = response.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`CasParserServiceException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`CasParserIoException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserIoException.kt): I/O networking errors.\n\n- [`CasParserRetryableException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`CasParserInvalidDataException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`CasParserException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n\n\n## Logging\n\nThe SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).\n\nEnable logging by setting the `CAS_PARSER_LOG` environment variable to `info`:\n\n```sh\nexport CAS_PARSER_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport CAS_PARSER_LOG=debug\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `cas-parser-java-core` is published with a [configuration file](cas-parser-java-core/src/main/resources/META-INF/proguard/cas-parser-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`CasParserOkHttpClient`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt) or [`CasParserOkHttpClientAsync`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\nCreditCheckResponse response = client.credits().check(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport java.time.Duration;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport java.time.Duration;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `cas-parser-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`CasParserClient`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt), [`CasParserClientAsync`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt), [`CasParserClientImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt), and [`CasParserClientAsyncImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt), all of which can work with any HTTP client\n- `cas-parser-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`CasParserOkHttpClient`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt) and [`CasParserOkHttpClientAsync`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt), which provide a way to construct [`CasParserClientImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt) and [`CasParserClientAsyncImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt), respectively, using OkHttp\n- `cas-parser-java`\n - Depends on and exposes the APIs of both `cas-parser-java-core` and `cas-parser-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`cas-parser-java` dependency](#installation) with `cas-parser-java-core`\n2. Copy `cas-parser-java-client-okhttp`\'s [`OkHttpClient`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`CasParserClientImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt) or [`CasParserClientAsyncImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt), similarly to [`CasParserOkHttpClient`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt) or [`CasParserOkHttpClientAsync`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`cas-parser-java` dependency](#installation) with `cas-parser-java-core`\n2. Write a class that implements the [`HttpClient`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/http/HttpClient.kt) interface\n3. Construct [`CasParserClientImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt) or [`CasParserClientAsyncImpl`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt), similarly to [`CasParserOkHttpClient`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt) or [`CasParserOkHttpClientAsync`](cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.cas_parser.api.core.JsonValue;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\n\nCreditCheckParams params = CreditCheckParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt) object to its setter:\n\n```java\nimport com.cas_parser.api.models.credits.CreditCheckParams;\n\nCreditCheckParams params = CreditCheckParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.cas_parser.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt):\n\n```java\nimport com.cas_parser.api.core.JsonMissing;\nimport com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpParams;\nimport com.cas_parser.api.models.credits.CreditCheckParams;\n\nCreditCheckParams params = FetchRequestOtpParams.builder()\n .dob("1990-01-15")\n .pan("ABCDE1234F")\n .boId(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.cas_parser.api.core.JsonValue;\nimport java.util.Map;\n\nMap<String, JsonValue> additionalProperties = client.credits().check(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.cas_parser.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField<Object> field = client.credits().check(params)._field();\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional<String> jsonString = field.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`CasParserInvalidDataException`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/errors/CasParserInvalidDataException.kt) only if you directly access the property.\n\nIf you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\nCreditCheckResponse response = client.credits().check(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.cas_parser.api.models.credits.CreditCheckResponse;\n\nCreditCheckResponse response = client.credits().check(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\n\nCasParserClient client = CasParserOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField<T>` instead of just plain `T`?\n\nUsing `JsonField<T>` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-java/issues) with questions, bugs, or suggestions.\n',
|
|
@@ -823,6 +815,14 @@ const EMBEDDED_READMES = [
|
|
|
823
815
|
language: 'php',
|
|
824
816
|
content: '# Cas Parser PHP API Library\n\nThe Cas Parser PHP library provides convenient access to the Cas Parser REST API from any PHP 8.1.0+ application.\n\n## Installation\n\nTo use this package, install via Composer by adding the following to your application\'s `composer.json`:\n\n<!-- x-release-please-start-version -->\n```json\n{\n "repositories": [\n {\n "type": "vcs",\n "url": "git@github.com:CASParser/cas-parser-php.git"\n }\n ],\n "require": {\n "org-placeholder/cas-parser": "dev-main"\n }\n}\n```\n<!-- x-release-please-end -->\n\n## Usage\n\n```php\n<?php\n\n$client = new Client(apiKey: getenv(\'CAS_PARSER_API_KEY\') ?: \'My API Key\');\n\n$response = $client->credits->check();\n\nvar_dump($response->enabled_features);\n```',
|
|
825
817
|
},
|
|
818
|
+
{
|
|
819
|
+
language: 'python',
|
|
820
|
+
content: '# Cas Parser Python API library\n\n<!-- prettier-ignore -->\n[)](https://pypi.org/project/cas-parser-python/)\n\nThe Cas Parser Python library provides convenient access to the Cas Parser REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [casparser.in](https://casparser.in/docs). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install cas-parser-python\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\n\nresponse = client.credits.check()\nprint(response.enabled_features)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `CAS_PARSER_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncCasParser` instead of `CasParser` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom cas_parser import AsyncCasParser\n\nclient = AsyncCasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n response = await client.credits.check()\n print(response.enabled_features)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install cas-parser-python[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom cas_parser import DefaultAioHttpClient\nfrom cas_parser import AsyncCasParser\n\nasync def main() -> None:\n async with AsyncCasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n response = await client.credits.check()\n print(response.enabled_features)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cas_parser.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `cas_parser.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `cas_parser.APIError`.\n\n```python\nimport cas_parser\nfrom cas_parser import CasParser\n\nclient = CasParser()\n\ntry:\n client.credits.check()\nexcept cas_parser.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept cas_parser.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept cas_parser.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom cas_parser import CasParser\n\n# Configure the default for all requests:\nclient = CasParser(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).credits.check()\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom cas_parser import CasParser\n\n# Configure the default for all requests:\nclient = CasParser(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = CasParser(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).credits.check()\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `CAS_PARSER_LOG` to `info`.\n\n```shell\n$ export CAS_PARSER_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom cas_parser import CasParser\n\nclient = CasParser()\nresponse = client.credits.with_raw_response.check()\nprint(response.headers.get(\'X-My-Header\'))\n\ncredit = response.parse() # get the object that `credits.check()` would have returned\nprint(credit.enabled_features)\n```\n\nThese methods return an [`APIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.credits.with_streaming_response.check() as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom cas_parser import CasParser, DefaultHttpxClient\n\nclient = CasParser(\n # Or use the `CAS_PARSER_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom cas_parser import CasParser\n\nwith CasParser() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport cas_parser\nprint(cas_parser.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n',
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
language: 'typescript',
|
|
824
|
+
content: "# Cas Parser TypeScript API Library\n\n[)](https://npmjs.org/package/cas-parser-node) \n\nThis library provides convenient access to the Cas Parser REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [casparser.in](https://casparser.in/docs). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)\n[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install cas-parser-node\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n<!-- prettier-ignore -->\n```js\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.credits.check();\n\nconsole.log(response.enabled_features);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n<!-- prettier-ignore -->\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response: CasParser.CreditCheckResponse = await client.credits.check();\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n<!-- prettier-ignore -->\n```ts\nconst response = await client.credits.check().catch(async (err) => {\n if (err instanceof CasParser.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n<!-- prettier-ignore -->\n```js\n// Configure the default for all requests:\nconst client = new CasParser({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.credits.check({\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n<!-- prettier-ignore -->\n```ts\n// Configure the default for all requests:\nconst client = new CasParser({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.credits.check({\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n<!-- prettier-ignore -->\n```ts\nconst client = new CasParser();\n\nconst response = await client.credits.check().asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.credits.check().withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.enabled_features);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `CAS_PARSER_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new CasParser({\n logger: logger.child({ name: 'CasParser' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.credits.check({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport fetch from 'my-fetch';\n\nconst client = new CasParser({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>\n\n```ts\nimport CasParser from 'cas-parser-node';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new CasParser({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>\n\n```ts\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n<img src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>\n\n```ts\nimport CasParser from 'npm:cas-parser-node';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new CasParser({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/CASParser/cas-parser-node/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n",
|
|
825
|
+
},
|
|
826
826
|
];
|
|
827
827
|
const INDEX_OPTIONS = {
|
|
828
828
|
fields: [
|