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

Update ACS Email swagger based on prior feedback from review board in preparation for GA #21841

Merged
merged 32 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0e6be51
rename EmailMessage to Message and Sender to SenderEmail
apattath Dec 7, 2022
8375396
Change EmailCustomHeaders to a dictionary of string, string
apattath Dec 9, 2022
ad55e1a
add x-ms-client-request-id header
apattath Dec 9, 2022
8ff3208
update swagger version
apattath Dec 9, 2022
56577ab
Merge branch 'Azure:main' into main
apattath Dec 10, 2022
48c0b0d
Remove AttachmentType enum, change to use MIME type and update SendEm…
apattath Dec 12, 2022
269a005
Merge remote-tracking branch 'refs/remotes/origin/main' into main
apattath Dec 12, 2022
45eab39
Add new version folder for updated swagger version
apattath Dec 12, 2022
0e4778d
Restore files from 2021-10-01-preview version
apattath Dec 12, 2022
abdf3df
Updating references and readme to point to the new preview version
apattath Dec 12, 2022
5929c44
Fix API version to 2023-01-15-preview instead of 2023-15-01-preview
apattath Dec 13, 2022
bba4896
Rename preview version folder
apattath Dec 13, 2022
f18f13f
Revert name of Message object to EmailMessage, but retain name to be …
apattath Dec 13, 2022
544e476
remove retry-after header, update attachment description, change cc,b…
apattath Dec 13, 2022
5ab2cf8
update samples based on changes so far
apattath Dec 14, 2022
56ed981
add x-ms-long-running-operation flag
apattath Dec 14, 2022
d9fa1c0
Remove importance field from email message
apattath Dec 14, 2022
87e1332
update swagger to match LongRunningOperation pattern
apattath Jan 7, 2023
1219a2e
Merge branch 'Azure:main' into main
apattath Jan 9, 2023
3dbf9fe
update swagger version of CommunicationErrorResponse
apattath Jan 9, 2023
2982a03
Remove SendStatusResult object
apattath Jan 9, 2023
5849ece
Merge branch 'Azure:main' into main
apattath Jan 12, 2023
d9b90d3
Merge branch 'main' of https://github.com/apattath/azure-rest-api-spe…
apattath Jan 12, 2023
1f01aca
rename title to EmailClient
apattath Jan 12, 2023
fe74987
Add more status retrieval samples
apattath Feb 3, 2023
2101210
fix validation errors in swagger
apattath Feb 8, 2023
2f26845
update swagger based on REST API review feedback
apattath Feb 8, 2023
7148f91
Update casing for opreation status in all samples
apattath Feb 9, 2023
971a514
update swagger based on ARB SDK Feedback
apattath Feb 17, 2023
baf452a
update get operation status reference schema
apattath Feb 17, 2023
3718125
update property ContentBytesBase64 to ContentInBase64
apattath Feb 21, 2023
2beb92d
rename disableUserEngagementTracking property
apattath Feb 23, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
{
"swagger": "2.0",
"info": {
"title": "EmailClient",
"description": "Azure Communication Email Service",
"version": "2023-01-15-preview"
},
"paths": {
"/emails/operations/{operationId}": {
"get": {
"tags": [
"EmailGetOperationStatus"
],
"summary": "Gets the status of the email send operation.",
"operationId": "Email_GetOperationStatus",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"parameters": [
{
"in": "path",
"name": "operationId",
"description": "ID of the long running operation (GUID) returned from a previous call to send email",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"default": {
"description": "Error",
"headers": {
"x-ms-error-code": {
"description": "Error code - this will be the same as the code in the error property in the response body.",
"type": "string"
}
},
"schema": {
"$ref": "../../../Common/stable/2022-07-13/common.json#/definitions/CommunicationErrorResponse"
}
},
"200": {
"description": "Message status was successfully retrieved.",
"headers": {
"retry-after": {
"description": "This header will only be present when the status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again.",
"type": "integer",
"format": "int32"
}
},
"schema": {
"$ref": "#/definitions/OperationStatus"
}
}
},
"x-ms-examples": {
"Get Message Status FailedTerminalStatus": {
"$ref": "./examples/GetOperationStatusReturnsFailedTerminalStatus.json"
},
"Get Message Status NonTerminalStatus": {
"$ref": "./examples/GetOperationStatusReturnsNonTerminalStatus.json"
},
"Get Message Status SuccessTerminalStatus": {
"$ref": "./examples/GetOperationStatusReturnsSuccessTerminalStatus.json"
}
}
}
},
"/emails:send": {
"post": {
"tags": [
"EmailSend"
],
"summary": "Queues an email message to be sent to one or more recipients",
"operationId": "Email_Send",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "header",
"name": "Operation-Id",
"description": "This is the ID used by the status monitor for this long running operation.",
"type": "string",
"required": false,
"format": "uuid"
},
{
"in": "header",
"name": "x-ms-client-request-id",
"description": "Tracking ID sent with the request to help with debugging.",
"type": "string",
"required": false,
"format": "uuid",
"x-ms-client-name": "ClientRequestId"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"in": "body",
"name": "emailMessage",
"description": "Message payload for sending an email",
"required": true,
"x-ms-client-name": "message",
"schema": {
"$ref": "#/definitions/EmailMessage"
}
}
],
"responses": {
"default": {
"description": "Error",
"headers": {
"x-ms-error-code": {
"description": "Error code - this will be the same as the code in the error property in the response body.",
"type": "string"
}
},
"schema": {
"$ref": "../../../Common/stable/2022-07-13/common.json#/definitions/CommunicationErrorResponse"
}
},
"202": {
"description": "The service has accepted the request and will start processing the message later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation/message status using the URL specified in 'Operation-Location' header.",
"headers": {
"Operation-Location": {
"description": "Location url of where to poll the status of this operation from.",
"type": "string"
},
"retry-after": {
"description": "This header will only be present when the operation status is a non-terminal status. It indicates the minimum amount of time in seconds to wait before polling for operation status again.",
"type": "integer",
"format": "int32"
}
},
"schema": {
"$ref": "#/definitions/OperationStatus"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "azure-async-operation"
},
apattath marked this conversation as resolved.
Show resolved Hide resolved
"x-ms-examples": {
"Send Email": {
"$ref": "./examples/SendEmail.json"
}
}
}
}
},
"definitions": {
"OperationStatus": {
"description": "Status of the long running operation",
"required": [
"id",
"status"
],
"type": "object",
"properties": {
"id": {
"description": "The unique id of the operation",
"type": "string",
"example": "8540c0de-899f-5cce-acb5-3ec493af3800"
},
"status": {
"description": "Status of operation.",
"enum": [
"notStarted",
"running",
"succeeded",
"failed",
"canceled"
],
"type": "string",
"x-ms-enum": {
"name": "EmailSendOperationStatus",
"modelAsString": true
}
},
"error": {
"description": "Error details when status is a non-success terminal state.",
"$ref": "../../../Common/stable/2022-07-13/common.json#/definitions/CommunicationError"
}
}
},
"EmailMessage": {
"description": "Message payload for sending an email",
"required": [
"senderEmail",
"content",
"recipients"
],
"type": "object",
"properties": {
"headers": {
"description": "Custom email headers to be passed.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"senderEmail": {
"description": "Sender email address from a verified domain.",
"type": "string",
"example": "[email protected]"
},
"content": {
"description": "Email content to be sent.",
"$ref": "#/definitions/EmailContent"
},
"recipients": {
"description": "Recipients for the email.",
"$ref": "#/definitions/EmailRecipients"
},
"attachments": {
"description": "List of attachments. Please note that we limit the total size of an email request (which includes attachments) to 10MB.",
"type": "array",
"items": {
"$ref": "#/definitions/EmailAttachment"
}
},
"replyTo": {
"description": "Email addresses where recipients' replies will be sent to.",
"type": "array",
"items": {
"$ref": "#/definitions/EmailAddress"
}
},
"disableUserEngagementTracking": {
"description": "Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.",
"type": "boolean"
}
}
},
"EmailAddress": {
"description": "An object representing the email address and its display name",
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"description": "Email address.",
"type": "string",
"example": "[email protected]"
},
"displayName": {
"description": "Email display name.",
"type": "string",
"example": "abc"
}
}
},
"EmailContent": {
"description": "Content of the email.",
"type": "object",
"required": [
"subject"
],
"properties": {
"subject": {
"description": "Subject of the email message",
"type": "string",
"example": "An exciting offer especially for you!"
},
"plainText": {
"description": "Plain text version of the email message.",
"type": "string",
"example": "This exciting offer was created especially for you, our most loyal customer."
},
"html": {
"description": "Html version of the email message.",
"type": "string",
"example": "<html><head><title>Exciting offer!</title></head><body><h1>This exciting offer was created especially for you, our most loyal customer.</h1></body></html>"
}
}
},
"EmailAttachment": {
"description": "Attachment to the email.",
"type": "object",
"required": [
"name",
"type",
"contentBytesBase64"
],
"properties": {
"name": {
"description": "Name of the attachment",
"type": "string",
"example": "attachment.pdf"
},
"type": {
"description": "MIME type of the content being attached.",
"type": "string",
"example": "text/plain"
},
"contentBytesBase64": {
"description": "Base64 encoded contents of the attachment",
"type": "string",
"example": "TWFueSBoYW5kcyBtYWtlIGxpZ2h0I"
}
}
},
"EmailRecipients": {
"description": "Recipients of the email",
"type": "object",
"required": [
"to"
],
"properties": {
"to": {
"description": "Email To recipients",
"type": "array",
"items": {
"$ref": "#/definitions/EmailAddress"
}
},
"cc": {
"description": "Email CC recipients",
"type": "array",
"x-ms-client-name": "CC",
"items": {
"$ref": "#/definitions/EmailAddress"
}
},
"bcc": {
"description": "Email BCC recipients",
"type": "array",
"x-ms-client-name": "BCC",
"items": {
"$ref": "#/definitions/EmailAddress"
}
}
}
}
},
"parameters": {
"ApiVersionParameter": {
"in": "query",
"name": "api-version",
"description": "Version of API to invoke.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
}
},
"securityDefinitions": {
"Authorization": {
"type": "apiKey",
"name": "Authorization",
"in": "header",
"description": "An authentication string containing a signature generated using HMAC-SHA256 scheme."
}
},
"security": [
{
"Authorization": []
}
],
"x-ms-parameterized-host": {
"hostTemplate": "{endpoint}",
"useSchemePrefix": false,
"parameters": [
{
"name": "endpoint",
"description": "The communication resource, for example https://my-resource.communication.azure.com",
"required": true,
"type": "string",
"format": "url",
"in": "path",
"x-ms-skip-url-encoding": true,
"x-ms-parameter-location": "client"
}
]
}
}
Loading