Skip to content

Commit 644ed41

Browse files
Shamkhankitam-msft
andauthored
Users/shamkh/feature send sms changes (#12406)
* SettingFolder Structure. * Updating SMS communication Swagger json for 1:N , customer content feature. * Updating with review comments. * adding Idempotency header. * Updating name for Idempodency field. * Merging N:1 Changes * fixing integer issue * Updating Read me * fixing lint issue. * Reverting change * Fixing Model issue. * Updating Case for repeatablity header. * Example update in sendjson. * Review comments. * camelCase issue in Send.json. * Fixing example Model. * Model issue fix. * apiversion param issue * Model issue * Model validation. * Review comments. * Addressing API review comments: consolidating to 202Accepted response. * review comments. * review comments * placing response header at right place. * review comments * Modifying wire objects to format [Resource][Method] and adding a flag to response * Review comments * Fixing swagger validations. * review comments. * review comments. * review comments. * review comments. * Swagger validation. * review comments. * review comments * Fix Avocado * Fixing endpoint stuff * review comments * review comments * fix spell * fixes * prettierfix * fix * Revert "fix" This reverts commit 341eaf6. * review comments * review comments * removing acs Co-authored-by: Ankita Mathur <ankitam@microsoft.com>
1 parent 68ec4c4 commit 644ed41

File tree

3 files changed

+307
-1
lines changed

3 files changed

+307
-1
lines changed
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Azure Communication SMS Service",
5+
"description": "Azure Communication SMS Service",
6+
"version": "2021-03-07"
7+
},
8+
"securityDefinitions": {
9+
"azure_auth": {
10+
"type": "oauth2",
11+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
12+
"flow": "implicit",
13+
"description": "Azure Active Directory OAuth2 Flow",
14+
"scopes": {
15+
"user_impersonation": "impersonate your user account"
16+
}
17+
}
18+
},
19+
"paths": {
20+
"/sms": {
21+
"post": {
22+
"tags": [
23+
"Sms"
24+
],
25+
"summary": "Sends a SMS message from a phone number that belongs to the authenticated account.",
26+
"operationId": "Sms_Send",
27+
"x-ms-examples": {
28+
"SuccessfulSend": {
29+
"$ref": "./examples/send.json"
30+
}
31+
},
32+
"consumes": [
33+
"application/json"
34+
],
35+
"produces": [
36+
"application/json"
37+
],
38+
"parameters": [
39+
{
40+
"in": "body",
41+
"name": "SendMessageRequest",
42+
"description": "Represents the body of the send message request.",
43+
"required": true,
44+
"schema": {
45+
"$ref": "#/definitions/SendMessageRequest"
46+
}
47+
},
48+
{
49+
"name": "api-version",
50+
"in": "query",
51+
"description": "Version of API to invoke.",
52+
"required": true,
53+
"type": "string"
54+
}
55+
],
56+
"responses": {
57+
"202": {
58+
"description": "Accepted",
59+
"schema": {
60+
"$ref": "#/definitions/SmsSendResponse"
61+
}
62+
}
63+
}
64+
}
65+
}
66+
},
67+
"definitions": {
68+
"SmsRecipient": {
69+
"description": "Recipient details for sending SMS messages.",
70+
"required": [
71+
"to"
72+
],
73+
"type": "object",
74+
"properties": {
75+
"to": {
76+
"description": "The recipient's phone number in E.164 format.",
77+
"type": "string"
78+
},
79+
"repeatabilityRequestId": {
80+
"description": "If specified, the client directs that the request is repeatable; that is, the client can make the request multiple times with the same Repeatability-Request-ID and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string representing a client-generated, 36-character hexadecimal case-insensitive encoding of a UUID (GUID), identifier for the request.",
81+
"type": "string"
82+
},
83+
"repeatabilityFirstSent": {
84+
"description": "MUST be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created.eg- Tue, 26 Mar 2019 16:06:51 GMT",
85+
"type": "string"
86+
}
87+
}
88+
},
89+
"SmsSendOptions": {
90+
"description": "Optional configuration for sending SMS messages.",
91+
"required": [
92+
"enableDeliveryReport"
93+
],
94+
"type": "object",
95+
"properties": {
96+
"enableDeliveryReport": {
97+
"description": "Enable this flag to receive a delivery report for this message on the Azure Resource EventGrid.",
98+
"type": "boolean",
99+
"default": false
100+
},
101+
"tag": {
102+
"description": "Use this field to provide metadata that will then be sent back in the corresponding Delivery Report.",
103+
"type": "string"
104+
}
105+
}
106+
},
107+
"SendMessageRequest": {
108+
"description": "Represents the properties of a send message request.",
109+
"required": [
110+
"message",
111+
"smsRecipients",
112+
"from"
113+
],
114+
"type": "object",
115+
"properties": {
116+
"from": {
117+
"description": "The sender's phone number in E.164 format that is owned by the authenticated account.",
118+
"type": "string"
119+
},
120+
"smsRecipients": {
121+
"description": "The recipient's phone number in E.164 format. In this version, a minimum of 1 and upto 100 recipients in the list are supported.",
122+
"maxLength": 100,
123+
"minLength": 1,
124+
"type": "array",
125+
"items": {
126+
"$ref": "#/definitions/SmsRecipient"
127+
}
128+
},
129+
"message": {
130+
"description": "The contents of the message that will be sent to the recipient. The allowable content is defined by RFC 5724.",
131+
"maxLength": 2048,
132+
"minLength": 0,
133+
"type": "string"
134+
},
135+
"smsSendOptions": {
136+
"$ref": "#/definitions/SmsSendOptions"
137+
}
138+
}
139+
},
140+
"SmsSendResponse": {
141+
"description": "Response for a successful or multi status send Sms request.",
142+
"required": [
143+
"value"
144+
],
145+
"type": "object",
146+
"properties": {
147+
"value": {
148+
"type": "array",
149+
"items": {
150+
"$ref": "#/definitions/SmsSendResponseItem"
151+
}
152+
}
153+
}
154+
},
155+
"SmsSendResponseItem": {
156+
"description": "Response for a single recipient.",
157+
"required": [
158+
"httpStatusCode",
159+
"to",
160+
"successful"
161+
],
162+
"type": "object",
163+
"properties": {
164+
"to": {
165+
"description": "The recipient's phone number in E.164 format.",
166+
"type": "string"
167+
},
168+
"messageId": {
169+
"description": "The identifier of the outgoing Sms message. Only present if message processed.",
170+
"type": "string"
171+
},
172+
"httpStatusCode": {
173+
"description": "HTTP Status code.",
174+
"type": "integer"
175+
},
176+
"repeatabilityResult": {
177+
"description": "The result of a repeatable request with one of the case-insensitive values accepted or rejected.",
178+
"type": "string",
179+
"enum": [
180+
"accepted",
181+
"rejected"
182+
]
183+
},
184+
"successful": {
185+
"description": "Indicates if the message is processed successfully or not.",
186+
"type": "boolean"
187+
},
188+
"errorMessage": {
189+
"description": "Optional error message in case of 4xx/5xx/repeatable errors.",
190+
"type": "string"
191+
}
192+
}
193+
}
194+
},
195+
"parameters": {},
196+
"x-ms-parameterized-host": {
197+
"hostTemplate": "{endpoint}",
198+
"useSchemePrefix": false,
199+
"parameters": [
200+
{
201+
"name": "endpoint",
202+
"description": "The communication resource, for example https://my-resource.communication.azure.com",
203+
"required": true,
204+
"type": "string",
205+
"in": "path",
206+
"x-ms-skip-url-encoding": true,
207+
"x-ms-parameter-location": "client"
208+
}
209+
]
210+
}
211+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"parameters": {
3+
"SendMessageRequest": {
4+
"from": "+18001110000",
5+
"smsRecipients": [
6+
{
7+
"to": "+11234567890"
8+
},
9+
{
10+
"to": "+11234567891"
11+
},
12+
{
13+
"to": "+112345678901"
14+
},
15+
{
16+
"to": "+11234567892"
17+
},
18+
{
19+
"to": "+11234567893",
20+
"repeatabilityRequestId": "fda6d242-46aa-4247-8bf6-619a1206f9c3",
21+
"repeatabilityFirstSent": "Mon, 01 Apr 2019 06:22:03 GMT"
22+
},
23+
{
24+
"to": "+11234567894",
25+
"repeatabilityRequestId": "fda6d242-46aa-4247-8bf6-619a1206f9c3"
26+
}
27+
],
28+
"message": "Hello world!",
29+
"smsSendOptions": {
30+
"enableDeliveryReport": true
31+
}
32+
},
33+
"api-version": "2021-03-07",
34+
"endpoint": "https://contoso.communication.azure.com/"
35+
},
36+
"responses": {
37+
"202": {
38+
"headers": {},
39+
"body": {
40+
"value": [
41+
{
42+
"to": "+11234567890",
43+
"messageId": "Outgoing_20200610203725bfd4ba70-70bf-4f77-925d-c0bdb5161bb3",
44+
"httpStatusCode": 202,
45+
"successful": true
46+
},
47+
{
48+
"to": "+11234567891",
49+
"messageId": "Outgoing_2020061020025100d1-d07e-4b19-b25d-13525d552822",
50+
"httpStatusCode": 202,
51+
"successful": true
52+
},
53+
{
54+
"to": "+112345678901",
55+
"httpStatusCode": 400,
56+
"errorMessage": "Invalid To phone number format.",
57+
"successful": false
58+
},
59+
{
60+
"to": "+11234567892",
61+
"messageId": "Outgoing_2020061020025100d1-d07e-4b19-b25d-13525d552822",
62+
"httpStatusCode": 503,
63+
"errorMessage": "ServiceUnavailable",
64+
"successful": false
65+
},
66+
{
67+
"to": "+11234567893",
68+
"messageId": "Outgoing_2020061020025100d1-d07e-4b19-b25d-13525d552822_noam",
69+
"httpStatusCode": 202,
70+
"repeatabilityResult": "accepted",
71+
"successful": true
72+
},
73+
{
74+
"to": "+11234567894",
75+
"messageId": "Outgoing_2020061020025100d1-d07e-4b19-b25d-13525d552822",
76+
"httpStatusCode": 400,
77+
"repeatabilityResult": "rejected",
78+
"errorMessage": "Request sent with Invalid DateTime value for repeatability-first-sent. Expected is DateTime ,RFC1123 pattern.",
79+
"successful": false
80+
}
81+
]
82+
}
83+
}
84+
}
85+
}

specification/communication/data-plane/readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,17 @@ These settings apply only when `--tag=package-2021-03-07` is specified on the co
8484
```yaml $(tag) == 'package-2021-03-07'
8585
input-file:
8686
- Microsoft.CommunicationServicesIdentity/stable/2021-03-07/CommunicationIdentity.json
87-
- Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json
87+
title:
88+
Azure Communication Services
89+
```
90+
91+
### Tag: package-sms-2021-03-07
92+
93+
These settings apply only when `--tag=package-sms-2021-03-07` is specified on the command line.
94+
95+
```yaml $(tag) == 'package-sms-2021-03-07'
96+
input-file:
97+
- Microsoft.CommunicationServicesSms/stable/2021-03-07/communicationservicessms.json
8898
title:
8999
Azure Communication Services
90100
```

0 commit comments

Comments
 (0)