Skip to content

Commit 3b286c3

Browse files
authored
Merge pull request #2432 from MicrosoftDocs/pehecke-feedback-updates
Issues 1045 and 938
2 parents 257bbcf + 01525a0 commit 3b286c3

File tree

2 files changed

+106
-107
lines changed

2 files changed

+106
-107
lines changed

powerapps-docs/developer/common-data-service/org-service/extend-code-generation-tool.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,4 @@ Guid accountId = service.Create(account);
127127

128128
[Create Early-Bound Entity Classes with the Code Generation Tool (CrmSvcUtil.exe)](/dynamics365/customer-engagement/developer/create-early-bound-entity-classes-code-generation-tool)<br />
129129
[Use the Early Bound Entity Classes for Create, Update and Delete](/dynamics365/customer-engagement/developer/use-entity-class-create-update-delete)<br />
130-
[Troubleshooting Tips](/dynamics365/customer-engagement/developer/troubleshooting-tips)<br />
131130
[Run a simple program using Web services](/dynamics365/customer-engagement/developer/simple-program-web-services)

powerapps-docs/developer/common-data-service/webapi/execute-batch-operations-using-web-api.md

Lines changed: 106 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ Use a POST request to submit a batch operation that contains multiple requests.
4747
The POST request containing the batch must have a Content-Type header with a value set to multipart/mixed with a boundary set to include the identifier of the batch using this pattern:
4848

4949
```
50-
--batch_<unique identifier>
50+
--batch_<unique identifier>
5151
```
5252

5353
The unique identifier doesn’t need to be a GUID, but should be unique. Each item within the batch must be preceded by the batch identifier with a Content-Type and Content-Transfer-Encoding header like the following:
5454

5555
```
56-
--batch_WKQS9Yui9r
57-
Content-Type: application/http
58-
Content-Transfer-Encoding:binary
56+
--batch_WKQS9Yui9r
57+
Content-Type: application/http
58+
Content-Transfer-Encoding:binary
5959
```
6060

6161
The end of the batch must contain a termination indicator like the following:
6262

6363
```
64-
--batch_WKQS9Yui9r--
64+
--batch_WKQS9Yui9r--
6565
```
6666

6767
<a name="bkmk_ChangeSets"></a>
@@ -71,23 +71,23 @@ The end of the batch must contain a termination indicator like the following:
7171
When multiple operations are contained in a change set, all the operations are considered atomic, which means that if any one of the operations fail, any completed operations will be rolled back. Like a batch request, change sets must have a Content-Type header with value set to multipart/mixed with a boundary set to include the identifier of the change set using this pattern:
7272

7373
```
74-
--changeset_<unique identifier>
74+
--changeset_<unique identifier>
7575
```
7676

7777
The unique identifier doesn’t need to be a GUID, but should be unique. Each item within the change set must be preceded by the change set identifier with a Content-Type and Content-Transfer-Encoding header like the following:
7878

7979
```
80-
--changeset_BBB456
81-
Content-Type: application/http
82-
Content-Transfer-Encoding:binary
80+
--changeset_BBB456
81+
Content-Type: application/http
82+
Content-Transfer-Encoding:binary
8383
```
8484

8585
Change sets can also include a Content-ID header with a unique value. This value, when prefixed with `$`, represents a variable that contains the Uri for any entity created in that operation. For example, when you set the value of 1, you can refer to that entity using `$1` later in your change set.
8686

8787
The end of the change set must contain a termination indicator like the following:
8888

8989
```
90-
--changeset_BBB456--
90+
--changeset_BBB456--
9191
```
9292

9393
<a name="bkmk_Example"></a>
@@ -103,111 +103,111 @@ Finally, a GET request is included outside the change set to return all six task
103103
**Request**
104104

105105
```http
106-
POST[Organization URI]/api/data/v9.1/$batch HTTP/1.1
107-
Content-Type: multipart/mixed;boundary=batch_AAA123
108-
Accept: application/json
109-
OData-MaxVersion: 4.0
110-
OData-Version: 4.0
111-
112-
--batch_AAA123
113-
Content-Type: multipart/mixed;boundary=changeset_BBB456
114-
115-
--changeset_BBB456
116-
Content-Type: application/http
117-
Content-Transfer-Encoding:binary
118-
Content-ID: 1
119-
120-
POST[Organization URI]/api/data/v9.1/tasks HTTP/1.1
121-
Content-Type: application/json;type=entry
122-
123-
{"subject":"Task 1 in batch","[email protected]":"[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)"}
124-
--changeset_BBB456
125-
Content-Type: application/http
126-
Content-Transfer-Encoding:binary
127-
Content-ID: 2
128-
129-
POST[Organization URI]/api/data/v9.1/tasks HTTP/1.1
130-
Content-Type: application/json;type=entry
131-
132-
{"subject":"Task 2 in batch","[email protected]":"[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)"}
133-
--changeset_BBB456--
134-
135-
--batch_AAA123
136-
Content-Type: application/http
137-
Content-Transfer-Encoding:binary
138-
139-
GET[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)/Account_Tasks?$select=subject HTTP/1.1
140-
Accept: application/json
141-
142-
--batch_AAA123--
106+
POST[Organization URI]/api/data/v9.1/$batch HTTP/1.1
107+
Content-Type: multipart/mixed;boundary=batch_AAA123
108+
Accept: application/json
109+
OData-MaxVersion: 4.0
110+
OData-Version: 4.0
111+
112+
--batch_AAA123
113+
Content-Type: multipart/mixed;boundary=changeset_BBB456
114+
115+
--changeset_BBB456
116+
Content-Type: application/http
117+
Content-Transfer-Encoding:binary
118+
Content-ID: 1
119+
120+
POST[Organization URI]/api/data/v9.1/tasks HTTP/1.1
121+
Content-Type: application/json;type=entry
122+
123+
{"subject":"Task 1 in batch","[email protected]":"[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)"}
124+
--changeset_BBB456
125+
Content-Type: application/http
126+
Content-Transfer-Encoding:binary
127+
Content-ID: 2
128+
129+
POST[Organization URI]/api/data/v9.1/tasks HTTP/1.1
130+
Content-Type: application/json;type=entry
131+
132+
{"subject":"Task 2 in batch","[email protected]":"[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)"}
133+
--changeset_BBB456--
134+
135+
--batch_AAA123
136+
Content-Type: application/http
137+
Content-Transfer-Encoding:binary
138+
139+
GET[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)/Account_Tasks?$select=subject HTTP/1.1
140+
Accept: application/json
141+
142+
--batch_AAA123--
143143
```
144144

145145
**Response**
146146

147-
```http
148-
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f
149-
Content-Type: multipart/mixed; boundary=changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
150-
151-
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
152-
Content-Type: application/http
153-
Content-Transfer-Encoding: binary
154-
Content-ID: 1
155-
156-
HTTP/1.1 204 No Content
157-
OData-Version: 4.0
158-
Location:[Organization URI]/api/data/v9.1/tasks(a59c24f3-fafc-e411-80dd-00155d2a68cb)
159-
OData-EntityId:[Organization URI]/api/data/v9.1/tasks(a59c24f3-fafc-e411-80dd-00155d2a68cb)
160-
161-
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
162-
Content-Type: application/http
163-
Content-Transfer-Encoding: binary
164-
Content-ID: 2
165-
166-
HTTP/1.1 204 No Content
167-
OData-Version: 4.0
168-
Location:[Organization URI]/api/data/v9.1/tasks(a69c24f3-fafc-e411-80dd-00155d2a68cb)
169-
OData-EntityId:[Organization URI]/api/data/v9.1/tasks(a69c24f3-fafc-e411-80dd-00155d2a68cb)
170-
171-
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc--
172-
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f
173-
Content-Type: application/http
174-
Content-Transfer-Encoding: binary
175-
176-
HTTP/1.1 200 OK
177-
Content-Type: application/json; odata.metadata=minimal
178-
OData-Version: 4.0
179-
180-
{
181-
"@odata.context":"[Organization URI]/api/data/v9.1/$metadata#tasks(subject)","value":[
182-
{
183-
"@odata.etag":"W/\"474122\"","subject":"Task Created with Test Account","activityid":"919c24f3-fafc-e411-80dd-00155d2a68cb"
184-
},{
185-
"@odata.etag":"W/\"474125\"","subject":"Task 1","activityid":"a29c24f3-fafc-e411-80dd-00155d2a68cb"
186-
},{
187-
"@odata.etag":"W/\"474128\"","subject":"Task 2","activityid":"a39c24f3-fafc-e411-80dd-00155d2a68cb"
188-
},{
189-
"@odata.etag":"W/\"474131\"","subject":"Task 3","activityid":"a49c24f3-fafc-e411-80dd-00155d2a68cb"
190-
},{
191-
"@odata.etag":"W/\"474134\"","subject":"Task 1 in batch","activityid":"a59c24f3-fafc-e411-80dd-00155d2a68cb"
192-
},{
193-
"@odata.etag":"W/\"474137\"","subject":"Task 2 in batch","activityid":"a69c24f3-fafc-e411-80dd-00155d2a68cb"
194-
}
195-
]
196-
}
197-
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f--
147+
```http
148+
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f
149+
Content-Type: multipart/mixed; boundary=changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
150+
151+
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
152+
Content-Type: application/http
153+
Content-Transfer-Encoding: binary
154+
Content-ID: 1
155+
156+
HTTP/1.1 204 No Content
157+
OData-Version: 4.0
158+
Location:[Organization URI]/api/data/v9.1/tasks(a59c24f3-fafc-e411-80dd-00155d2a68cb)
159+
OData-EntityId:[Organization URI]/api/data/v9.1/tasks(a59c24f3-fafc-e411-80dd-00155d2a68cb)
160+
161+
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc
162+
Content-Type: application/http
163+
Content-Transfer-Encoding: binary
164+
Content-ID: 2
165+
166+
HTTP/1.1 204 No Content
167+
OData-Version: 4.0
168+
Location:[Organization URI]/api/data/v9.1/tasks(a69c24f3-fafc-e411-80dd-00155d2a68cb)
169+
OData-EntityId:[Organization URI]/api/data/v9.1/tasks(a69c24f3-fafc-e411-80dd-00155d2a68cb)
170+
171+
--changesetresponse_ff83b4f1-ab48-430c-b81c-926a2c596abc--
172+
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f
173+
Content-Type: application/http
174+
Content-Transfer-Encoding: binary
175+
176+
HTTP/1.1 200 OK
177+
Content-Type: application/json; odata.metadata=minimal
178+
OData-Version: 4.0
179+
180+
{
181+
"@odata.context":"[Organization URI]/api/data/v9.1/$metadata#tasks(subject)","value":[
182+
{
183+
"@odata.etag":"W/\"474122\"","subject":"Task Created with Test Account","activityid":"919c24f3-fafc-e411-80dd-00155d2a68cb"
184+
},{
185+
"@odata.etag":"W/\"474125\"","subject":"Task 1","activityid":"a29c24f3-fafc-e411-80dd-00155d2a68cb"
186+
},{
187+
"@odata.etag":"W/\"474128\"","subject":"Task 2","activityid":"a39c24f3-fafc-e411-80dd-00155d2a68cb"
188+
},{
189+
"@odata.etag":"W/\"474131\"","subject":"Task 3","activityid":"a49c24f3-fafc-e411-80dd-00155d2a68cb"
190+
},{
191+
"@odata.etag":"W/\"474134\"","subject":"Task 1 in batch","activityid":"a59c24f3-fafc-e411-80dd-00155d2a68cb"
192+
},{
193+
"@odata.etag":"W/\"474137\"","subject":"Task 2 in batch","activityid":"a69c24f3-fafc-e411-80dd-00155d2a68cb"
194+
}
195+
]
196+
}
197+
--batchresponse_c1bd45c1-dd81-470d-b897-e965846aad2f--
198198
```
199199
Include `odata.include-annotations` preference header with the `GET` requests and set its value to "*" to specify that all annotations related to the properties be returned.
200200

201201
```HTTP
202-
--batch_AAA123
203-
Content-Type: application/http
204-
Content-Transfer-Encoding:binary
205-
206-
GET[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)?$select=name,telephone1,emailaddress1,shippingmethodcode,customersizecode,accountratingcode,followemail,donotemail,donotphone,statuscode HTTP/1.1
207-
Accept: application/json
202+
--batch_AAA123
203+
Content-Type: application/http
204+
Content-Transfer-Encoding:binary
205+
206+
GET[Organization URI]/api/data/v9.1/accounts(00000000-0000-0000-000000000001)?$select=name,telephone1,emailaddress1,shippingmethodcode,customersizecode,accountratingcode,followemail,donotemail,donotphone,statuscode HTTP/1.1
207+
Accept: application/json
208208
Prefer: odata.include-annotations="*"
209-
210-
--batch_AAA123--
209+
210+
--batch_AAA123--
211211
```
212212
For more information about preference headers, see [Header Prefer](https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752234).
213213

0 commit comments

Comments
 (0)