Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Screening /
  • World-Check One /

For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads

avatar image
Question by cadyh · Jul 09, 2021 at 10:54 PM · world-checkworld-check-onecase

C# code post create-a-case returns 401 unauthorized

Hi,

I use the sample c# code, adding the api key and api secret. Call the get groups to get group id. Then call post cases to create a case with group id from previous call. This returns 401 unauthorized.

I use the same request body in postman and it works.

I notice some differences between postman and c# code. Postman has longer content length(171) than c# code generated(138) request. I don't know why.

Here is the request data from c# code

dataToSign = "(request-target): post/v2/cases\nhost: api-worldcheck.refinitiv.com\ndate: Fri, 09 Jul 2021 22:38:46 GMT\ncontent-type: application/json\ncontent-length: 138\n{\"entityType\":\"ORGANISATION\",\"groupId\":\"xxxxxxxxxxxxxxxxxxxxxxxxx\",\"provideTypes\":[\"WATCHLIST\"],\"name\":\"Lajnat ul Masa Eidatul Afghaniab\"}"

authorisation = "Signature keyId=\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date content-type content-length\",signature=\"vf7X29JltDSWMW938DwfnC6qW7A8XKrjCGHdDkczW9Y=\""

Please assist.

Thank you,

Cady

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

6 Replies

  • Sort: 
avatar image
Best Answer
Answer by cadyh · Jul 19, 2021 at 04:00 PM

Thanks to Prabhjyot's help, I was able to find out the typo in the request body. I had provideType. It should be providerType.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by prabhjyot.mandla · Jul 12, 2021 at 08:47 AM

@cadyh ,

Can you please share the request payload as it is being passed using the code and postman to compare the values?


Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by cadyh · Jul 12, 2021 at 01:15 PM

The request using the code is in the question.

Here is the request using Postman



Request Headers

Date: Mon, 12 Jul 2021 13:11:34 GMTContent-Type: application/jsonAuthorization: Signature keyId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="8WaJl5RGH88c7zJJ7Ls5/1mexev6K35MurIZnI0sEKo="Content-Length: 171User-Agent: PostmanRuntime/7.28.1Accept: */*Cache-Control: no-cachePostman-Token: 92636f9a-73f8-4d51-b8c0-a0fee5ea9d53Host: api-worldcheck.refinitiv.comAccept-Encoding: gzip, deflate, brConnection: keep-alive

Request Body

{ "entityType": "ORGANISATION", "groupId": "xxxxxxxxxxxxxxxxxxxxxxxxx", "providerTypes": [ "WATCHLIST" ], "name": "Lajnat ul Masa Eidatul Afghaniab" }


Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by prabhjyot.mandla · Jul 13, 2021 at 05:59 AM

@cadyh ,

Thanks for the details.

Can you please confirm if you are using the same format as above of the request payload in the code and postman? Or are the formats getting changed in anyway?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by cadyh · Jul 13, 2021 at 01:44 PM

No, the format is not changed. They are both from WorldCheck sample code. The have changedthe name and added this code "ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;" from answer in other question to solve the problem with the error "Could not create secured channel". I have tried with different names.

I noticed there is a space between post and gatewayurl that I removed somehow( must be when I tried different things to solve this problem) in the dataToSign variable. I added back in. This is now the same as the sample code (below)

UTF8Encoding encoding = new UTF8Encoding();

byte[] byte1 = encoding.GetBytes(postData);

string msg = 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;


I now get a different error. With the space back in I now get error 500 Internal Server Error.

This is the dataToSign value: "(request-target): post /v2/cases\nhost: api-worldcheck.refinitiv.com\ndate: Tue, 13 Jul 2021 20:54:17 GMT\ncontent-type: application/json\ncontent-length: 138\n{\"entityType\":\"ORGANISATION\",\"groupId\":\"xxxxxxxxxxxxxxxxxxxxxxx\",\"provideTypes\":[\"WATCHLIST\"],\"name\":\"Lajnat ul Masa Eidatul Afghaniab\"}"

I see the postman body has new line and indented so I removed them all. The content length from postman is now show 139, it is 1 longer than the content length from C# code. I can't find where that 1 different in length is. Is it really the cause of the issue?

Request HeadersDate: Tue, 13 Jul 2021 20:51:43 GMTContent-Type: application/jsonAuthorization: Signature keyId="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="e/Sxhitb/KbbSdt3Qqml0KsPbIGMLR0XwzWT6eCm5Cs="Content-Length: 139User-Agent: PostmanRuntime/7.28.1Accept: */*Cache-Control: no-cachePostman-Token: 4a30df6a-6450-400c-afa7-65210b4a92eaHost: api-worldcheck.refinitiv.comAccept-Encoding: gzip, deflate, brConnection: keep-alive


Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Prabhjyot · Jul 14, 2021 at 11:41 AM

@cadyh ,

I will send you an email, so we can get on a call to look further into the issue.


Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

How to get information around risk indicators, Profile Action Type (like SANCTION) ?

Assign a case to specific user

Getting a 401 when "Post"ing a case to the API

Will World-Check one API gives instant response for a lead/customer data?

Can the World Check API handle null values?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • FX Venues
    • FX Trading – RFQ Maker
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges