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 alankar.karol · Dec 07, 2020 at 02:08 PM · world-checkworld-check-onec#.netauthentication

Encounter Authorization error on calling V2 cases/saveandscreen API endpoint

I get an authorization error when I call v2/cases/saveandscreen of WorldCheckOne API. All the other API calls work fine.

I would really appreciate your help/advice.

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.

7 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Mehran Khan · Dec 08, 2020 at 05:51 AM

@alankar.karol

Hi,

401 errors occur because the request has failed an authorization check. This can happen for a variety of reasons, such as

  • An invalid or expired API key,
  • An invalid HMAC signature.
  • Request timing issue/problem with the Date header value. The API client should ensure a correctly synchronized clock is used to generate request timestamps.
  • Incorrect JSON payload formation at your end that can cause you to observe 401 response.

Could you share the complete request and response headers of the 401 API call that you are receiving so that we can investigate it further?


Regards,

Mehran Khan

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 alankar.karol · Dec 14, 2020 at 10:17 AM

Hi Mehran,

Thanks for your reply!

Basically, I am using C# to call your APIs in pilot environment. All the other endpoints we are using work fine except (cases/saveandscreen).

I have got a small code sample in C#, would you like me to share that? If yes how can i attach the source code file?

Cheers

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 alankar.karol · Dec 14, 2020 at 10:29 AM

Hi Mehran, I am adding Request and Response Headers. Hope that helps!


dataToSign

=========================

(request-target): post /v2/cases/saveandscreen

host: rms-world-check-one-api-pilot.thomsonreuters.com

date: Mon, 14 Dec 2020 10:21:47 GMT

content-type: application/json

content-length: 467

{"groupId":"5nzbfqact4r91f3djfkjtszzh","providerTypes":["WATCHLIST"],"nameTransposition":false,"caseScreeningState":{"WATCHLIST":"ONGOING"},"cases":[{"entityType":"INDIVIDUAL","name":"Joe Bloggs","nameTransposition":false,"secondaryFields":[],"customFields":[],"caseId":"a89d0b5a-c5fd-41cd-b202-a787979742f1"},{"entityType":"INDIVIDUAL","name":"Henry","nameTransposition":false,"secondaryFields":[],"customFields":[],"caseId":"5a3bedc2-dfe2-4da7-9195-7618e85787ca"}]}


hmac

==============================

DYzN6ic1BTN6ION7+aAzGUoubXBHrI6kVZiASQIxTOQ=


authorization

===================================

Signature keyId="2152c649-892d-40f6-be73-cf5b03db6924",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="DYzN6ic1BTN6ION7+aAzGUoubXBHrI6kVZiASQIxTOQ="


byte1.Length

====================

467


dateValue.ToString()

============================

14/12/2020 10:21:47


REQUEST HEADERS

=================

var request = new RestRequest();

request.AddHeader("Authorization", authorisation);

request.AddHeader("Cache-Control", "no-cache");

request.AddHeader("Date", dateValue.ToString());

request.AddHeader("content-type", "application/json");

request.AddHeader("content-length", byte1.Length.ToString());


RESPONSE

=================

Unauthorized

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 Mehran Khan · Dec 14, 2020 at 01:20 PM

@alankar.karol

I tried replicating this using your keys and was able to successfully consume the API on postman so there are no issues with your request payload.

I tried to replicate your exact same request next with the exact timestamp i.e. Mon, 14 Dec 2020 10:21:47 GMT, and I see that the HMAC generated by your code is incorrect, I suspect there is an issue with the content length calculation in your code.

For the exact same payload and a successful request, the content-length that I see is 542 but from your logs, your code is probably calculating it to 467, can you please check this part of your code?

Let me know if we need to get on a quick phone call sometime tomorrow, I will be happy to jump in and discuss this over a meeting.

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 Mehran Khan · Dec 14, 2020 at 01:22 PM

@alankar.karol

Here is the request-response from my replicated API call. I have masked the API key for confidentiality purposes and highlighted the signature for your attention.


POST /v2/cases/saveAndScreen HTTP/1.1

Host: rms-world-check-one-api-pilot.thomsonreuters.com

Date: Mon, 14 Dec 2020 10:21:47 GMT

Authorization: Signature keyId="2152c649-892d-40f6-be73-cf**********",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="WyL1HMa83doGIHS3V7hzKWBudWnUyCbboWUzufBZ5Tg="

Content-Type: application/json

Content-Length: 542


{

"groupId": "5nzbfqact4r91f3djfkjtszzh",

"providerTypes": ["WATCHLIST"],

"nameTransposition": false,

"caseScreeningState": {

"WATCHLIST": "ONGOING"

},

"cases": [{

"entityType": "INDIVIDUAL",

"name": "Joe Bloggs",

"nameTransposition": false,

"secondaryFields": [],

"customFields": [],

"caseId": "a89d0b5a-c5fd-41cd-b202-a787979742f1"

}, {

"entityType": "INDIVIDUAL",

"name": "Henry",

"nameTransposition": false,

"secondaryFields": [],

"customFields": [],

"caseId": "5a3bedc2-dfe2-4da7-9195-7618e85787ca"

}]

}

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 alankar.karol · Jan 04, 2021 at 10:41 AM

Hi Mehran,

Thanks for your support. Sorry I have been away for the holidays. Here is what i tried;


I hardcoded the content length to 542 in my code and it still failed. Then I compared the HMAC Signature, which doesn't match with what you mentioned above.


HMACS:

Your:

WyL1HMa83doGIHS3V7hzKWBudWnUyCbboWUzufBZ5Tg=

Mine:

c2KTdPXemA5ZMDt5+qA91WJIY4V1nfINLvPOQ/bqYmo=

I am not sure what's going on here. Please let me know the timings to jump on a quick call.

Cheers,


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 Mehran Khan · Jan 07, 2021 at 05:18 AM

@alankar.karol

I have sent you an email, let's get on a meeting and get this resolved.

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 >
13 People are following this question.

Related Questions

Calling API from C#

World Check One API Case Screening 401 Unauthorized

"cases/{ {case-system-id}}/screeningRequest" is not updating case results when called again after case update request

Is it possible for the API using Console application – Microsoft visual studio C# .NET instead of postman?

401: SEQ-pre-groups: Get my top-level groups (pm is not defined)

  • 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
  • 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
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges