You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Update test.html to use correct production API endpoints
- Changed API_URL from /api/public/sheets/series to /api/public/series
- Updated test to use /data endpoint for fetching series data
- Testing with real series ID (wb/NE.EXP.GNFS.ZS/USA) instead of non-existent FRED-GDP
- Updated response parsing to match new API format {seriesId, data: [{date, value}]}
- Improved error handling for 404 responses
// API requires authentication, so 401/403/404 are expected
171
-
if(status===401||status===403||status===404){
172
-
testResults['api']=true;
173
-
resultDiv.className='result success';
174
-
resultDiv.textContent=`✅ API endpoint exists and requires authentication (HTTP ${status})\nThis is expected behavior. Use "Test with API Key" to verify full functionality.`;
171
+
// Unauthenticated requests get limited data (100 observations)
172
+
if(status===200){
173
+
constdata=awaitresponse.json();
174
+
if(data.data&&Array.isArray(data.data)){
175
+
testResults['api']=true;
176
+
resultDiv.className='result success';
177
+
resultDiv.textContent=`✅ API endpoint working!\nSeries: ${data.seriesId}\nData points: ${data.data.length}\nLatest: ${JSON.stringify(data.data[data.data.length-1])}\nHas more: ${data.hasMore}`;
resultDiv.textContent=`❌ HTTP 404: Series not found or incorrect endpoint\nURL: ${response.url}\nError: ${errorData ? JSON.stringify(errorData) : 'Unknown'}`;
188
+
testResults['api']=false;
175
189
updateOverallStatus();
176
190
return;
177
191
}
@@ -211,22 +225,27 @@ <h2>📊 Overall Status</h2>
211
225
resultDiv.textContent='Testing API with authentication...';
0 commit comments