-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.json
1 lines (1 loc) · 5.13 KB
/
api.json
1
{"openapi":"3.0.1","info":{"description":"Service for contacting respondents via Gov Notify SMS messages","title":"Notify Service","version":"v1"},"servers":[{"url":"http://localhost:8162"}],"paths":{"/email-fulfilment":{"post":{"description":"Email Fulfilment Request","operationId":"emailFulfilment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDTO"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailFulfilmentResponseSuccess"}}},"description":"Send an email fulfilment for a case. Returns uacHash & QID if template has UAC/QID, or empty response if not"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailFulfilmentResponseError"}}},"description":"Email Fulfilment request failed validation"},"500":{"description":"Error with Gov Notify when attempting to send email"}},"tags":["email-fulfilment-endpoint"]}},"/sms-fulfilment":{"post":{"description":"SMS Fulfilment Request","operationId":"smsFulfilment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDTO"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsFulfilmentResponseSuccess"}}},"description":"Send an SMS fulfilment for a case. Returns uacHash & QID if template has UAC/QID, or empty response if not"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsFulfilmentResponseError"}}},"description":"SMS Fulfilment request failed validation"},"500":{"description":"Error with Gov Notify when attempting to send SMS"}},"tags":["sms-fulfilment-endpoint"]}}},"components":{"schemas":{"EmailFulfilment":{"type":"object","properties":{"caseId":{"type":"string","description":"The case, which must exist in RM","format":"uuid"},"email":{"type":"string","description":"The target email address, to which we will send a fulfilment","example":"[email protected]"},"packCode":{"type":"string","description":"The pack code, which must exist in RM and the pack code must be allowed on the survey the case belongs to"},"personalisation":{"type":"object","additionalProperties":{"type":"string","description":"Optional personalisation key/value pairs to include in the sent email. Keys must match `__request__.` prefixed fields in the selected template, or they will be ignored","nullable":true,"example":"{\"name\":\"Joe Bloggs\"}"},"description":"Optional personalisation key/value pairs to include in the sent email. Keys must match `__request__.` prefixed fields in the selected template, or they will be ignored","nullable":true,"example":{"name":"Joe Bloggs"}},"uacMetadata":{"type":"object","description":"Metadata for UACQIDLinks"}}},"EmailFulfilmentResponseError":{"type":"object","properties":{"error":{"type":"string"}}},"EmailFulfilmentResponseSuccess":{"type":"object","properties":{"qid":{"type":"string"},"uacHash":{"type":"string"}}},"RequestDTO":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/RequestHeaderDTO"},"payload":{"$ref":"#/components/schemas/RequestPayloadDTO"}}},"RequestHeaderDTO":{"type":"object","properties":{"channel":{"type":"string","description":"The product that is calling the API","example":"RH"},"correlationId":{"type":"string","description":"The ID that connects all the way from the public web load balancer to the backend, and back again","format":"uuid"},"originatingUser":{"type":"string","description":"The ONS user who is triggering this API request via an internal UI","example":"[email protected]"},"source":{"type":"string","description":"The microservice that is calling the API","example":"Survey Enquiry Line API"}}},"RequestPayloadDTO":{"type":"object","properties":{"emailFulfilment":{"$ref":"#/components/schemas/EmailFulfilment"},"smsFulfilment":{"$ref":"#/components/schemas/SmsFulfilment"}}},"SmsFulfilment":{"type":"object","properties":{"caseId":{"type":"string","description":"The case, which must exist in RM","format":"uuid"},"packCode":{"type":"string","description":"The pack code, which must exist in RM and the pack code must be allowed on the survey the case belongs to"},"personalisation":{"type":"object","additionalProperties":{"type":"string","description":"Optional personalisation key/value pairs to include in the sent email. Keys must match `__request__.` prefixed fields in the selected template, or they will be ignored","nullable":true,"example":"{\"name\":\"Joe Bloggs\"}"},"description":"Optional personalisation key/value pairs to include in the sent email. Keys must match `__request__.` prefixed fields in the selected template, or they will be ignored","nullable":true,"example":{"name":"Joe Bloggs"}},"phoneNumber":{"type":"string","description":"The phone number, which must be a UK number consisting of 9 digits, preceded by a `7` and optionally a UK country code or zero (`0`, `044` or `+44`).","example":"+447123456789"},"uacMetadata":{"type":"object","description":"Metadata for UACQIDLinks"}}},"SmsFulfilmentResponseError":{"type":"object","properties":{"error":{"type":"string"}}},"SmsFulfilmentResponseSuccess":{"type":"object","properties":{"qid":{"type":"string"},"uacHash":{"type":"string"}}}}}}