Hi I am trying to GetBrokerUsersEntitlements_1 from salesforce, I am using HTTP. If i use the sam...

...e json body from within the thomsonreuters site it will give me the response.
I am getting this error from salesforce as the response.
"{"Fault":{"Code":{"Value":"s:Receiver","Subcode":{"Value":"a:Security_MissingAuthorization"}},"Reason":{"Text":{"lang":"en-US","Value":"Missing the mandatory 'http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1:Authorization' SOAP header in the user request."}},"Detail":{"ClientErrorReference":{"Timestamp":"2017-10-13T18:33:06.31979Z","ErrorReference":"df3ba8bccdaa40f584bef8aae519f08d","ServerReference":"D0B4498C3E7872E69F382B5CE83AEDFCFC5D463AB8375163"}}}}"
// Below is the code
String username = 'removed';
String password = 'removed';
string appId = 'removed';
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint('https://api.trkd.thomsonreuters.com/api/BrokerEntitlementsManagement/BrokerEntitlementsManagement.svc/REST/BrokerEntitlementsManagement_1/GetBrokerUsersEntitlements_1');
Blob headerValue = Blob.valueOf(username +':'+ appId +':'+ password);
system.debug('authorizationHeader '+ authorizationHeader);
req.setHeader('Authorization', authorizationHeader);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', 'application/json');
stirng jsonBody = '{"GetBrokerUsersEntitlements_Request_1":{"getUserLogin":true,"ctbId":sampleID-Number,"sortByCompany":{"field1":"Id","field2":"Id","field3":"Id","order":"Asc"},"sortByUser":{"field1":"FirstName","field2":"FirstName","field3":"FirstName","order":"Asc"},"search":{"byUserEmail":{"email":[{"type":"some sample data"}]}}}}';
req.setBody(jsonBody);
// Send the request, and return a response
HttpResponse res = new http().send(req);
system.debug('PSM ' + res.getBody());
Best Answer
-
Hello @pradeepsm36
The "Missing the mandatory 'http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1:Authorization' SOAP header in the user request." error message means the application does not set the authorize information in the request message header.
Basically, the application need to authenticate with TRKD Authentication service first to get an authen token, then sends a request message to the interested TRKD service with the following authentication information in the request message header:
- X-Trkd-Auth-ApplicationID: 'app id'
- X-Trkd-Auth-Token: 'authen toker'
Please see more detail in TRKD Token Management service page.
0
Answers
-
Hi Thank you for the response, I would like to know should I go through the entire
Create Service Token
after that
Create Impersonation Token v3
entire process in the below URL "https://www.trkd.thomsonreuters.com/SupportSite/TestApi/Svc?svc=TokenManagement_1"
because, I got the token from first method (create service token) and passing the token to get users but yet getting the same error. Cloud please give me a suggestion.
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint(MASKED);
Blob headerValue = Blob.valueOf(appId +':'+ token);
string authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setHeader('Content-Type', 'application/json');
string jsonBody = '{"GetBrokerUsersEntitlements_Request_1":{"getUserLogin":true,"ctbId":MASKED,"sortByCompany":{"field1":"Id","field2":"Id","field3":"Id","order":"Asc"},"sortByUser":{"field1":"FirstName","field2":"FirstName","field3":"FirstName","order":"Asc"},"search":{"byUserEmail":{"email":[{"type":"MASKED"}]}}}}';
req.setBody(jsonBody);
HttpResponse res = new http().send(req);
system.debug('PSM fetchBrokerUserfromTKRD' + res.getBody());
Error MSG Below:
fetchBrokerUserfromTKRD{"Fault":{"Code":{"Value":"s:Receiver","Subcode":{"Value":"a:Security_MissingAuthorization"}},"Reason":{"Text":{"lang":"en-US","Value":"Missing the mandatory 'http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1:Authorization' SOAP header in the user request."}},"Detail":{"ClientErrorReference":{"Timestamp":"2017-10-16T08:43:30.1477549Z","ErrorReference":"0876f77abc1d4886824d6cf4f2cb41a1","ServerReference":"CC9119A1C7AF6EE8A4AC539448F190A4CCE7101831609249"}}}}0 -
is there some encoding that needs to be done for the token. For example: SHA256 or something that I might be missing.
Any help would be greatly appreticated.
Thank you
0 -
Hi @pradeepsm36,
Try setting your headers to look like this instead:
req.setHeader('X-Trkd-Auth-ApplicationID', appId);
req.setHeader('X-Trkd-Auth-Token', token);The above 'token' is what is returned when you requested for your service token.
0 -
Hi Nick, Thank you so much for the solution also
.
Thank you
Pradeep
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
- 695 Datastream
- 1.5K DSS
- 631 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
- 255 ETA
- 562 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
- 736 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
- 96 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛