Skip to content

Commit 1b4b3d2

Browse files
committed
updated curl commands and sandbox endpoint refs and added examples to handlers for the sandbox
1 parent 6d783d1 commit 1b4b3d2

7 files changed

Lines changed: 277 additions & 4 deletions

sandbox/Sandbox endpoints - localhost.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
[Manifest Pages - Page 2](http://localhost:9000/manifest/pages/?page=2)
1414

15+
## Health A to Z
16+
17+
[Health A to Z Root](http://localhost:9000/health-a-to-z/)
18+
19+
[Health A to Z: Common conditions](http://localhost:9000/health-a-to-z/conditions)
1520

1621
## Conditions
1722

@@ -168,3 +173,23 @@
168173
[Tests and treatments - Page: 1](http://localhost:9000/tests-and-treatments/?page=1)
169174

170175
[Tests and treatments - Page: 7](http://localhost:9000/tests-and-treatments/?page=7)
176+
177+
## Baby
178+
179+
[Baby Root](http://localhost:9000/baby/)
180+
181+
[First aid and safety](http://localhost:9000/baby/first-aid-and-safety/)
182+
183+
[Support and services](http://localhost:9000/baby/support-and-services/)
184+
185+
[Caring for a newborn](http://localhost:9000/baby/caring-for-a-newborn/)
186+
187+
## Social care and support
188+
189+
[Social care and support Root](http://localhost:9000/social-care-and-support/)
190+
191+
[Introduction to care and support](http://localhost:9000/social-care-and-support/introduction-to-care-and-support/)
192+
193+
[Money, work, benefits and social care](http://localhost:9000/social-care-and-support/money-work-and-benefits/)
194+
195+
[Care after a hospital stay](http://localhost:9000/social-care-and-support/care-after-a-hospital-stay/)

sandbox/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ app.all('/tests-and-treatments/', handlers.testsAndTreatmentsRoot)
229229
// ** Health A to Z
230230
// ******************************************************************
231231
app.all('/health-a-to-z/', handlers.healthAToZRoot)
232-
app.all('/health-a-to-z/common-topics/', handlers.healthAToZCommonTopics)
232+
app.all('/health-a-to-z/conditions/', handlers.healthAToZConditions)
233233

234234
// ******************************************************************
235235
// ** Baby

sandbox/handlers.js

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,22 @@ const testsAndTreatmentsRootCategoryBResponse = require('./responses/tests-and-t
9999
const testsAndTreatmentsRootPage1Response = require('./responses/tests-and-treatments-root-page-1.json')
100100
const testsAndTreatmentsRootPage7Response = require('./responses/tests-and-treatments-root-page-7.json')
101101

102+
// Health A to Z - Responses
103+
const healthAToZRootNoParamsResponse = require('./responses/health-a-to-z-root-no-params.json')
104+
const healthAToZConditionsNoParamsResponse = require('./responses/health-a-to-z-conditions-no-params.json')
105+
106+
// Baby - Responses
107+
const babyRootNoParamsResponse = require('./responses/baby-root-no-params.json')
108+
const babyFirstAidAndSafetyNoParamsResponse = require('./responses/baby-first-aid-and-safety-no-params.json')
109+
const babySupportAndServicesNoParamsResponse = require('./responses/baby-support-and-services-no-params.json')
110+
const babyCaringForANewbornNoParamsResponse = require('./responses/baby-caring-for-a-newborn-no-params.json')
111+
112+
// Social care and support - Responses
113+
const socialCareAndSupportRootNoParamsResponse = require('./responses/social-care-and-support-root-no-params.json')
114+
const socialCareAndSupportIntroductionToCareAndSupportNoParamsResponse = require('./responses/social-care-and-support-introduction-to-care-and-support-no-params.json')
115+
const socialCareAndSupportMoneyWorkAndBenefitsNoParamsResponse = require('./responses/social-care-and-support-money-work-and-benefits-no-params.json')
116+
const socialCareAndSupportCareAfterAHospitalStayNoParamsResponse = require('./responses/social-care-and-support-care-after-a-hospital-stay-no-params.json')
117+
102118
// ******************************************************************
103119
// ** Root page
104120
// ******************************************************************
@@ -1218,6 +1234,139 @@ async function testsAndTreatmentsRoot(req, res, next) {
12181234
next()
12191235
}
12201236

1237+
1238+
// ******************************************************************
1239+
// ** Health A to Z
1240+
// ******************************************************************
1241+
1242+
// Live website URL
1243+
// https://www.nhs.uk/health-a-to-z/
1244+
// This sandbox on localhost
1245+
// http://localhost:9000/health-a-to-z/
1246+
// API on Azure API Management
1247+
// https://api.nhs.uk/health-a-to-z/
1248+
// Wagtail (Python) Application (no auth key required)
1249+
// https://www.nhs.uk/content-api/health-a-to-z/
1250+
// Apigee Sandbox environment (no auth key required)
1251+
// https://sandbox.api.service.nhs.uk/nhs-website-content/health-a-to-z/
1252+
// Apigee Integration environment ('apikey' required in Header)
1253+
// https://int.api.service.nhs.uk/nhs-website-content/health-a-to-z/
1254+
// Apigee Production environment ('apikey' required in Header)
1255+
// https://api.service.nhs.uk/nhs-website-content/health-a-to-z/
1256+
async function healthAToZRoot(req, res, next) {
1257+
res.status(200).json(healthAToZRootNoParamsResponse)
1258+
res.end()
1259+
next()
1260+
}
1261+
1262+
// ******************************************************************
1263+
// ** Health A to Z - Conditions
1264+
// ******************************************************************
1265+
1266+
// Live website URL
1267+
// https://www.nhs.uk/health-a-to-z/conditions/
1268+
// This sandbox on localhost
1269+
// http://localhost:9000/health-a-to-z/conditions/
1270+
// API on Azure API Management
1271+
// https://api.nhs.uk/health-a-to-z/conditions/
1272+
// Wagtail (Python) Application (no auth key required)
1273+
// https://www.nhs.uk/content-api/health-a-to-z/conditions/
1274+
// Apigee Sandbox environment (no auth key required)
1275+
// https://sandbox.api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
1276+
// Apigee Integration environment ('apikey' required in Header)
1277+
// https://int.api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
1278+
// Apigee Production environment ('apikey' required in Header)
1279+
// https://api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
1280+
async function healthAToZConditions(req, res, next) {
1281+
res.status(200).json(healthAToZConditionsNoParamsResponse)
1282+
res.end()
1283+
next()
1284+
}
1285+
1286+
// ******************************************************************
1287+
// ** Baby
1288+
// ******************************************************************
1289+
1290+
// Live website URL
1291+
// https://www.nhs.uk/baby/
1292+
// This sandbox on localhost
1293+
// http://localhost:9000/baby/
1294+
// API on Azure API Management
1295+
// https://api.nhs.uk/baby/
1296+
// Wagtail (Python) Application (no auth key required)
1297+
// https://www.nhs.uk/content-api/baby/
1298+
// Apigee Sandbox environment (no auth key required)
1299+
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/
1300+
// Apigee Integration environment ('apikey' required in Header)
1301+
// https://int.api.service.nhs.uk/nhs-website-content/baby/
1302+
// Apigee Production environment ('apikey' required in Header)
1303+
// https://api.service.nhs.uk/nhs-website-content/baby/
1304+
async function babyRoot(req, res, next) {
1305+
res.status(200).json(babyRootNoParamsResponse)
1306+
res.end()
1307+
next()
1308+
}
1309+
1310+
// Live website URL
1311+
// https://www.nhs.uk/baby/first-aid-and-safety/
1312+
// This sandbox on localhost
1313+
// http://localhost:9000/baby/first-aid-and-safety/
1314+
// API on Azure API Management
1315+
// https://api.nhs.uk/baby/first-aid-and-safety/
1316+
// Wagtail (Python) Application (no auth key required)
1317+
// https://www.nhs.uk/content-api/baby/first-aid-and-safety/
1318+
// Apigee Sandbox environment (no auth key required)
1319+
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
1320+
// Apigee Integration environment ('apikey' required in Header)
1321+
// https://int.api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
1322+
// Apigee Production environment ('apikey' required in Header)
1323+
// https://api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
1324+
async function babyFirstAidAndSafety(req, res, next) {
1325+
res.status(200).json(babyFirstAidAndSafetyNoParamsResponse)
1326+
res.end()
1327+
next()
1328+
}
1329+
1330+
// Live website URL
1331+
// https://www.nhs.uk/baby/caring-for-a-newborn/
1332+
// This sandbox on localhost
1333+
// http://localhost:9000/baby/caring-for-a-newborn/
1334+
// API on Azure API Management
1335+
// https://api.nhs.uk/baby/caring-for-a-newborn/
1336+
// Wagtail (Python) Application (no auth key required)
1337+
// https://www.nhs.uk/content-api/baby/caring-for-a-newborn/
1338+
// Apigee Sandbox environment (no auth key required)
1339+
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
1340+
// Apigee Integration environment ('apikey' required in Header)
1341+
// https://int.api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
1342+
// Apigee Production environment ('apikey' required in Header)
1343+
// https://api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
1344+
async function babyCaringForANewborn(req, res, next) {
1345+
res.status(200).json(babyCaringForANewbornNoParamsResponse)
1346+
res.end()
1347+
next()
1348+
}
1349+
1350+
// Live website URL
1351+
// https://www.nhs.uk/baby/support-and-service/
1352+
// This sandbox on localhost
1353+
// http://localhost:9000/baby/support-and-service/
1354+
// API on Azure API Management
1355+
// https://api.nhs.uk/baby/support-and-service/
1356+
// Wagtail (Python) Application (no auth key required)
1357+
// https://www.nhs.uk/content-api/baby/support-and-service/
1358+
// Apigee Sandbox environment (no auth key required)
1359+
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/support-and-service/
1360+
// Apigee Integration environment ('apikey' required in Header)
1361+
// https://int.api.service.nhs.uk/nhs-website-content/baby/support-and-service/
1362+
// Apigee Production environment ('apikey' required in Header)
1363+
// https://api.service.nhs.uk/nhs-website-content/baby/support-and-service/
1364+
async function babySupportAndServices(req, res, next) {
1365+
res.status(200).json(babySupportAndServicesNoParamsResponse)
1366+
res.end()
1367+
next()
1368+
}
1369+
12211370
// ******************************************************************
12221371
// ** Status
12231372
// ******************************************************************
@@ -1233,9 +1382,67 @@ async function status(req, res, next) {
12331382
next()
12341383
}
12351384

1385+
// ******************************************************************
1386+
// ** Social care and support pages
1387+
// ******************************************************************
1388+
1389+
// Live website URL
1390+
// https://www.nhs.uk/social-care-and-support/
1391+
// This sandbox on localhost
1392+
// http://localhost:9000/social-care-and-support/
1393+
// API on Azure API Management
1394+
// https://api.nhs.uk/social-care-and-support/
1395+
// Wagtail (Python) Application (no auth key required)
1396+
// https://www.nhs.uk/content-api/social-care-and-support/
1397+
// Apigee Sandbox environment (no auth key required)
1398+
// https://sandbox.api.service.nhs.uk/nhs-website-content/social-care-and-support/
1399+
// Apigee Integration environment ('apikey' required in Header)
1400+
// https://int.api.service.nhs.uk/nhs-website-content/social-care-and-support/
1401+
// Apigee Production environment ('apikey' required in Header)
1402+
// https://api.service.nhs.uk/nhs-website-content/social-care-and-support/
1403+
async function socialCareAndSupportRoot(req, res, next) {
1404+
res.status(200).json(socialCareAndSupportRootNoParamsResponse)
1405+
res.end()
1406+
next()
1407+
}
1408+
1409+
// Live website URL
1410+
// https://www.nhs.uk/social-care-and-support/introduction-to-care-and-support/
1411+
// This sandbox on localhost
1412+
// http://localhost:9000/social-care-and-support/introduction-to-care-and-support/
1413+
async function socialCareAndSupportIntroductionToCareAndSupport(req, res, next) {
1414+
res.status(200).json(socialCareAndSupportIntroductionToCareAndSupportNoParamsResponse)
1415+
res.end()
1416+
next()
1417+
}
1418+
1419+
// Live website URL
1420+
// https://www.nhs.uk/social-care-and-support/money-work-and-benefits/
1421+
// This sandbox on localhost
1422+
// http://localhost:9000/social-care-and-support/money-work-and-benefits/
1423+
async function socialCareAndSupportMoneyWorkAndBenefits(req, res, next) {
1424+
res.status(200).json(socialCareAndSupportMoneyWorkAndBenefitsNoParamsResponse)
1425+
res.end()
1426+
next()
1427+
}
1428+
1429+
// Live website URL
1430+
// https://www.nhs.uk/social-care-and-support/care-after-a-hospital-stay/
1431+
// This sandbox on localhost
1432+
// http://localhost:9000/social-care-and-support/care-after-a-hospital-stay/
1433+
async function socialCareAndSupportCareAfterAHospitalStay(req, res, next) {
1434+
res.status(200).json(socialCareAndSupportCareAfterAHospitalStayNoParamsResponse)
1435+
res.end()
1436+
next()
1437+
}
1438+
12361439
module.exports = {
12371440
root,
12381441
manifestPagesRoot,
1442+
babyCaringForANewborn,
1443+
babyFirstAidAndSafety,
1444+
babyRoot,
1445+
babySupportAndServices,
12391446
conditionsAcanthosisNigricans,
12401447
conditionsAchalasia,
12411448
conditionsAcne,
@@ -1248,6 +1455,8 @@ module.exports = {
12481455
contraceptionMethodsOfContraception,
12491456
contraceptionRoot,
12501457
contraceptionWhatIsTheCombinedPill,
1458+
healthAToZRoot,
1459+
healthAToZConditions,
12511460
liveWellAlcoholAdviceAlcoholSupport,
12521461
liveWellExercise,
12531462
liveWellHealthyWeight,
@@ -1277,6 +1486,10 @@ module.exports = {
12771486
womensHealthAnaemia,
12781487
womensHealthPeriods,
12791488
womensHealthRoot,
1489+
socialCareAndSupportRoot,
1490+
socialCareAndSupportIntroductionToCareAndSupport,
1491+
socialCareAndSupportMoneyWorkAndBenefits,
1492+
socialCareAndSupportCareAfterAHospitalStay,
12801493
symptomsRoot,
12811494
testsAndTreatmentsRoot,
12821495
}

sandbox/responses/_curl-commands.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/symptoms/' -H 'apike
2424

2525
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-no-params.json
2626

27+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/health-a-to-z/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/health-a-to-z-root-no-params.json
28+
29+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-root-no-params.json
30+
31+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-root-no-params.json
32+
2733

2834
*****************************************************************************************************************
2935
** Manifest pages **
@@ -36,6 +42,17 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/manifest/pages/?page
3642
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/manifest/pages/?page=2' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/manifest-pages-root-page-2.json
3743

3844

45+
*****************************************************************************************************************
46+
** Baby pages **
47+
*****************************************************************************************************************
48+
49+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-first-aid-and-safety-no-params.json
50+
51+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/support-and-services/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-support-and-services-no-params.json
52+
53+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-caring-for-a-newborn-no-params.json
54+
55+
3956
*****************************************************************************************************************
4057
** Conditions pages **
4158
*****************************************************************************************************************
@@ -191,3 +208,21 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments
191208
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/?page=1' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-page-1.json
192209

193210
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/?page=7' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-page-7.json
211+
212+
213+
*****************************************************************************************************************
214+
** Health A to Z: Common conditions **
215+
*****************************************************************************************************************
216+
217+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/health-a-to-z-conditions-no-params.json
218+
219+
220+
*****************************************************************************************************************
221+
** Social care and support pages **
222+
*****************************************************************************************************************
223+
224+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/introduction-to-care-and-support/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-introduction-to-care-and-support-no-params.json
225+
226+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/money-work-and-benefits/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-money-work-and-benefits-no-params.json
227+
228+
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/care-after-a-hospital-stay/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-care-after-a-hospital-stay-no-params.json
File renamed without changes.

sandbox/responses/health-a-to-z-common-conditions-no-params.json renamed to sandbox/responses/health-a-to-z-conditions-no-params.json

File renamed without changes.

specification/nhs-website-content-api.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ info:
1010
1111
Before April 2025, the Conditions A to Z contained a broad mix of content including conditions, symptoms, tests, treatments, and baby-related information. This has been reorganized into a new Health A to Z hub with content logically grouped into dedicated sections.
1212
13-
The April 2025 update introduces new endpoints for 'health-a-to-z', 'health-a-to-z/common-topics', 'symptoms', 'tests-and-treatments', 'baby' and 'social-care-and-support' that reflect the reallocation of these pages to new A to Z pages on the website.
13+
The April 2025 update introduces new endpoints for 'health-a-to-z', 'health-a-to-z/conditions', 'symptoms', 'tests-and-treatments', 'baby' and 'social-care-and-support' that reflect the reallocation of these pages to new A to Z pages on the website.
1414
1515
You can reuse the content from the following sections of the NHS website:
1616
* Health A to Z ([Website](https://www.nhs.uk/health-a-to-z/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/health-a-to-z))
17-
* Health A to Z - Common topics ([Website](https://www.nhs.uk/health-a-to-z/common-topics/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/health-a-to-z/common-topics))
17+
* Health A to Z - Common topics ([Website](https://www.nhs.uk/health-a-to-z/conditions/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/health-a-to-z/conditions))
1818
* Conditions A to Z ([Website](https://www.nhs.uk/conditions/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/conditions))
1919
* Symptoms A to Z ([Website](https://www.nhs.uk/symptoms/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/symptoms))
2020
* Tests and treatments A to Z ([Website](https://www.nhs.uk/tests-and-treatments/) | [API](https://digital.nhs.uk/developer/api-catalogue/nhs-website-content/v2#get-/tests-and-treatments))
@@ -1091,7 +1091,7 @@ paths:
10911091
responses:
10921092
"200":
10931093
description: |
1094-
A valid query for the baby hub.
1094+
A valid query for the social care and support guide hub.
10951095
content:
10961096
application/json:
10971097
schema:

0 commit comments

Comments
 (0)