API Pattern: Distribution
- v1:
GET https://<FQDN>/distribution/risky-post-districts
- v2:
GET https://<FQDN>/distribution/risky-post-districts-v2
- FQDN: One (CDN) hostname for all distributed APIs
- Authorization NOT required and signatures provided - see API security
- Payload content-type: application/json
{
"postDistricts": {
"<post district code 1>": "<risk indicator 1>",
"<post district code 2>": "<risk indicator 2>",
"<post district code 3>": "<risk indicator 3>"
}
}
- Acceptable values for the
<risk indicator>
are ["L","M","H"] corresponding to Low, Medium and High. - The payload contains the full list of post districts.
{
"postDistricts": {
"<post district code 1>": "<risk indicator 1>",
"<post district code 2>": "<risk indicator 2>",
"<post district code 3>": "<risk indicator 3>",
…
},
"localAuthorities": {
"<local authority code 1>": "<risk indicator 1>",
"<local authority code 2>": "<risk indicator 2>",
"<local authority code 3>": "<risk indicator 3>",
…
},
"riskLevels": {
"<risk indicator 1>": {
"colorScheme": "yellow",
"colorSchemeV2": "maroon",
"name": {
"en": "[postcode] is in…",
…
},
"heading": {
"en": "Data from NHS shows…",
…
},
"content": {
"en": "Your local authority…",
…
},
"linkTitle": {
"en": "Restrictions in your area",
…
},
"linkUrl": {
"en": "https://gov.uk/somewhere",
…
},
"policyData": {
"localAuthorityRiskTitle": {
"en": "[local authority] ([postcode]) is in",
…
},
"heading": {
"en": "Your area has coronavirus…",
…
},
"content": {
"en": "Your area is inline…",
…
},
"footer": {
"en": "Find out more…",
…
},
"policies": [
{
"policyIcon": "meetingPeople",
"policyHeading": {
"en": "Meeting people",
…
},
"policyContent": {
"en": "Meeting people",
…
},
}, {
"policyIcon": "bars",
"policyHeading": {
"en": "Bars and pubs",
…
},
"policyContent": {
"en": "Venues must close…",
…
}
}],
}
},
…
}
}
- "policyData" field is optional. All other fields are required.
- Acceptable values for the
<risk indicator>
are defined by the API itself. All<risk indicator>
values used must provide their definition as part of theriskLevelIndicators
object. - Acceptable values for
colorSchemeV2
areblack
,maroon
,green
,yellow
,red
,amber
,neutral
. - Acceptable values for
colorScheme
aregreen
,yellow
,red
,amber
,neutral
.- Needs to be the same value as
colorSchemeV2
, fallback for the new values isneutral
, if it's not available in the value list of `colorScheme
- Needs to be the same value as
- Acceptable values for
icon
aredefault-icon
,meeting-people
,bars-and-pubs
,worship
,overnight-stays
,education
,travelling
,exercise
,weddings-and-funerals
,businesses
,retail
,entertainment
,personal-care
,large-events
,clinically-extremely-vulnerable
,social-distancing
,face-coverings
,meeting-outdoors
,meeting-indoors
,work
,international-travel
.- For any unrecognised values the mobile app will fall back to using
default-icon
- For any unrecognised values the mobile app will fall back to using
heading
,content
,name
,title
,linkTitle
, andlinkUrl
,footer
,policyHeading
, andpolicyContent
are localised.heading
,content
, andfooter
may contain multiple paragraphs of text; they may also be left empty (but must not be null)- If the string
[postcode]
appears as part of the fieldname
; this is a hint for clients to replace it with an actual postcode (e.g.NR21
).- (Note: usage of the field
name
changed since it was introduced. It is more appropriate to think of it as a “title” now)
- (Note: usage of the field
- If the string
[postcode]
appears as part of the fieldlocalAuthorityRiskTitle
; this is a hint for clients to replace it with an actual postcode (e.g.NR21
). - If the string
[local authority]
appears as part of the fieldlocalAuthorityRiskTitle
; this is a hint for clients to replace it with an local authority name (e.g.King’s Lynn and West Norfolk
). linkTitle
should be a few words. The clients may use this as part of a button.