Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#168694799] Update specification for CreateMessage #21

Merged
merged 2 commits into from
Sep 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion openapi/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,67 @@ schemes:
security:
- SubscriptionKey: []
paths:
"/messages":
post:
operationId: submitMessageforUserWithFiscalCodeInBody
summary: Submit a Message passing the user fiscal_code in the request body
description: |-
Submits a message to a user.
On error, the reason is returned in the response payload.
In order to call `submitMessageforUser`, before sending any message,
the sender MUST call `getProfile` and check that the profile exists
(for the specified fiscal code) and that the `sender_allowed` field
of the user's profile it set to `true`.
parameters:
- name: message
in: body
schema:
$ref: "#/definitions/NewMessage"
x-examples:
application/json:
time_to_live: 3600
content:
subject: ipsum labore deserunt fugiat
markdown: |-
Nullam dapibus metus sed elementum efficitur. Curabitur facilisis sagittis risus nec sodales.
Vestibulum in eros sapien. Donec ac odio sit amet dui semper ornare eget nec odio. Pellentesque habitant
morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent nibh ex, mattis sit amet
felis id, sodales euismod velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
responses:
'201':
description: Message created.
schema:
type: object
properties:
id:
type: string
description: The identifier of the created message.
headers:
Location:
type: string
description: |-
Location (URL) of created message resource.
A GET request to this URL returns the message status and details.
examples:
application/json:
id: 01BX9NSMKVXXS5PSP2FATZMYYY
'400':
description: Invalid payload.
schema:
$ref: "#/definitions/ProblemJson"
examples: {}
'401':
description: Unauthorized
'429':
description: Too many requests
'500':
description: The message cannot be delivered.
schema:
$ref: "#/definitions/ProblemJson"
"/messages/{fiscal_code}":
post:
operationId: submitMessageforUser
summary: Submit a Message
summary: Submit a Message passing the user fiscal_code as path parameter
description: |-
Submits a message to a user.
On error, the reason is returned in the response payload.
Expand Down