401 error when custom fields are passed during Sync Case Screening request

Hi Team,
We have .net code to make sync case creation request, which keep on failing when we add custom field in the post data and we are getting 401 error bad request, because of new requirement we have added custom field 'PartyID' under group setting for one of the group.
Post Data look something like that:
{"secondaryFields":[],"customFields":[{"typeId":"PartyID","value":"xxxxxxxxx"}],"providerTypes":["WATCHLIST"],"entityType":"ORGANISATION","groupId":"xxxxx-xxxx-xxxx-xxxx-eXXXXXX","caseId":"","name":"ABC Logistics Trust2"}
AND .net code is: issue is that without custom field case created without any issue and as soon as custom field added system throws exception.
public string WC1SyncCaseScreeningRequest(oBJECT requestObj, XmlElement request, string calledBy, string quoteId, string historyId, string partyType)
{
DateTime dateValue = DateTime.UtcNow; // get the datetime NOW GMT
string wcServiceResponse = string.Empty;
string date = dateValue.ToString("R"); // WC1 header requires GMT datetime stamp
string requestendpoint = "https://" + GateWayHost + GateWayUrl + "cases/screeningRequest";
string postData =string.Empty;
postData = CreatePostData(OfacWCScreener.XmlEscape(string.Concat(requestObj.FirstName, " ", requestObj.LastName)).Trim(), requestObj.NameType, requestObj.PartyID);
string str = string.Empty;
try
{
string msg = postData;
UTF8Encoding encoding = new UTF8Encoding();
byte[] byte1 = encoding.GetBytes(postData);
string dataToSign = "(request-target): post " + GateWayUrl + "cases/screeningRequest" + "\n" +
"host: " + GateWayHost + "\n" +
"date: " + date + "\n" +
"content-type: " + "application/json" + "\n" +
"content-length: " + byte1.Length + "\n" +
msg;
string hmac = generateAuthHeader(dataToSign, APISecret);
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;
using (Stream newStream = WebReq.GetRequestStream())
{
newStream.Write(byte1, 0, byte1.Length);
using (HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse())
Your quick response will be appericiated.
Regards,
Surinder Kumar
Best Answer
-
Thank you for the query.
As per the information provided in the above query, you should ideally get Error 400 : Bad request and not Error 401.
Can you please update the custom field information with the required 'typeId' information available in the case template instead of 'Party ID' and try again?
For example - If the case template provides the custom field values as below -
"customFields": [{
"typeId": "0a3687d0-6334-14a5-98e4-2dd200000f22",
"fieldValueType": "TEXT",
"regExp": null,
"fieldRequired": false,
"label": "Party ID"
}],The custom field information to be passed in the request body would be -
{
"secondaryFields": [],
"customFields": [{
"typeId": "0a3687d0-6334-14a5-98e4-2dd200000f22",
"value": "xxxxxxxxx"
}],
"providerTypes": ["WATCHLIST"],
"entityType": "ORGANISATION",
"groupId": "xxxxx-xxxx-xxxx-xxxx-eXXXXXX",
"caseId": "",
"name": "ABC Logistics Trust2"
}If you are still receiving Error 401, please provide us the request and the response headers along with the request body to have a look into the issue again.
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
- 24 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 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
- 713 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 中文论坛