Skip to content

Commit 1ffc4e2

Browse files
authored
Merge pull request microsoft#53 from zaccharles/fixes
Fixes for Guidelines.md
2 parents c4be6ce + 298ebb0 commit 1ffc4e2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Guidelines.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Under UPSERT semantics, a PATCH call to a nonexistent resource is handled by the
287287
If a service does not support UPSERT, then a PATCH call against a resource that does not exist MUST result in an HTTP "409 Conflict" error.
288288

289289
#### 7.4.4 Options and link headers
290-
OPTIONS allows a client to retrieve information about an resource, at a minimum by returning the Allow header denoting the valid method verbs for this resource.
290+
OPTIONS allows a client to retrieve information about a resource, at a minimum by returning the Allow header denoting the valid method verbs for this resource.
291291

292292
In addition, services SHOULD include a Link header (see [RFC 5988][rfc-5988]) to point to documentation for the resource in question:
293293

@@ -536,7 +536,7 @@ Because browser preflight response caches are notoriously weak, the additional r
536536
- Services MUST NOT contravene other API recommendations in the name of avoiding CORS preflight requests. In particular, in accordance with recommendations, most POST requests will actually require a preflight request due to the Content-Type.
537537
- If eliminating preflight is critical, then a service MAY support alternative mechanisms for data transfer, but the RECOMMENDED approach MUST also be supported.
538538

539-
In addition, when appropriate services MAY support the JSONP pattern for simple, GET-only cross-domain access. In JSONP services, take a parameter indicating the format (_$format=json_) and a parameter indicating a callback (_$callback=someFunc_) and return a text/javascript document containing the JSON response wrapped in a function call with the indicated name. More on JSONP at Wikipedia: [JSONP](https://en.wikipedia.org/wiki/JSONP).
539+
In addition, when appropriate services MAY support the JSONP pattern for simple, GET-only cross-domain access. In JSONP, services take a parameter indicating the format (_$format=json_) and a parameter indicating a callback (_$callback=someFunc_), and return a text/javascript document containing the JSON response wrapped in a function call with the indicated name. More on JSONP at Wikipedia: [JSONP](https://en.wikipedia.org/wiki/JSONP).
540540

541541
## 9 Collections
542542
### 9.1 Item keys
@@ -1491,7 +1491,7 @@ Non normative implementation guidance: In the final part of the sequence, when a
14911491
![User subscription setup][websequencediagram-user-subscription-setup]
14921492

14931493
### 14.5 Verifying subscriptions
1494-
When subscriptions change either programmatically or in response to change via administrative UI portals, the subscribing service need to be protected from malicious or unexpected calls from services pushing potentially large volumes of notification traffic.
1494+
When subscriptions change either programmatically or in response to change via administrative UI portals, the subscribing service needs to be protected from malicious or unexpected calls from services pushing potentially large volumes of notification traffic.
14951495

14961496
For all subscriptions, whether firehose or per-user, services MUST send a verification request as part of creation or modification via portal UI or API request, before sending any other notifications.
14971497

@@ -1510,7 +1510,7 @@ If any challenge request does not receive the prescribed response within 5 secon
15101510
Services MAY perform additional validations on URL ownership.
15111511

15121512
### 14.6 Receiving notifications
1513-
Services SHOULD send notifications in response to service data change that do not include details of the changes themselves, but include enough information for the subscribing application to respond appropriately to the following process:
1513+
Services SHOULD send notifications in response to service data changes that do not include details of the changes themselves, but include enough information for the subscribing application to respond appropriately to the following process:
15141514

15151515
1. Applications MUST identify the correct cached OAuth token to use for a callback
15161516
2. Applications MAY look up any previous delta token for the relevant scope of change
@@ -1585,14 +1585,14 @@ subscriptionId | The id of the subscription due to which this notification h
15851585
clientState | Services MUST provide the *clientState* field if it was provided at subscription creation time.
15861586
expirationDateTime | Services MUST provide the *expirationDateTime* field if the subscription has one.
15871587
resource | Services MUST provide the resource field. This URL MUST be considered opaque by the subscribing application. In the case of a richer notification it MAY be subsumed by message content that implicitly contains the resource URL to avoid duplication.<br/>If a service is providing this data as part of a more detailed data packet, then it need not be duplicated.
1588-
userId | Services MUST provide this field or user-scoped resources. In the case of user-scoped resources, the unique identifier for the user should be used.<br/>In the case of resources shared between a specific set of users, multiple notifications must be sent, passing the unique identifier of each user.<br/>For tenant-scoped resources, the user id of the subscription should be used.
1588+
userId | Services MUST provide this field for user-scoped resources. In the case of user-scoped resources, the unique identifier for the user should be used.<br/>In the case of resources shared between a specific set of users, multiple notifications must be sent, passing the unique identifier of each user.<br/>For tenant-scoped resources, the user id of the subscription should be used.
15891589
tenantId | Services that wish to support cross-tenant requests SHOULD provide this field. Services that provide notifications on tenant-scoped data MUST send this field.
15901590

15911591
### 14.7 Managing subscriptions programmatically
15921592
For per-user subscriptions, an API MUST be provided to create and manage subscriptions. The API must support at least the operations described here.
15931593

15941594
#### 14.7.1 Creating subscriptions
1595-
A client creates a subscription by issuing a POST request against the subscription resource. The subscription namespace is client-defined via the POST operation.
1595+
A client creates a subscription by issuing a POST request against the subscriptions resource. The subscription namespace is client-defined via the POST operation.
15961596

15971597
```
15981598
https://api.contoso.com/apiVersion/$subscriptions
@@ -1606,7 +1606,7 @@ resource | Yes | Resource path to watch.
16061606
notificationUrl | Yes | The target web hook URL.
16071607
clientState | No | Opaque string passed back to the client on all notifications. Callers may choose to use this to provide tagging mechanisms.
16081608

1609-
If the subscription was successfully created, the service MUST respond with the status code 201 CREATED and a body containing at least the following properties, in the same order as the request array, of the subscription:
1609+
If the subscription was successfully created, the service MUST respond with the status code 201 CREATED and a body containing at least the following properties:
16101610

16111611
Property Name | Required | Notes
16121612
------------------ | -------- | -------------------------------------------------------------------------------------------
@@ -1615,7 +1615,7 @@ expirationDateTime | No | Uses existing Microsoft REST API Guidelines defi
16151615

16161616
Creation of subscriptions SHOULD be idempotent. The combination of properties scoped to the auth token, provides a uniqueness constraint.
16171617

1618-
Below is an example request using a User + Application principal to subscribe to notifications from a file. In this example, the user specified "file1" as the context they wanted passed on all notifications:
1618+
Below is an example request using a User + Application principal to subscribe to notifications from a file:
16191619

16201620
```http
16211621
POST https://api.contoso.com/files/v1.0/$subscriptions HTTP 1.1
@@ -1637,7 +1637,7 @@ The service SHOULD respond to such a message with a response format minimally li
16371637
}
16381638
```
16391639

1640-
Below is an example using an Application-Only principal where the application is watching all files to which it's authorized. When created the user specified "allFiles" as the context to be passed on all notifications.
1640+
Below is an example using an Application-Only principal where the application is watching all files to which it's authorized:
16411641

16421642
```http
16431643
POST https://api.contoso.com/files/v1.0/$subscriptions HTTP 1.1
@@ -1691,10 +1691,10 @@ DELETE https://api.contoso.com/files/v1.0/$subscriptions/{id} HTTP 1.1
16911691
Authorization: Bearer {UserPrincipalBearerToken}
16921692
```
16931693

1694-
As with update, the service MUST return 204 NO RESPONSE for a successful delete, and an error status code and body object to indicate failure.
1694+
As with update, the service MUST return `204 No Content` for a successful delete, or an error body and status code to indicate failure.
16951695

16961696
#### 14.7.4 Enumerating subscriptions
1697-
To get a list of active subscriptions, clients issue a GET request against the subscriptions entity set using a User + Application or Application-Only bearer token:
1697+
To get a list of active subscriptions, clients issue a GET request against the subscriptions resource using a User + Application or Application-Only bearer token:
16981698

16991699
```http
17001700
GET https://api.contoso.com/files/v1.0/$subscriptions HTTP 1.1

0 commit comments

Comments
 (0)