World check Api: problem with QUERY PARAMETERS

With c# in every Api with query parameters i have error 401.
Example:
this works:
RequestUri = new Uri("https://api-worldcheck.refinitiv.com/v2/cases/5jb6uu6extle1hugpq6ibcm37),
error 401:
RequestUri = new Uri("https://api-worldcheck.refinitiv.com/v2/cases/5jb6uu6extle1hugpq6ibcm37?aggregatedSummary=true"),
Best Answer
-
Hi @raffaele.rocco, I have emailed you a working request sample with the query parameters "?aggregatesSummary=true". Kindly take a look at it at your earliest convenience.
A couple things to note:- With the attached sample code, we can confirm that the provided case system id has returned an aggregated summary of the case against the API key and API secret
- To confirm a successful API response with the end point "?aggregatedSummary=true", we advise to wrap the end point as a URI instead of sending it as a string. The attached sample code does contain such code line
- The sample code contains your API credentials included the case system id. Please import the sample code as a project with your IDE. The project name is api.sln
- The sample code contains an Authorization builder to takes care of generating the hmac. The authorization builder is contained in the code file name AuthHeaderBuilder.cs. This is part of the project.
Kindly let me know the outcome at your earliest convenience.
Blessings,
Judith
0
Answers
-
Complete code from your example:
DateTime dateValue = DateTime.UtcNow;
string date = dateValue.ToString("R");
string gatewayurl = "/v2/";
string gatewayhost = "api-worldcheck.refinitiv.com";
string apikey = "xxxxxxxxxxxxxxxxxxxx";
// "caseId": "5jb6uu6extle1hugpq6ibcm36",
string apisecret = "xxxxxxxxxxxxxxxxxx";
string nameApi = "cases/5jb6uu6extle1hugpq6ibcm37";
//error 401
//string nameApi = "cases/5jb6uu6extle1hugpq6ibcm37?aggregatesSummary=true";
string requestendpoint = "https://api-worldcheck.refinitiv.com/v2/" + nameApi;
string dataToSign = "(request-target): get " + gatewayurl + nameApi + "\n" +
"host: " + gatewayhost + "\n" + // no https only the host name
"date: " + date; // GMT date as a string
// The Request and API secret are now combined and encrypted
string hmac = generateAuthHeader(dataToSign, apisecret);
string authorisation = "Signature keyId=\"" + apikey + "\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date\",signature=\"" + hmac + "\"";
Console.WriteLine(authorisation);
// Send the Request to the API server
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(requestendpoint);
// Set the Headers
WebReq.Method = "GET";
WebReq.Headers.Add("Authorization", authorisation);
WebReq.Headers.Add("Cache-Control", "no-cache");
WebReq.Date = dateValue; // use datetime value GMT time
// Get the Response - Status OK
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
// Status information about the request
Console.WriteLine(WebResp.StatusCode);
Console.WriteLine(WebResp.ResponseUri);
// Get the Response data
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
string jsontxt = _Answer.ReadToEnd();
// convert json text to a pretty printout
var obj = Newtonsoft.Json.JsonConvert.DeserializeObject(jsontxt);
var f = Newtonsoft.Json.JsonConvert.SerializeObject(obj, Newtonsoft.Json.Formatting.Indented);
Console.WriteLine(f);
0 -
Hello @raffaele.rocco - thank you for reaching out. I will be looking into your question shortly and will respond to you as soon as I have an update. Thanks!
Blessings,
Judith
0 -
Ok thank's.
If it can help you, i have error only when i use this format to the url:
?param=xxxx
instead it works in this format:
/param
0 -
Hi @raffaele.rocco - thank you for your patience. Our World-Check One API Dev Community Downloads section has Request Code Samples, and I am attaching our updated C# .NET samples below: postRequest.txt & getRequest.txt
Kindly let me know if these request samples are able to help you get a successful response at your earliest convenience.
Blessings,
Judith
0 -
0
-
Sorry Judith, but your example is the same one i used and it works.
I have the error 401 only when i use query parameters!
Example:
string requestendpoint = "https://api-worldcheck.refinitiv.com/v2/cases/5jb6uu6extle1hugpq6ibcm37?aggregatesSummary=true"
0 -
with your c# example now it works.
Thank you
0 -
It works. Thank's
0 -
That's great! Thanks for the update.
Blessings,
Judith
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
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 280 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 720 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛