DSS 429 Response

Query: "Hi
I'm trying to find an example of a DSS 429 (too many requests) response body & headers in your docs so that we can handle it correctly but I can't seem to find one. Can you provide one please?
Thanks"
Edit/Update with more information:
"
I'm not asking that you provide and example request I can make to see this error, I know that isn't possible.
In your API documentation there should be examples of what headers and body will be received for each kind of error, for example for a 400 error you have an example of the headers and body here https://selectapi.datascope.refinitiv.com/RestApi.Help/Home/KeyMechanisms?ctx=Extractions&opn=Extract&sce=Validation%20Error%20(400%20status%20code)&stp=1&tab=3&uid=Validation
I need a similar example for a 429 error. If you're going to rate limit clients, it's only fair that you provide examples that demonstrate how to handle that situation"
Best Answer
-
Thank you for reaching out to us.
To get 429 (too many requests), you need to send a lot of requests concurrently that exceeds the
Queued Extraction Request Limit defined in the DataScope Select Best Practices & Fair Usage Policy.
For example the code could like this:
import requests
import concurrent.futures
import time
import json
token = '<token>'
def get_status(url):
payload = json.dumps({
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest",
"ContentFieldNames": [
"RIC",
"ETH Expiry Date"
],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{
"Identifier": "ESc1",
"IdentifierType": "Ric"
}
],
"ValidationOptions": {
"AllowHistoricalInstruments": True
},
"UseUserPreferencesForValidationOptions": False
},
"Condition": {
"ReportDateRangeType": "Range",
"QueryStartDate": "2000-01-01",
"QueryEndDate": "2023-01-01"
}
}
})
headers = {
'Prefer': 'respond-async',
'Content-Type': 'application/json',
'Authorization': 'Token '+token
}
response = requests.request("POST", url, headers=headers, data=payload)
return response.status_code
url = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractWithNotes"
tm1 = time.perf_counter()
with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:
futures = []
for iter in range(1, 200):
futures.append(executor.submit(get_status, url=url))
for future in concurrent.futures.as_completed(futures):
print(future.result())
tm2 = time.perf_counter()
print(f'Total time elapsed: {tm2-tm1:0.2f} seconds')0
Answers
-
Hi @Jirapongse ,
Thanks for the example to reach the limit but on checking this is not what the user needs.
What they are after is something like the below:
"
In your API documentation there should be examples of what headers and body will be received for each kind of error, for example for a 400 error you have an example of the headers and body here https://selectapi.datascope.refinitiv.com/RestApi.Help/Home/KeyMechanisms?ctx=Extractions&opn=Extract&sce=Validation%20Error%20(400%20status%20code)&stp=1&tab=3&uid=Validation
I need a similar example for a 429 error."
0 -
The error 429 can't be demonstrated by using the simple request messages.
Moreover, typically we create examples that demonstrate the valid usages.
If the client needs more examples on that page, please contact the product team directly for further consideration.
0 -
Hi @Jirapongse,
Thanks for sending me the below example response via Teams, I will forward.
HTTP/1.1 429 Too Many Requests
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
BeginRequestTime: 09:16:37.3190382
BeginRequestDate: 2023-11-29
X-Request-Execution-Correlation-Id: CiD/9008895/AAAAAA.08b8e48231894ac0/RA
X-App-Id: Custom.RestApi
X-App-Version: 17.3.161.64
CPUUtilization: 20.83539
RequestsPerSec: 22.10375
W3WP-PrivateBytes: 1597248
Date: Wed, 29 Nov 2023 09:16:36 GMT
Content-Length: 187
{
"error": {
"message": "Too many requests for throttling category \"OnDemandExtractions\", user id \"<UserID>\". Approximately 165 requests were made in 60 seconds to 15 active server(s)."
}
}Kind regards,
Gareth
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 616 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛