Skip to content

Commit a1f5d27

Browse files
authored
Add README for RESTMessageV2 GET with backoff and telemetry
This README explains how to use the RESTMessageV2 GET helper for handling API throttling, telemetry, and pagination.
1 parent 05b9e6a commit a1f5d27

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# RESTMessageV2 GET with backoff, telemetry, and simple pagination
2+
3+
## What this solves
4+
External APIs frequently throttle with HTTP 429 or intermittently return 5xx. This helper retries safely, honours Retry-After, logs simple telemetry, and follows a links.next pagination model.
5+
6+
## Where to use
7+
Script Include can be called from Scheduled Jobs, Flow Actions, Business Rules, or Background Scripts.
8+
9+
## How it works
10+
- Executes RESTMessageV2 requests
11+
- On 429 or 5xx, sleeps using Retry-After or exponential backoff
12+
- Collects minimal telemetry about attempts and total sleep time
13+
- Appends items from json.items and follows json.links.next
14+
15+
## References
16+
- RESTMessageV2 API
17+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/RESTMessageV2/concept/c_RESTMessageV2API.html
18+
- Direct RESTMessageV2 example
19+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/RESTMessageV2/reference/r_DirectRESTMessageV2Example.html
20+
- Inbound rate limiting and Retry-After header
21+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/integrate/inbound-rest/concept/inbound-REST-API-rate-limiting.html

0 commit comments

Comments
 (0)