@m.arar,
Thank you for your query.
Could you please let us know the endpoint for which you are receiving the error? Also please provide us the request and response headers of the failed API call masking the credentials and the hmac signature.
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 ?
i have answered your query below
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
Sorry it was my mistake that i haven't write the exact group idi 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 support
Please share the request and the response headers of the failed request along with the request body, so we may investigate on the same.
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 + "\"";
WebReq.Date = dateValue;
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
Can you please share the request and the response headers along with the body? The above looks like code snippet from the application.
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.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.ContentLength = 161;
WebReq.Date = 7/29/2020 9:11:15 AM
WebReq.ContentLength =161;
Is this info are clear or you want me to share more info about the request thank you for your support