emissions-api-sdk 1.0.1 → 1.0.2

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.
Files changed (106) hide show
  1. package/dist/api/Calculation.js +4 -4
  2. package/dist/api/Factor.js +7 -7
  3. package/dist/api/FactorSets.js +1 -1
  4. package/dist/api/Fugitive.js +4 -4
  5. package/dist/api/Location.js +4 -4
  6. package/dist/api/Mobile.js +4 -6
  7. package/dist/api/Stationary.js +4 -4
  8. package/dist/api/TransportationAndDistribution.js +5 -5
  9. package/dist/coverage/clover.xml +335 -0
  10. package/dist/coverage/coverage-final.json +19 -0
  11. package/dist/coverage/lcov-report/base.css +224 -0
  12. package/dist/coverage/lcov-report/block-navigation.js +87 -0
  13. package/dist/coverage/lcov-report/favicon.png +0 -0
  14. package/dist/coverage/lcov-report/index.html +161 -0
  15. package/dist/coverage/lcov-report/prettify.css +1 -0
  16. package/dist/coverage/lcov-report/prettify.js +2 -0
  17. package/dist/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  18. package/dist/coverage/lcov-report/sorter.js +210 -0
  19. package/dist/coverage/lcov-report/src/Client.ts.html +838 -0
  20. package/dist/coverage/lcov-report/src/Constants.ts.html +208 -0
  21. package/dist/coverage/lcov-report/src/api/Calculation.ts.html +436 -0
  22. package/dist/coverage/lcov-report/src/api/Factor.ts.html +622 -0
  23. package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +157 -0
  24. package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +436 -0
  25. package/dist/coverage/lcov-report/src/api/Location.ts.html +433 -0
  26. package/dist/coverage/lcov-report/src/api/Mobile.ts.html +448 -0
  27. package/dist/coverage/lcov-report/src/api/Stationary.ts.html +442 -0
  28. package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +436 -0
  29. package/dist/coverage/lcov-report/src/api/index.html +221 -0
  30. package/dist/coverage/lcov-report/src/index.html +161 -0
  31. package/dist/coverage/lcov-report/src/request.ts.html +235 -0
  32. package/dist/coverage/lcov-report/src/utils.ts.html +139 -0
  33. package/dist/coverage/lcov-report/test/index.html +116 -0
  34. package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +142 -0
  35. package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +133 -0
  36. package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +142 -0
  37. package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +139 -0
  38. package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +142 -0
  39. package/dist/coverage/lcov-report/test/mocks/index.html +176 -0
  40. package/dist/coverage/lcov-report/test/testUtils.ts.html +97 -0
  41. package/dist/coverage/lcov.info +558 -0
  42. package/dist/interfaces/response/AreaResponse.js +2 -0
  43. package/dist/interfaces/response/EmissionResponse.js +2 -0
  44. package/dist/interfaces/response/EmissionResponseWithDetails.js +2 -0
  45. package/dist/interfaces/response/FactorResponse.js +2 -0
  46. package/dist/interfaces/response/FactorSetResponse.js +2 -0
  47. package/dist/interfaces/response/SearchResponse.js +2 -0
  48. package/dist/interfaces/response/TypeResponse.js +2 -0
  49. package/dist/interfaces/response/UnitResponse.js +2 -0
  50. package/dist/types/api/Calculation.d.ts +13 -8
  51. package/dist/types/api/Factor.d.ts +18 -13
  52. package/dist/types/api/FactorSets.d.ts +3 -2
  53. package/dist/types/api/Fugitive.d.ts +13 -8
  54. package/dist/types/api/Location.d.ts +13 -8
  55. package/dist/types/api/Mobile.d.ts +13 -10
  56. package/dist/types/api/Stationary.d.ts +13 -8
  57. package/dist/types/api/TransportationAndDistribution.d.ts +14 -9
  58. package/dist/types/index.d.ts +8 -0
  59. package/dist/types/interfaces/response/AreaResponse.d.ts +20 -0
  60. package/dist/types/interfaces/response/EmissionResponse.d.ts +31 -0
  61. package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +144 -0
  62. package/dist/types/interfaces/response/FactorResponse.d.ts +53 -0
  63. package/dist/types/interfaces/response/FactorSetResponse.d.ts +38 -0
  64. package/dist/types/interfaces/response/SearchResponse.d.ts +41 -0
  65. package/dist/types/interfaces/response/TypeResponse.d.ts +7 -0
  66. package/dist/types/interfaces/response/UnitResponse.d.ts +7 -0
  67. package/docs/_sources/index.rst.txt +1 -0
  68. package/docs/_sources/troubleshooting.rst.txt +486 -0
  69. package/docs/_static/basic.css +8 -0
  70. package/docs/_static/pygments.css +146 -164
  71. package/docs/_static/searchtools.js +5 -8
  72. package/docs/_static/styles/furo.css +1 -1
  73. package/docs/_static/styles/furo.css.map +1 -1
  74. package/docs/authentication.html +29 -19
  75. package/docs/client.html +29 -19
  76. package/docs/genindex.html +29 -19
  77. package/docs/getting_started.html +29 -19
  78. package/docs/index.html +42 -19
  79. package/docs/objects.inv +0 -0
  80. package/docs/reference.html +69 -53
  81. package/docs/sdk.html +29 -19
  82. package/docs/search.html +29 -19
  83. package/docs/searchindex.js +1 -1
  84. package/docs/troubleshooting.html +786 -0
  85. package/package.json +1 -1
  86. package/sphinx-build/requirements.txt +5 -0
  87. package/sphinx-build/source/index.rst +1 -0
  88. package/sphinx-build/source/troubleshooting.rst +486 -0
  89. package/src/api/Calculation.ts +19 -14
  90. package/src/api/Factor.ts +27 -22
  91. package/src/api/FactorSets.ts +4 -3
  92. package/src/api/Fugitive.ts +19 -14
  93. package/src/api/Location.ts +20 -15
  94. package/src/api/Mobile.ts +19 -16
  95. package/src/api/Stationary.ts +19 -14
  96. package/src/api/TransportationAndDistribution.ts +21 -16
  97. package/src/index.ts +33 -1
  98. package/src/interfaces/response/AreaResponse.ts +25 -0
  99. package/src/interfaces/response/EmissionResponse.ts +44 -0
  100. package/src/interfaces/response/EmissionResponseWithDetails.ts +183 -0
  101. package/src/interfaces/response/FactorResponse.ts +78 -0
  102. package/src/interfaces/response/FactorSetResponse.ts +52 -0
  103. package/src/interfaces/response/SearchResponse.ts +52 -0
  104. package/src/interfaces/response/TypeResponse.ts +7 -0
  105. package/src/interfaces/response/UnitResponse.ts +7 -0
  106. package/test/apiTest.test.ts +1 -1
@@ -0,0 +1,786 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en" data-content_root="./">
3
+ <head><meta charset="utf-8"/>
4
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
5
+ <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="prev" title="Reference" href="reference.html" />
7
+
8
+ <!-- Generated with Sphinx 8.1.3 and Furo 2025.07.19 -->
9
+ <title>Troubleshooting Guide - IBM Envizi - Emissions API Node.js SDK documentation</title>
10
+ <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
11
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
12
+ <link rel="stylesheet" type="text/css" href="_static/sphinx_js.css" />
13
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
14
+ <link rel="stylesheet" type="text/css" href="_static/custom.css?v=8d04aa46" />
15
+
16
+
17
+
18
+
19
+ <style>
20
+ body {
21
+ --color-code-background: #f2f2f2;
22
+ --color-code-foreground: #1e1e1e;
23
+
24
+ }
25
+ @media not print {
26
+ body[data-theme="dark"] {
27
+ --color-code-background: #2b2b2b;
28
+ --color-code-foreground: #f8f8f2;
29
+
30
+ }
31
+ @media (prefers-color-scheme: dark) {
32
+ body:not([data-theme="light"]) {
33
+ --color-code-background: #2b2b2b;
34
+ --color-code-foreground: #f8f8f2;
35
+
36
+ }
37
+ }
38
+ }
39
+ </style></head>
40
+ <body>
41
+
42
+ <script>
43
+ document.body.dataset.theme = localStorage.getItem("theme") || "auto";
44
+ </script>
45
+
46
+
47
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
48
+ <symbol id="svg-toc" viewBox="0 0 24 24">
49
+ <title>Contents</title>
50
+ <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
51
+ <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
52
+ </svg>
53
+ </symbol>
54
+ <symbol id="svg-menu" viewBox="0 0 24 24">
55
+ <title>Menu</title>
56
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
57
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
58
+ <line x1="3" y1="12" x2="21" y2="12"></line>
59
+ <line x1="3" y1="6" x2="21" y2="6"></line>
60
+ <line x1="3" y1="18" x2="21" y2="18"></line>
61
+ </svg>
62
+ </symbol>
63
+ <symbol id="svg-arrow-right" viewBox="0 0 24 24">
64
+ <title>Expand</title>
65
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
66
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
67
+ <polyline points="9 18 15 12 9 6"></polyline>
68
+ </svg>
69
+ </symbol>
70
+ <symbol id="svg-sun" viewBox="0 0 24 24">
71
+ <title>Light mode</title>
72
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
73
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
74
+ <circle cx="12" cy="12" r="5"></circle>
75
+ <line x1="12" y1="1" x2="12" y2="3"></line>
76
+ <line x1="12" y1="21" x2="12" y2="23"></line>
77
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
78
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
79
+ <line x1="1" y1="12" x2="3" y2="12"></line>
80
+ <line x1="21" y1="12" x2="23" y2="12"></line>
81
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
82
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
83
+ </svg>
84
+ </symbol>
85
+ <symbol id="svg-moon" viewBox="0 0 24 24">
86
+ <title>Dark mode</title>
87
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
88
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
89
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
90
+ <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
91
+ </svg>
92
+ </symbol>
93
+ <symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
94
+ <title>Auto light/dark, in light mode</title>
95
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
96
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
97
+ class="icon-custom-derived-from-feather-sun-and-tabler-moon">
98
+ <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/>
99
+ <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/>
100
+ <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/>
101
+ <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/>
102
+ <line x1="19" y1="14.05" x2="20.414" y2="15.464"/>
103
+ <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/>
104
+ <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/>
105
+ <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/>
106
+ <line x1="19" y1="5.05" x2="20.414" y2="3.636"/>
107
+ <circle cx="14.5" cy="9.55" r="3.6"/>
108
+ </svg>
109
+ </symbol>
110
+ <symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
111
+ <title>Auto light/dark, in dark mode</title>
112
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
113
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
114
+ class="icon-custom-derived-from-feather-sun-and-tabler-moon">
115
+ <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/>
116
+ <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/>
117
+ <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/>
118
+ <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/>
119
+ <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/>
120
+ <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/>
121
+ <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/>
122
+ <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/>
123
+ <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/>
124
+ <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/>
125
+ </svg>
126
+ </symbol>
127
+ <symbol id="svg-pencil" viewBox="0 0 24 24">
128
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
129
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code">
130
+ <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
131
+ <path d="M13.5 6.5l4 4" />
132
+ <path d="M20 21l2 -2l-2 -2" />
133
+ <path d="M17 17l-2 2l2 2" />
134
+ </svg>
135
+ </symbol>
136
+ <symbol id="svg-eye" viewBox="0 0 24 24">
137
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
138
+ stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code">
139
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
140
+ <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
141
+ <path
142
+ d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" />
143
+ <path d="M20 21l2 -2l-2 -2" />
144
+ <path d="M17 17l-2 2l2 2" />
145
+ </svg>
146
+ </symbol>
147
+ </svg>
148
+
149
+ <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
150
+ <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
151
+ <label class="overlay sidebar-overlay" for="__navigation">
152
+ <div class="visually-hidden">Hide navigation sidebar</div>
153
+ </label>
154
+ <label class="overlay toc-overlay" for="__toc">
155
+ <div class="visually-hidden">Hide table of contents sidebar</div>
156
+ </label>
157
+
158
+ <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
159
+
160
+
161
+
162
+ <div class="page">
163
+ <header class="mobile-header">
164
+ <div class="header-left">
165
+ <label class="nav-overlay-icon" for="__navigation">
166
+ <div class="visually-hidden">Toggle site navigation sidebar</div>
167
+ <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
168
+ </label>
169
+ </div>
170
+ <div class="header-center">
171
+ <a href="index.html"><div class="brand">IBM Envizi - Emissions API Node.js SDK documentation</div></a>
172
+ </div>
173
+ <div class="header-right">
174
+ <div class="theme-toggle-container theme-toggle-header">
175
+ <button class="theme-toggle">
176
+ <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
177
+ <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
178
+ <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
179
+ <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
180
+ <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
181
+ </button>
182
+ </div>
183
+ <label class="toc-overlay-icon toc-header-icon" for="__toc">
184
+ <div class="visually-hidden">Toggle table of contents sidebar</div>
185
+ <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
186
+ </label>
187
+ </div>
188
+ </header>
189
+ <aside class="sidebar-drawer">
190
+ <div class="sidebar-container">
191
+
192
+ <div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
193
+
194
+ <span class="sidebar-brand-text">IBM Envizi - Emissions API Node.js SDK documentation</span>
195
+
196
+ </a><form class="sidebar-search-container" method="get" action="search.html" role="search">
197
+ <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
198
+ <input type="hidden" name="check_keywords" value="yes">
199
+ <input type="hidden" name="area" value="default">
200
+ </form>
201
+ <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
202
+ <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
203
+ <ul class="current">
204
+ <li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
205
+ <li class="toctree-l1 has-children"><a class="reference internal" href="sdk.html">SDK</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of SDK</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
206
+ <li class="toctree-l2"><a class="reference internal" href="client.html">Client</a></li>
207
+ <li class="toctree-l2"><a class="reference internal" href="authentication.html">Authentication</a></li>
208
+ </ul>
209
+ </li>
210
+ <li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
211
+ <li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Troubleshooting Guide</a></li>
212
+ </ul>
213
+
214
+ </div>
215
+ </div>
216
+
217
+ </div>
218
+
219
+ </div>
220
+ </aside>
221
+ <div class="main">
222
+ <div class="content">
223
+ <div class="article-container">
224
+ <a href="#" class="back-to-top muted-link">
225
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
226
+ <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
227
+ </svg>
228
+ <span>Back to top</span>
229
+ </a>
230
+ <div class="content-icon-container">
231
+ <div class="view-this-page">
232
+ <a class="muted-link" href="_sources/troubleshooting.rst.txt" title="View this page">
233
+ <svg><use href="#svg-eye"></use></svg>
234
+ <span class="visually-hidden">View this page</span>
235
+ </a>
236
+ </div>
237
+ <div class="theme-toggle-container theme-toggle-content">
238
+ <button class="theme-toggle">
239
+ <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
240
+ <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
241
+ <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
242
+ <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
243
+ <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
244
+ </button>
245
+ </div>
246
+ <label class="toc-overlay-icon toc-content-icon" for="__toc">
247
+ <div class="visually-hidden">Toggle table of contents sidebar</div>
248
+ <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
249
+ </label>
250
+ </div>
251
+ <article role="main" id="furo-main-content">
252
+ <section id="troubleshooting-guide">
253
+ <h1>Troubleshooting Guide<a class="headerlink" href="#troubleshooting-guide" title="Link to this heading">¶</a></h1>
254
+ <section id="overview">
255
+ <h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">¶</a></h2>
256
+ <p>This document lists all SDK-specific errors that can occur when using the Emissions API Node.js SDK. These errors are related to SDK initialization and client management.</p>
257
+ </section>
258
+ <hr class="docutils" />
259
+ <section id="sdk-initialization-errors">
260
+ <h2>SDK Initialization Errors<a class="headerlink" href="#sdk-initialization-errors" title="Link to this heading">¶</a></h2>
261
+ <section id="configuration-errors">
262
+ <h3>Configuration Errors<a class="headerlink" href="#configuration-errors" title="Link to this heading">¶</a></h3>
263
+ <p>These errors occur when <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> is called with invalid or missing configuration parameters.</p>
264
+ <section id="missing-auth-url-with-custom-host">
265
+ <h4>1. Missing Auth URL with Custom Host<a class="headerlink" href="#missing-auth-url-with-custom-host" title="Link to this heading">¶</a></h4>
266
+ <p><strong>Error Message:</strong></p>
267
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: If custom &quot;host&quot; is provided, &quot;authUrl&quot; must also be provided.
268
+ </pre></div>
269
+ </div>
270
+ <p><strong>Cause:</strong> Custom host URL provided without corresponding authentication URL</p>
271
+ <p><strong>Solution:</strong> Provide both <code class="docutils literal notranslate"><span class="pre">host</span></code> and <code class="docutils literal notranslate"><span class="pre">authUrl</span></code> parameters together</p>
272
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
273
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
274
+ <span class="w"> </span><span class="nx">host</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com&#39;</span><span class="p">,</span>
275
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span><span class="p">,</span>
276
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;org456&#39;</span>
277
+ <span class="w"> </span><span class="c1">// Missing authUrl parameter</span>
278
+ <span class="p">});</span>
279
+ </pre></div>
280
+ </div>
281
+ </section>
282
+ <hr class="docutils" />
283
+ <section id="missing-client-id-with-token">
284
+ <h4>2. Missing Client ID with Token<a class="headerlink" href="#missing-client-id-with-token" title="Link to this heading">¶</a></h4>
285
+ <p><strong>Error Message:</strong></p>
286
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: If token is provided directly, &quot;clientId&quot; must also be provided.
287
+ </pre></div>
288
+ </div>
289
+ <p><strong>Cause:</strong> Pre-existing token provided without client ID</p>
290
+ <p><strong>Solution:</strong> Provide <code class="docutils literal notranslate"><span class="pre">clientId</span></code> parameter when using a token</p>
291
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
292
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
293
+ <span class="w"> </span><span class="nx">token</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-jwt-token&#39;</span>
294
+ <span class="w"> </span><span class="c1">// Missing clientId parameter</span>
295
+ <span class="p">});</span>
296
+ </pre></div>
297
+ </div>
298
+ </section>
299
+ <hr class="docutils" />
300
+ <section id="missing-parameters-with-api-key">
301
+ <h4>3. Missing Parameters with API Key<a class="headerlink" href="#missing-parameters-with-api-key" title="Link to this heading">¶</a></h4>
302
+ <p><strong>Error Message:</strong></p>
303
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: If apiKey is provided , &quot;clientId&quot; and &quot;OrgId&quot; must also be provided.
304
+ </pre></div>
305
+ </div>
306
+ <p><strong>Cause:</strong> API key authentication requires both client ID and organization ID</p>
307
+ <p><strong>Solution:</strong> Provide <code class="docutils literal notranslate"><span class="pre">apiKey</span></code>, <code class="docutils literal notranslate"><span class="pre">clientId</span></code>, and <code class="docutils literal notranslate"><span class="pre">orgId</span></code> parameters together</p>
308
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
309
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="c1">// Missing orgId</span>
310
+ <span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
311
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-api-key&#39;</span><span class="p">,</span>
312
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span>
313
+ <span class="w"> </span><span class="c1">// Missing orgId parameter</span>
314
+ <span class="p">});</span>
315
+
316
+ <span class="c1">// Or missing clientId</span>
317
+ <span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
318
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-api-key&#39;</span><span class="p">,</span>
319
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;org456&#39;</span>
320
+ <span class="w"> </span><span class="c1">// Missing clientId parameter</span>
321
+ <span class="p">});</span>
322
+ </pre></div>
323
+ </div>
324
+ </section>
325
+ </section>
326
+ <hr class="docutils" />
327
+ <section id="authentication-errors-http-401">
328
+ <h3>Authentication Errors (HTTP 401)<a class="headerlink" href="#authentication-errors-http-401" title="Link to this heading">¶</a></h3>
329
+ <p>These errors occur when authentication credentials are invalid or expired.</p>
330
+ <section id="invalid-api-key">
331
+ <h4>4. Invalid API Key<a class="headerlink" href="#invalid-api-key" title="Link to this heading">¶</a></h4>
332
+ <p><strong>Error Response:</strong></p>
333
+ <div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
334
+ <span class="w"> </span><span class="nt">&quot;httpCode&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;401&quot;</span><span class="p">,</span>
335
+ <span class="w"> </span><span class="nt">&quot;httpMessage&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Unauthorized&quot;</span><span class="p">,</span>
336
+ <span class="w"> </span><span class="nt">&quot;moreInformation&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Cannot pass the security checks that are required by the target API or operation, Enable debug headers for more details.&quot;</span>
337
+ <span class="p">}</span>
338
+ </pre></div>
339
+ </div>
340
+ <p><strong>Cause:</strong> API key is invalid, expired, or revoked</p>
341
+ <p><strong>Solution:</strong> Verify API key from IBM Cloud console and ensure it has proper permissions</p>
342
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
343
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
344
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;invalid_api_key_12345&#39;</span><span class="p">,</span>
345
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span><span class="p">,</span>
346
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;org456&#39;</span><span class="p">,</span>
347
+ <span class="w"> </span><span class="nx">host</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com&#39;</span><span class="p">,</span>
348
+ <span class="w"> </span><span class="nx">authUrl</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com/auth-url&#39;</span>
349
+ <span class="p">});</span>
350
+ </pre></div>
351
+ </div>
352
+ </section>
353
+ <hr class="docutils" />
354
+ <section id="invalid-organization-id">
355
+ <h4>5. Invalid Organization ID<a class="headerlink" href="#invalid-organization-id" title="Link to this heading">¶</a></h4>
356
+ <p><strong>Error Response:</strong></p>
357
+ <div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
358
+ <span class="w"> </span><span class="nt">&quot;httpCode&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;401&quot;</span><span class="p">,</span>
359
+ <span class="w"> </span><span class="nt">&quot;httpMessage&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Unauthorized&quot;</span><span class="p">,</span>
360
+ <span class="w"> </span><span class="nt">&quot;moreInformation&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Cannot pass the security checks that are required by the target API or operation, Enable debug headers for more details.&quot;</span>
361
+ <span class="p">}</span>
362
+ </pre></div>
363
+ </div>
364
+ <p><strong>Cause:</strong> Organization ID doesn’t match account or user lacks access</p>
365
+ <p><strong>Solution:</strong> Verify organization ID from IBM Cloud account settings</p>
366
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
367
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
368
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-valid-api-key&#39;</span><span class="p">,</span>
369
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span><span class="p">,</span>
370
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;invalid-org-id-12345&#39;</span><span class="p">,</span>
371
+ <span class="w"> </span><span class="nx">host</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com&#39;</span><span class="p">,</span>
372
+ <span class="w"> </span><span class="nx">authUrl</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com/auth-url&#39;</span>
373
+ <span class="p">});</span>
374
+ </pre></div>
375
+ </div>
376
+ </section>
377
+ <hr class="docutils" />
378
+ <section id="invalid-client-id">
379
+ <h4>6. Invalid Client ID<a class="headerlink" href="#invalid-client-id" title="Link to this heading">¶</a></h4>
380
+ <p><strong>Error Response:</strong></p>
381
+ <div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
382
+ <span class="w"> </span><span class="nt">&quot;httpCode&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;401&quot;</span><span class="p">,</span>
383
+ <span class="w"> </span><span class="nt">&quot;httpMessage&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Unauthorized&quot;</span><span class="p">,</span>
384
+ <span class="w"> </span><span class="nt">&quot;moreInformation&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Invalid client id or secret.&quot;</span>
385
+ <span class="p">}</span>
386
+ </pre></div>
387
+ </div>
388
+ <p><strong>Cause:</strong> Client ID is invalid or doesn’t match credentials</p>
389
+ <p><strong>Solution:</strong> Verify client ID from IBM Cloud credentials</p>
390
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
391
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
392
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-valid-api-key&#39;</span><span class="p">,</span>
393
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;invalid-client-id-12345&#39;</span><span class="p">,</span>
394
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;org456&#39;</span><span class="p">,</span>
395
+ <span class="w"> </span><span class="nx">host</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com&#39;</span><span class="p">,</span>
396
+ <span class="w"> </span><span class="nx">authUrl</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com/auth-url&#39;</span>
397
+ <span class="p">});</span>
398
+ </pre></div>
399
+ </div>
400
+ </section>
401
+ <hr class="docutils" />
402
+ <section id="empty-token-response">
403
+ <h4>7. Empty Token Response<a class="headerlink" href="#empty-token-response" title="Link to this heading">¶</a></h4>
404
+ <p><strong>Error Message:</strong></p>
405
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: Token response is empty
406
+ </pre></div>
407
+ </div>
408
+ <p><strong>Cause:</strong> Authentication server returned an empty or null token in the response body</p>
409
+ <p><strong>Solution:</strong></p>
410
+ <ul class="simple">
411
+ <li><p>Verify the <code class="docutils literal notranslate"><span class="pre">authUrl</span></code> is correct and points to a valid authentication endpoint</p></li>
412
+ <li><p>Ensure the authentication service is responding correctly</p></li>
413
+ <li><p>Check that the API key, client ID, and org ID combination is valid</p></li>
414
+ <li><p>Verify the authentication endpoint is returning a token in the response</p></li>
415
+ <li><p>Contact support if the authentication service is not responding properly</p></li>
416
+ </ul>
417
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
418
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
419
+ <span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;your-api-key&#39;</span><span class="p">,</span>
420
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span><span class="p">,</span>
421
+ <span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;org456&#39;</span><span class="p">,</span>
422
+ <span class="w"> </span><span class="nx">host</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://api.ibm.com/&#39;</span><span class="p">,</span>
423
+ <span class="w"> </span><span class="nx">authUrl</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;https://valid-url-but-returns-empty-token.example.com/token&#39;</span>
424
+ <span class="w"> </span><span class="c1">// Valid URL but returns empty token in response</span>
425
+ <span class="p">});</span>
426
+ </pre></div>
427
+ </div>
428
+ <p><strong>Note:</strong> If the authUrl is completely invalid or unreachable (e.g., wrong domain), you’ll get a network error (ENOTFOUND) instead of this error. This error specifically occurs when the authentication endpoint responds but returns an empty token.</p>
429
+ </section>
430
+ <hr class="docutils" />
431
+ <section id="missing-expiry-field-in-token">
432
+ <h4>8. Missing Expiry Field in Token<a class="headerlink" href="#missing-expiry-field-in-token" title="Link to this heading">¶</a></h4>
433
+ <p><strong>Error Message:</strong></p>
434
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: exp field is missing in the token
435
+ </pre></div>
436
+ </div>
437
+ <p><strong>Cause:</strong> The provided JWT token does not contain the required <code class="docutils literal notranslate"><span class="pre">exp</span></code> (expiry) field</p>
438
+ <p><strong>Solution:</strong></p>
439
+ <ul class="simple">
440
+ <li><p>Ensure the token is a valid JWT with an expiry field</p></li>
441
+ <li><p>Regenerate the token if it’s malformed</p></li>
442
+ <li><p>Verify the token was generated correctly by the authentication service</p></li>
443
+ </ul>
444
+ <p><strong>Sample Function Call That Causes This Error:</strong></p>
445
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
446
+ <span class="w"> </span><span class="nx">token</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;malformed-jwt-token-without-exp-field&#39;</span><span class="p">,</span>
447
+ <span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;client123&#39;</span>
448
+ <span class="p">});</span>
449
+ </pre></div>
450
+ </div>
451
+ <p><strong>Note:</strong> This error occurs when using token-based authentication with a JWT that doesn’t include the standard <code class="docutils literal notranslate"><span class="pre">exp</span></code> (expiration time) claim.</p>
452
+ </section>
453
+ </section>
454
+ </section>
455
+ <hr class="docutils" />
456
+ <section id="client-instance-errors">
457
+ <h2>Client Instance Errors<a class="headerlink" href="#client-instance-errors" title="Link to this heading">¶</a></h2>
458
+ <section id="client-not-initialized">
459
+ <h3>Client Not Initialized<a class="headerlink" href="#client-not-initialized" title="Link to this heading">¶</a></h3>
460
+ <p><strong>Error Message:</strong></p>
461
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Error: Client is not initialized. Call Client.getClient() first.
462
+ </pre></div>
463
+ </div>
464
+ <p><strong>Cause:</strong> Attempting to use <code class="docutils literal notranslate"><span class="pre">Client.getInstance()</span></code> or API methods before calling <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code></p>
465
+ <p><strong>Solution:</strong> Always call <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> before using any SDK methods</p>
466
+ <p><strong>When This Occurs:</strong></p>
467
+ <ul class="simple">
468
+ <li><p>Calling <code class="docutils literal notranslate"><span class="pre">Client.getInstance()</span></code> before initialization</p></li>
469
+ <li><p>Calling any API method (Stationary.calculate(), Mobile.calculate(), etc.) before initialization</p></li>
470
+ <li><p>Application restart without re-initializing the client</p></li>
471
+ </ul>
472
+ <p><strong>Sample Function Calls That Cause This Error:</strong></p>
473
+ <div class="highlight-typescript notranslate"><div class="highlight"><pre><span></span><span class="c1">// Error 1: Calling getInstance() before initialization</span>
474
+ <span class="kd">const</span><span class="w"> </span><span class="nx">client</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getInstance</span><span class="p">();</span><span class="w"> </span><span class="c1">// Throws error</span>
475
+
476
+ <span class="c1">// Error 2: Calling API methods before initialization</span>
477
+ <span class="k">await</span><span class="w"> </span><span class="nx">Stationary</span><span class="p">.</span><span class="nx">calculate</span><span class="p">({</span>
478
+ <span class="w"> </span><span class="nx">time</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">date</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;2025-01-04&quot;</span><span class="w"> </span><span class="p">},</span>
479
+ <span class="w"> </span><span class="nx">location</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">country</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;usa&quot;</span><span class="w"> </span><span class="p">},</span>
480
+ <span class="w"> </span><span class="nx">activity</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kr">type</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;Coal - Lignite&quot;</span><span class="p">,</span><span class="w"> </span><span class="nx">unit</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;KJ&quot;</span><span class="p">,</span><span class="w"> </span><span class="nx">value</span><span class="o">:</span><span class="w"> </span><span class="kt">3</span><span class="w"> </span><span class="p">}</span>
481
+ <span class="p">});</span><span class="w"> </span><span class="c1">// Throws error</span>
482
+
483
+ <span class="c1">// Error 3: Calling any other API method</span>
484
+ <span class="k">await</span><span class="w"> </span><span class="nx">Mobile</span><span class="p">.</span><span class="nx">calculate</span><span class="p">({...});</span><span class="w"> </span><span class="c1">// Throws error</span>
485
+ <span class="k">await</span><span class="w"> </span><span class="nx">Fugitive</span><span class="p">.</span><span class="nx">calculate</span><span class="p">({...});</span><span class="w"> </span><span class="c1">// Throws error</span>
486
+ <span class="k">await</span><span class="w"> </span><span class="nx">Location</span><span class="p">.</span><span class="nx">getUnits</span><span class="p">(</span><span class="s2">&quot;steam&quot;</span><span class="p">);</span><span class="w"> </span><span class="c1">// Throws error</span>
487
+ </pre></div>
488
+ </div>
489
+ </section>
490
+ </section>
491
+ <hr class="docutils" />
492
+ <section id="token-management">
493
+ <h2>Token Management<a class="headerlink" href="#token-management" title="Link to this heading">¶</a></h2>
494
+ <section id="automatic-token-refresh">
495
+ <h3>Automatic Token Refresh<a class="headerlink" href="#automatic-token-refresh" title="Link to this heading">¶</a></h3>
496
+ <p>The SDK automatically refreshes authentication tokens when they are about to expire (within 60 seconds). Token refresh failures will cause subsequent API calls to fail with 401 errors.</p>
497
+ <p><strong>Note:</strong> Token refresh only occurs for tokens generated by the SDK, not for user-provided tokens.</p>
498
+ </section>
499
+ </section>
500
+ <hr class="docutils" />
501
+ <section id="error-summary-table">
502
+ <h2>Error Summary Table<a class="headerlink" href="#error-summary-table" title="Link to this heading">¶</a></h2>
503
+ <div class="table-wrapper colwidths-given docutils container">
504
+ <table class="docutils align-default">
505
+ <colgroup>
506
+ <col style="width: 20.0%" />
507
+ <col style="width: 40.0%" />
508
+ <col style="width: 10.0%" />
509
+ <col style="width: 30.0%" />
510
+ </colgroup>
511
+ <thead>
512
+ <tr class="row-odd"><th class="head"><p>Error Type</p></th>
513
+ <th class="head"><p>Error Message</p></th>
514
+ <th class="head"><p>HTTP Code</p></th>
515
+ <th class="head"><p>Solution</p></th>
516
+ </tr>
517
+ </thead>
518
+ <tbody>
519
+ <tr class="row-even"><td><p>Configuration</p></td>
520
+ <td><p><code class="docutils literal notranslate"><span class="pre">If</span> <span class="pre">custom</span> <span class="pre">&quot;host&quot;</span> <span class="pre">is</span> <span class="pre">provided,</span> <span class="pre">&quot;authUrl&quot;</span> <span class="pre">must</span> <span class="pre">also</span> <span class="pre">be</span> <span class="pre">provided.</span></code></p></td>
521
+ <td><p>N/A</p></td>
522
+ <td><p>Provide both host and authUrl</p></td>
523
+ </tr>
524
+ <tr class="row-odd"><td><p>Configuration</p></td>
525
+ <td><p><code class="docutils literal notranslate"><span class="pre">If</span> <span class="pre">token</span> <span class="pre">is</span> <span class="pre">provided</span> <span class="pre">directly,</span> <span class="pre">&quot;clientId&quot;</span> <span class="pre">must</span> <span class="pre">also</span> <span class="pre">be</span> <span class="pre">provided.</span></code></p></td>
526
+ <td><p>N/A</p></td>
527
+ <td><p>Provide clientId with token</p></td>
528
+ </tr>
529
+ <tr class="row-even"><td><p>Configuration</p></td>
530
+ <td><p><code class="docutils literal notranslate"><span class="pre">If</span> <span class="pre">apiKey</span> <span class="pre">is</span> <span class="pre">provided</span> <span class="pre">,</span> <span class="pre">&quot;clientId&quot;</span> <span class="pre">and</span> <span class="pre">&quot;OrgId&quot;</span> <span class="pre">must</span> <span class="pre">also</span> <span class="pre">be</span> <span class="pre">provided.</span></code></p></td>
531
+ <td><p>N/A</p></td>
532
+ <td><p>Provide all three parameters</p></td>
533
+ </tr>
534
+ <tr class="row-odd"><td><p>Authentication</p></td>
535
+ <td><p><code class="docutils literal notranslate"><span class="pre">Cannot</span> <span class="pre">pass</span> <span class="pre">the</span> <span class="pre">security</span> <span class="pre">checks...</span></code></p></td>
536
+ <td><p>401</p></td>
537
+ <td><p>Verify API key and org ID</p></td>
538
+ </tr>
539
+ <tr class="row-even"><td><p>Authentication</p></td>
540
+ <td><p><code class="docutils literal notranslate"><span class="pre">Invalid</span> <span class="pre">client</span> <span class="pre">id</span> <span class="pre">or</span> <span class="pre">secret</span></code></p></td>
541
+ <td><p>401</p></td>
542
+ <td><p>Verify client ID</p></td>
543
+ </tr>
544
+ <tr class="row-odd"><td><p>Authentication</p></td>
545
+ <td><p><code class="docutils literal notranslate"><span class="pre">Token</span> <span class="pre">response</span> <span class="pre">is</span> <span class="pre">empty</span></code></p></td>
546
+ <td><p>N/A</p></td>
547
+ <td><p>Check network and authUrl</p></td>
548
+ </tr>
549
+ <tr class="row-even"><td><p>Token</p></td>
550
+ <td><p><code class="docutils literal notranslate"><span class="pre">exp</span> <span class="pre">field</span> <span class="pre">is</span> <span class="pre">missing</span> <span class="pre">in</span> <span class="pre">the</span> <span class="pre">token</span></code></p></td>
551
+ <td><p>N/A</p></td>
552
+ <td><p>Use valid JWT with exp field</p></td>
553
+ </tr>
554
+ <tr class="row-odd"><td><p>Instance</p></td>
555
+ <td><p><code class="docutils literal notranslate"><span class="pre">Client</span> <span class="pre">is</span> <span class="pre">not</span> <span class="pre">initialized.</span> <span class="pre">Call</span> <span class="pre">Client.getClient()</span> <span class="pre">first.</span></code></p></td>
556
+ <td><p>N/A</p></td>
557
+ <td><p>Call getClient() first</p></td>
558
+ </tr>
559
+ </tbody>
560
+ </table>
561
+ </div>
562
+ </section>
563
+ <hr class="docutils" />
564
+ <section id="required-configuration-parameters">
565
+ <h2>Required Configuration Parameters<a class="headerlink" href="#required-configuration-parameters" title="Link to this heading">¶</a></h2>
566
+ <p>When calling <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code>, the following parameters are required based on authentication method:</p>
567
+ <section id="api-key-authentication-recommended">
568
+ <h3>API Key Authentication (Recommended)<a class="headerlink" href="#api-key-authentication-recommended" title="Link to this heading">¶</a></h3>
569
+ <ul class="simple">
570
+ <li><p><code class="docutils literal notranslate"><span class="pre">apiKey</span></code> - Your IBM Cloud API key</p></li>
571
+ <li><p><code class="docutils literal notranslate"><span class="pre">clientId</span></code> - Your client ID</p></li>
572
+ <li><p><code class="docutils literal notranslate"><span class="pre">orgId</span></code> - Your organization ID</p></li>
573
+ <li><p><code class="docutils literal notranslate"><span class="pre">host</span></code> - API host URL</p></li>
574
+ <li><p><code class="docutils literal notranslate"><span class="pre">authUrl</span></code> - Authentication URL</p></li>
575
+ </ul>
576
+ </section>
577
+ <section id="token-authentication">
578
+ <h3>Token Authentication<a class="headerlink" href="#token-authentication" title="Link to this heading">¶</a></h3>
579
+ <ul class="simple">
580
+ <li><p><code class="docutils literal notranslate"><span class="pre">token</span></code> - Pre-existing JWT token</p></li>
581
+ <li><p><code class="docutils literal notranslate"><span class="pre">clientId</span></code> - Your client ID</p></li>
582
+ </ul>
583
+ </section>
584
+ </section>
585
+ <hr class="docutils" />
586
+ <section id="initialization-checklist">
587
+ <h2>Initialization Checklist<a class="headerlink" href="#initialization-checklist" title="Link to this heading">¶</a></h2>
588
+ <p>Before using the SDK, ensure:</p>
589
+ <ul class="simple">
590
+ <li><p>[ ] All required configuration parameters are provided</p></li>
591
+ <li><p>[ ] Credentials are valid and not expired</p></li>
592
+ <li><p>[ ] Correct environment URLs are used</p></li>
593
+ <li><p>[ ] <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> is called before any API methods</p></li>
594
+ <li><p>[ ] Error handling is implemented for initialization failures</p></li>
595
+ <li><p>[ ] Credentials are stored securely (environment variables recommended)</p></li>
596
+ </ul>
597
+ </section>
598
+ <hr class="docutils" />
599
+ <section id="common-scenarios">
600
+ <h2>Common Scenarios<a class="headerlink" href="#common-scenarios" title="Link to this heading">¶</a></h2>
601
+ <section id="scenario-1-application-startup">
602
+ <h3>Scenario 1: Application Startup<a class="headerlink" href="#scenario-1-application-startup" title="Link to this heading">¶</a></h3>
603
+ <p><strong>Issue:</strong> SDK must be initialized when application starts</p>
604
+ <p><strong>Solution:</strong> Call <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> in application initialization code before using any API methods</p>
605
+ </section>
606
+ <section id="scenario-2-invalid-credentials">
607
+ <h3>Scenario 2: Invalid Credentials<a class="headerlink" href="#scenario-2-invalid-credentials" title="Link to this heading">¶</a></h3>
608
+ <p><strong>Issue:</strong> 401 Unauthorized errors during initialization</p>
609
+ <p><strong>Solution:</strong> Verify all credentials (API key, client ID, org ID) from IBM Cloud console</p>
610
+ </section>
611
+ <section id="scenario-3-missing-configuration">
612
+ <h3>Scenario 3: Missing Configuration<a class="headerlink" href="#scenario-3-missing-configuration" title="Link to this heading">¶</a></h3>
613
+ <p><strong>Issue:</strong> Configuration error thrown before API call</p>
614
+ <p><strong>Solution:</strong> Ensure all required parameters are provided based on authentication method</p>
615
+ </section>
616
+ <section id="scenario-4-client-not-initialized">
617
+ <h3>Scenario 4: Client Not Initialized<a class="headerlink" href="#scenario-4-client-not-initialized" title="Link to this heading">¶</a></h3>
618
+ <p><strong>Issue:</strong> Error when calling API methods</p>
619
+ <p><strong>Solution:</strong> Verify <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> was called successfully before using API methods</p>
620
+ </section>
621
+ </section>
622
+ <hr class="docutils" />
623
+ <section id="troubleshooting-steps">
624
+ <h2>Troubleshooting Steps<a class="headerlink" href="#troubleshooting-steps" title="Link to this heading">¶</a></h2>
625
+ <ol class="arabic simple">
626
+ <li><p><strong>Verify Configuration</strong></p>
627
+ <ul class="simple">
628
+ <li><p>Check all required parameters are provided</p></li>
629
+ <li><p>Ensure no parameters are empty or null</p></li>
630
+ <li><p>Verify host and authUrl match your environment</p></li>
631
+ </ul>
632
+ </li>
633
+ <li><p><strong>Verify Credentials</strong></p>
634
+ <ul class="simple">
635
+ <li><p>Confirm API key is valid and not expired</p></li>
636
+ <li><p>Check organization ID matches your IBM Cloud account</p></li>
637
+ <li><p>Verify client ID is correct</p></li>
638
+ </ul>
639
+ </li>
640
+ <li><p><strong>Check Initialization</strong></p>
641
+ <ul class="simple">
642
+ <li><p>Ensure <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> is called before API methods</p></li>
643
+ <li><p>Verify initialization completed without errors</p></li>
644
+ <li><p>Check for any error messages during initialization</p></li>
645
+ </ul>
646
+ </li>
647
+ <li><p><strong>Network and Service</strong></p>
648
+ <ul class="simple">
649
+ <li><p>Verify network connectivity</p></li>
650
+ <li><p>Check authentication service availability</p></li>
651
+ <li><p>Ensure firewall allows connections to IBM Cloud</p></li>
652
+ </ul>
653
+ </li>
654
+ </ol>
655
+ </section>
656
+ <hr class="docutils" />
657
+ <section id="support">
658
+ <h2>Support<a class="headerlink" href="#support" title="Link to this heading">¶</a></h2>
659
+ <p>For issues not covered in this guide:</p>
660
+ <ol class="arabic simple">
661
+ <li><p>Verify SDK version is up to date</p></li>
662
+ <li><p>Check IBM Cloud service status</p></li>
663
+ <li><p>Review error messages and HTTP status codes</p></li>
664
+ <li><p>Contact IBM Support with:</p>
665
+ <ul class="simple">
666
+ <li><p>Error message and stack trace</p></li>
667
+ <li><p>SDK version</p></li>
668
+ <li><p>Environment details</p></li>
669
+ <li><p>Steps to reproduce (excluding sensitive credentials)</p></li>
670
+ </ul>
671
+ </li>
672
+ </ol>
673
+ <hr class="docutils" />
674
+ <p><strong>Last Updated:</strong> 2025-11-24</p>
675
+ <p><strong>SDK Version:</strong> 1.0.1</p>
676
+ <p><strong>Coverage:</strong> SDK initialization, client instance, and authentication errors</p>
677
+ </section>
678
+ </section>
679
+
680
+ </article>
681
+ </div>
682
+ <footer>
683
+
684
+ <div class="related-pages">
685
+
686
+ <a class="prev-page" href="reference.html">
687
+ <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
688
+ <div class="page-info">
689
+ <div class="context">
690
+ <span>Previous</span>
691
+ </div>
692
+
693
+ <div class="title">Reference</div>
694
+
695
+ </div>
696
+ </a>
697
+ </div>
698
+ <div class="bottom-of-page">
699
+ <div class="left-details">
700
+ <div class="copyright">
701
+ Copyright &#169; 2025, IBM Corporation
702
+ </div>
703
+ Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
704
+
705
+ <a href="https://github.com/pradyunsg/furo">Furo</a>
706
+
707
+ </div>
708
+ <div class="right-details">
709
+
710
+ </div>
711
+ </div>
712
+
713
+ </footer>
714
+ </div>
715
+ <aside class="toc-drawer">
716
+
717
+
718
+ <div class="toc-sticky toc-scroll">
719
+ <div class="toc-title-container">
720
+ <span class="toc-title">
721
+ On this page
722
+ </span>
723
+ </div>
724
+ <div class="toc-tree-container">
725
+ <div class="toc-tree">
726
+ <ul>
727
+ <li><a class="reference internal" href="#">Troubleshooting Guide</a><ul>
728
+ <li><a class="reference internal" href="#overview">Overview</a></li>
729
+ <li><a class="reference internal" href="#sdk-initialization-errors">SDK Initialization Errors</a><ul>
730
+ <li><a class="reference internal" href="#configuration-errors">Configuration Errors</a><ul>
731
+ <li><a class="reference internal" href="#missing-auth-url-with-custom-host">1. Missing Auth URL with Custom Host</a></li>
732
+ <li><a class="reference internal" href="#missing-client-id-with-token">2. Missing Client ID with Token</a></li>
733
+ <li><a class="reference internal" href="#missing-parameters-with-api-key">3. Missing Parameters with API Key</a></li>
734
+ </ul>
735
+ </li>
736
+ <li><a class="reference internal" href="#authentication-errors-http-401">Authentication Errors (HTTP 401)</a><ul>
737
+ <li><a class="reference internal" href="#invalid-api-key">4. Invalid API Key</a></li>
738
+ <li><a class="reference internal" href="#invalid-organization-id">5. Invalid Organization ID</a></li>
739
+ <li><a class="reference internal" href="#invalid-client-id">6. Invalid Client ID</a></li>
740
+ <li><a class="reference internal" href="#empty-token-response">7. Empty Token Response</a></li>
741
+ <li><a class="reference internal" href="#missing-expiry-field-in-token">8. Missing Expiry Field in Token</a></li>
742
+ </ul>
743
+ </li>
744
+ </ul>
745
+ </li>
746
+ <li><a class="reference internal" href="#client-instance-errors">Client Instance Errors</a><ul>
747
+ <li><a class="reference internal" href="#client-not-initialized">Client Not Initialized</a></li>
748
+ </ul>
749
+ </li>
750
+ <li><a class="reference internal" href="#token-management">Token Management</a><ul>
751
+ <li><a class="reference internal" href="#automatic-token-refresh">Automatic Token Refresh</a></li>
752
+ </ul>
753
+ </li>
754
+ <li><a class="reference internal" href="#error-summary-table">Error Summary Table</a></li>
755
+ <li><a class="reference internal" href="#required-configuration-parameters">Required Configuration Parameters</a><ul>
756
+ <li><a class="reference internal" href="#api-key-authentication-recommended">API Key Authentication (Recommended)</a></li>
757
+ <li><a class="reference internal" href="#token-authentication">Token Authentication</a></li>
758
+ </ul>
759
+ </li>
760
+ <li><a class="reference internal" href="#initialization-checklist">Initialization Checklist</a></li>
761
+ <li><a class="reference internal" href="#common-scenarios">Common Scenarios</a><ul>
762
+ <li><a class="reference internal" href="#scenario-1-application-startup">Scenario 1: Application Startup</a></li>
763
+ <li><a class="reference internal" href="#scenario-2-invalid-credentials">Scenario 2: Invalid Credentials</a></li>
764
+ <li><a class="reference internal" href="#scenario-3-missing-configuration">Scenario 3: Missing Configuration</a></li>
765
+ <li><a class="reference internal" href="#scenario-4-client-not-initialized">Scenario 4: Client Not Initialized</a></li>
766
+ </ul>
767
+ </li>
768
+ <li><a class="reference internal" href="#troubleshooting-steps">Troubleshooting Steps</a></li>
769
+ <li><a class="reference internal" href="#support">Support</a></li>
770
+ </ul>
771
+ </li>
772
+ </ul>
773
+
774
+ </div>
775
+ </div>
776
+ </div>
777
+
778
+
779
+ </aside>
780
+ </div>
781
+ </div><script src="_static/documentation_options.js?v=5929fcd5"></script>
782
+ <script src="_static/doctools.js?v=9bcbadda"></script>
783
+ <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
784
+ <script src="_static/scripts/furo.js?v=46bd48cc"></script>
785
+ </body>
786
+ </html>