Skip to content

Commit 6ba4d46

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/powerapps-docs-pr (branch live)
2 parents b1e8bc2 + 9b6a38a commit 6ba4d46

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

powerapps-docs/developer/data-platform/webapi/compose-http-requests-handle-errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Compose HTTP requests and handle errors
33
description: Learn about the HTTP methods and headers that form a part of HTTP requests for the Web API and how to identify and handle errors returned in the response.
44
ms.topic: how-to
5-
ms.date: 04/19/2023
5+
ms.date: 09/26/2023
66
author: divkamath
77
ms.author: dikamath
88
ms.reviewer: jdaly
@@ -47,6 +47,9 @@ The URL you use is made up of these parts:
4747

4848
Protocol + Environment Name + Region + Base URL + Web API path + Version + Resource.
4949

50+
### Maximum URL length
51+
52+
The maximum length of URL accepted by is 32 KB (32768 characters). This should be adequate for most kinds of request except certain `GET` operations which require very long string query parameters, such as queries using FetchXml. If you send requests inside the body of a `$batch` request, you can send requests with URLs up to 64 KB (65,536 characters). [Learn more about sending FetchXml within a $batch request](use-fetchxml-web-api.md#use-fetchxml-within-a-batch-request).
5053

5154
<a name="version_compatiblity"></a>
5255

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contributors:
1313

1414
# Execute batch operations using the Web API
1515

16-
You can group multiple operations into a single HTTP request using a batch operation. These operations will be performed sequentially in the order they're specified. The order of the responses will match the order of the requests in the batch operation.
16+
You can group multiple operations into a single HTTP request using a batch operation. These operations are performed sequentially in the order they're specified. The order of the responses match the order of the requests in the batch operation.
1717

1818
The format to send `$batch` requests is defined in this section of the OData specification: [11.7 Batch Requests](http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752313). The content in this article summarizes the specification requirements and provides Dataverse specific information and examples.
1919

@@ -26,20 +26,20 @@ Batch requests provide two capabilities that can be used together:
2626
- You can send requests for multiple operations with a single HTTP request.
2727

2828
- Batch requests can contain up to 1000 individual requests and can't contain other batch requests.
29-
- This is equivalent to the `ExecuteMultiple` message available in the SDK for .NET. More information: [Execute multiple requests using the SDK for .NET](../org-service/execute-multiple-requests.md)
29+
- Web API `$batch` requests are equivalent to the `ExecuteMultiple` message available in the SDK for .NET. More information: [Execute multiple requests using the SDK for .NET](../org-service/execute-multiple-requests.md).
3030

3131
- You can group requests for operations together so that they're included as a single transaction using [Change sets](#change-sets).
3232

3333
- You may want to create, update, or delete a set of related records in a way that guarantees that all the operations succeed or fail as a group.
34-
- This is equivalent to the `ExecuteTransaction` message available in the SDK for .NET. More information: [Execute messages in a single database transaction](../org-service/use-executetransaction.md)
34+
- Web API `$batch` requests using change sets are equivalent to the `ExecuteTransaction` message available in the SDK for .NET. More information: [Execute messages in a single database transaction](../org-service/use-executetransaction.md)
3535

3636
> [!NOTE]
3737
> Remember that associated entities can be created in a single operation more easily than using a batch request. More information: [Create related table rows in one operation](create-entity-web-api.md#create-related-table-rows-in-one-operation)
3838
3939

40-
Batch requests are also sometimes used to sent `GET` requests where the length of the URL may exceed the maximum allowed URL length. This is because the URL for the request is included in the body of the message where a longer URL, up to 64 KB (65,536 characters), is allowed. Sending complex queries using FetchXml can result in long URLs. More information: [Use FetchXML within a batch request](use-fetchxml-web-api.md#use-fetchxml-within-a-batch-request)
40+
Batch requests are also sometimes used to sent `GET` requests where the length of the URL may exceed the [maximum allowed URL length](compose-http-requests-handle-errors.md#maximum-url-length). People use batch requests because the URL for the request is included in the body of the message where a URL up to 64 KB (65,536 characters) is allowed. Sending complex queries using FetchXml can result in long URLs. More information: [Use FetchXML within a batch request](use-fetchxml-web-api.md#use-fetchxml-within-a-batch-request).
4141

42-
Compared to other operations that can be performed using the Web API, batch requests are more difficult to compose. The raw request and response bodies are essentially a text document that must match specific requirements. To access the data in a response, you'll need to parse the text in the response or locate a helper library to access the data in the response. See [.NET helper methods](#net-helper-methods).
42+
Compared to other operations that can be performed using the Web API, batch requests are more difficult to compose. The raw request and response bodies are essentially a text document that must match specific requirements. To access the data in a response, you need to parse the text in the response or locate a helper library to access the data in the response. See [.NET helper methods](#net-helper-methods).
4343

4444

4545
<a name="bkmk_BatchRequests"></a>
@@ -75,7 +75,7 @@ The end of the batch request must contain a termination indicator like the follo
7575
--batch_<unique identifier>--
7676
```
7777

78-
The following is an example of a batch request without change sets. This example:
78+
The following example is a batch request without change sets. This example:
7979
- Creates three task records associated with an account with `accountid` equal to `00000000-0000-0000-0000-000000000001`.
8080
- Retrieves the task records associated with the account.
8181

@@ -135,21 +135,21 @@ GET /api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)/Account_Tasks?
135135

136136
## Batch responses
137137

138-
When successful, the batch response will return HTTP Status `200 OK`, and each item in the response will be separated by a `Guid` unique identifier value that isn't the same as the batch request value.
138+
When successful, the batch response returns HTTP Status `200 OK`, and each item in the response is separated by a `Guid` unique identifier value that isn't the same as the batch request value.
139139

140140
```http
141141
--batchresponse_<unique identifier>
142142
Content-Type: application/http
143143
Content-Transfer-Encoding: binary
144144
```
145145

146-
The end of the batch response will contain a termination indicator like the following example:
146+
The end of the batch response contains a termination indicator like the following example:
147147

148148
```http
149149
--batchresponse_<unique identifier>--
150150
```
151151

152-
The following is the response to the batch request example above.
152+
The following example is the response to the previous batch request example.
153153

154154
**Response:**
155155

@@ -224,7 +224,7 @@ OData-Version: 4.0
224224

225225
## Change sets
226226

227-
In addition to individual requests, a batch request can include change sets. When multiple operations are contained in a change set, all the operations are considered *atomic*. This means that if any one of the operations fails, any completed operations will be rolled back.
227+
In addition to individual requests, a batch request can include change sets. When multiple operations are contained in a change set, all the operations are considered *atomic*. An atomic operation means that if any one of the operations fails, any completed operations are rolled back.
228228

229229
> [!NOTE]
230230
> `GET` request are not allowed within change sets. A `GET` operation should not change data, therefore they don't belong within a change set.
@@ -236,7 +236,7 @@ Like a batch request, change sets must have a `Content-Type` header with value s
236236
Content-Type: multipart/mixed; boundary="changeset_<unique identifier>"
237237
```
238238

239-
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:
239+
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 example:
240240

241241
```
242242
--changeset_<unique identifier>
@@ -246,7 +246,7 @@ Content-Transfer-Encoding: binary
246246

247247
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. More information: [Reference URIs in an operation](#reference-uris-in-an-operation)
248248

249-
The end of the change set must contain a termination indicator like the following:
249+
The end of the change set must contain a termination indicator like the following example:
250250

251251
```
252252
--changeset_<unique identifier>--
@@ -579,7 +579,7 @@ OData-Version: 4.0
579579

580580
#### Reference URIs in URL and request body using @odata.id
581581

582-
The example given below shows how to link a Contact entity record to an Account entity record. The URI of Account entity record is referenced as `$1` and URI of Contact entity record is referenced as `$2`.
582+
The following example shows how to link a Contact entity record to an Account entity record. The URI of Account entity record is referenced as `$1` and URI of Contact entity record is referenced as `$2`.
583583

584584
**Request:**
585585

@@ -670,7 +670,7 @@ OData-Version: 4.0
670670

671671
#### Reference URIs in URL and navigation properties
672672

673-
The example given below shows how to use the Organization URI of a Contact record and link it to an Account record using the `primarycontactid` single-valued navigation property. The URI of the Account entity record is referenced as `$1` and the URI of Contact entity record is referenced as `$2` in the `PATCH` request.
673+
The following example shows how to use the Organization URI of a Contact record and link it to an Account record using the `primarycontactid` single-valued navigation property. The URI of the Account entity record is referenced as `$1` and the URI of Contact entity record is referenced as `$2` in the `PATCH` request.
674674

675675
**Request:**
676676

@@ -767,7 +767,7 @@ OData-EntityId: [Organization URI]/api/data/v9.2/accounts(6cd81853-7b75-e911-a97
767767
> [!NOTE]
768768
> Referencing a `Content-ID` before it has been declared in the request body will return the error **HTTP 400** Bad request.
769769
>
770-
> The example given below shows a request body that can cause this error.
770+
> The following example shows a request body that can cause this error.
771771
>
772772
> **Request body**
773773
>
@@ -816,9 +816,9 @@ OData-EntityId: [Organization URI]/api/data/v9.2/accounts(6cd81853-7b75-e911-a97
816816
817817
## Handling errors
818818
819-
When an error occurs for a request within a batch, the error for that request will be returned for the batch request and more requests won't be processed.
819+
When an error occurs for a request within a batch, the error for that request is returned for the batch request, and more requests aren't processed.
820820
821-
You can use the `Prefer: odata.continue-on-error` request header to specify that more requests be processed when errors occur. The batch request will return `200 OK` and individual response errors will be returned in the batch response body.
821+
You can use the `Prefer: odata.continue-on-error` request header to specify that more requests be processed when errors occur. The batch request returns `200 OK` and individual response errors are returned in the batch response body.
822822
823823
More information: [OData Specification: 8.2.8.3 Preference odata.continue-on-error](https://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398236)
824824
@@ -1002,7 +1002,7 @@ The [WebAPIService class library (C#)](samples/webapiservice.md) is a sample hel
10021002
> [!NOTE]
10031003
> This sample library is a helper that is used by all the Dataverse C# Web API samples, but it is not an SDK. It is tested only to confirm that the samples that use it run successfully. This sample code is provided 'as-is' with no warranty for reuse.
10041004
1005-
This library includes classes for creating batch requests and processing responses. For example, variations on following code were used to generate many of the HTTP request and response examples in this article.
1005+
This library includes classes for creating batch requests and processing responses. For example, variations on following code were used to generate many of the HTTP request and response examples in this article.
10061006

10071007
```csharp
10081008
using PowerApps.Samples;

powerapps-docs/developer/data-platform/webapi/use-fetchxml-web-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Preference-Applied: odata.include-annotations="*"
350350

351351
## Use FetchXML within a batch request
352352

353-
The length of a URL in a `GET` request is limited. Including FetchXML as a parameter in the URL can reach the limit. You can execute a `$batch` operation using a `POST` request as a way to move the FetchXML out of the URL and into the body of the request where the limit doesn't apply. Sending a `GET` request within a `$batch` allows for URLs up to 64 KB (65,536 characters) in length. More than with a normal `GET` request, but it isn't unlimited. More information: [Execute batch operations using the Web API](execute-batch-operations-using-web-api.md).
353+
The length of a URL in a `GET` request [is limited to 32 KB (32,768 characters)](compose-http-requests-handle-errors.md#maximum-url-length). Including FetchXML as a parameter in the URL can reach the limit. You can execute a `$batch` operation using a `POST` request as a way to move the FetchXML out of the URL and into the body of the request where the limit doesn't apply. Sending a `GET` request within a `$batch` allows for URLs up to 64 KB (65,536 characters) in length. More than with a normal `GET` request, but it isn't unlimited. More information: [Execute batch operations using the Web API](execute-batch-operations-using-web-api.md).
354354

355355
### Example
356356

0 commit comments

Comments
 (0)