Am trying to post request to WC1 API but i get an error The remote server returned an error: (404...

Answers
-
requestendpoint = "https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/cases";
post Data:string postData = "{\"secondaryFields\":[],\"entityType\":\"INDIVIDUAL\",\"customFields\":[],\"groupId\":\"418f28a7-b9c9-4ae4-8530-819c61b1ca6c\",\"providerTypes\":[\"WATCHLIST\"],\"name\":\"乔治布什\"}";
my Request:
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(requestendpoint);
// Set the Headers
WebReq.Method = "POST";
WebReq.Headers.Add("Authorization", authorisation);
WebReq.Headers.Add("Cache-Control", "no-cache");
WebReq.ContentLength = msg.Length;
WebReq.Date = dateValue; // use datetime value GMT time
// Set the content type of the data being posted.
WebReq.ContentType = "application/json";
WebReq.ContentLength = byte1.Length;
do you want me to provide you with My api and api Secret ?0 -
i have answered your query below
0 -
Thank you for the details.
Can you please check if the group-id which you are using is the correct one? Please use the below endpoint to fetch the group id.
https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/groups
0 -
Sorry it was my mistake that i haven't write the exact group id
i have change it to the correct one, but now i am getting new error at get GetResponse()'The remote server returned an error: (401) .'
Thank you for your support0 -
string postData = "{\"secondaryFields\":[],\"entityType\":\"INDIVIDUAL\",\"customFields\":[],\"groupId\":\"e0eb258d-d67d-4843-a592-7e973de6aa85\",\"providerTypes\":[\"WATCHLIST\"],\"name\":\"WASATA\"}";
string msg = postData;
//Console.WriteLine(msg);
UTF8Encoding encoding = new UTF8Encoding();
byte[] byte1 = encoding.GetBytes(postData);
string dataToSign = "(request-target): post " + gatewayurl + "cases\n" +
"host: " + gatewayhost + "\n" + // no https only the host name
"date: " + date + "\n" + // GMT date as a string
"content-type: " + "application/json" + "\n" +
"content-length: " + byte1.Length + "\n" +
msg;
string authorisation = "Signature keyId=\"" + apikey + "\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date content-type content-length\",signature=\"" + hmac + "\"";
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(requestendpoint);
WebReq.Method = "POST";
WebReq.Headers.Add("Authorization", authorisation);
WebReq.Headers.Add("Cache-Control", "no-cache");
WebReq.ContentLength = msg.Length;
WebReq.Date = dateValue;
WebReq.ContentType = "application/json";
WebReq.ContentLength = byte1.Length;
Stream newStream = WebReq.GetRequestStream();
newStream.Write(byte1, 0, byte1.Length);
// Get the Response - Status OK
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
// Status information about the request
Console.WriteLine(WebResp.StatusCode);
Console.WriteLine(WebResp.ResponseUri);
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
string jsontxt = _Answer.ReadToEnd();
This is my full request
0 -
request endpoint: "https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/groups";
postRequestData: "{\"secondaryFields\":[],\"entityType\":\"INDIVIDUAL\",\"customFields\":[],\"groupId\":\"e0eb258d-d67d-4843-a592-7e973de6aa85\",\"providerTypes\":[\"WATCHLIST\"],\"name\":\"WASATA\"}";
WebReq.Method = "POST";WebReq.Headers.Add("Authorization", Signature keyId="43c4a334-ce22-4ab8-8658-fd816de77f60",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="O0U5Jx5QUlXvCgpmspm9n74uUQYbQ20BcFc1lHeOALA=");
WebReq.Headers.Add("Cache-Control", "no-cache");
WebReq.ContentLength = 161;
WebReq.Date = 7/29/2020 9:11:15 AM
WebReq.ContentType = "application/json";
WebReq.ContentLength =161;
0 -
Is this info are clear or you want me to share more info about the request
thank you for your support0 -
Authorization: WWW-Authenticate: Signature realm="World-Check One API",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length"
i have found this in the world check one api documentation as an response header
the code the i have showed you before i have download it from world check one Api, but in the code i don't see where is the response header are called0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 697 Datastream
- 1.5K DSS
- 632 Eikon COM
- 5.2K Eikon Data APIs
- 12 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 4 Trading API
- 2.9K Elektron
- 1.4K EMA
- 256 ETA
- 563 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
- 281 Open PermID
- 46 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 749 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
- 123 Open DACS
- 1.1K RFA
- 107 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 96 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛