400 Bad request when calling IBES2 Methods using SoapUI
I have an account in www.trkd.thomsonreuters.com. I want to call APIs in Estimate IBES2. I generated the service token and impersonation token, referring the API documentation. WSDL file used to generate tokens is as follows.
wsdl: http://api.trkd.thomsonreuters.com/schemas/TokenManagement/wsdl/TokenManagement_1_HttpsAndAnonymous.wsdl
Soap Requests for token generation is as follows.
Service token - Refer 4.4.2.2 in the API document
Impersonation token - Refer 4.4.3.1 in the API document
After getting the impersonation token I tried to call the API to retrieve IBES2 Estimates Measures Data as refered in 48.3.1.1 in the documentaion. Provided [impersonation token] and [AppID].
But when calling the API I get 400 Bad Request. How can I call the API in 48.3.1.1 correctly?
To call the IBES2 API I used following WSDL
http://api.trkd.thomsonreuters.com/schemas/EstimatesIBES2/wsdl/EstimatesIBES2_1_HttpAndRKDToken.wsdl
Best Answer
-
@kasun There are couple of issues with your cURL request.
Here is a working one:
curl -X POST http://api.trkd.thomsonreuters.com/api/EstimatesIBES2/EstimatesIBES2.svc/REST/EstimatesIBES2_1/GetMeasures_1
-H "content-type: application/json;charset=utf-8"
-H "X-Trkd-Auth-ApplicationID: ****"
-H "X-Trkd-Auth-Token: ****"
-d '{"GetMeasures_Request_1": {"Symbol": {"Type": "RIC", "Value": "IBM.N"}, "Period": ""}}'0
Answers
-
To call the IBES2 API I used following WSDL
http://api.trkd.thomsonreuters.com/schemas/EstimatesIBES2/wsdl/EstimatesIBES2_1_HttpAndRKDToken.wsdl0 -
@Gurpreet. As you requested I tried to call using Rest API. Follow shows the curl command of the POST request. Still get 400 Bad request.
curl -X POST \
http://api.trkd.thomsonreuters.com/api/EstimatesIBES2/EstimatesIBES2.svc \
-H 'Accept: */*' \
-H 'Action: http://www.reuters.com/ns/2011/12/02/webservices/rkd/EstimatesIBES2_1/GetMeasures_1' \
-H 'Authorization: {"ApplicationID": "[AppID]", "Token": "[Impersonate token with 289 characters]"}' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/soap+xml' \
-H 'Host: api.trkd.thomsonreuters.com' \
-H 'MessageID: ${=java.util.UUID.randomUUID()}' \
-H 'accept-encoding: gzip, deflate' \
-H 'cache-control: no-cache' \
-H 'content-length: 169' \
-d '{
"GetMeasures_Request_1": {
"Symbol": {
"Value": "IBM.N"
},
"RequestOptions": {
"IncludeSymbolInfo": true
}
}
}'0 -
To get Service token:
WSDL: http://api.trkd.thomsonreuters.com/schemas/TokenManagement/wsdl/TokenManagement_1_HttpsAndAnonymous.wsdl<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Header>
<To xmlns="http://www.w3.org/2005/08/addressing">https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/Anonymous</To>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">${=java.util.UUID.randomUUID()}</MessageID>
<Action>http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1/CreateServiceToken_1</Action>
</Header>
<Body>
<CreateServiceToken_Request_1 xmlns:global="http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1" xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1">
<ApplicationID xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1">[AppID]</ApplicationID>
<Username>[Username]</Username>
<Password>[Password]</Password>
</CreateServiceToken_Request_1>
</Body>
</Envelope>0 -
To get Impersonation token:
WSDL: http://api.trkd.thomsonreuters.com/schemas/TokenManagement/wsdl/ TokenManagement_1_HttpsAndAnonymous.wsdl
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Header>
<To xmlns="http://www.w3.org/2005/08/addressing">https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/Anonymous</To>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">${=java.util.UUID.randomUUID()}</MessageID>
<Action>http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1/CreateImpersonationToken_2</Action>
<Authorization xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1">
<ApplicationID>[AppID]</ApplicationID>
<Token>[Impersonation Token]</Token>
</Authorization>
</Header>
<Body>
<CreateImpersonationToken_Request_2 xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1">
<ApplicationID xmlns="http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1">[AppID]</ApplicationID>
<Username>[username]</Username>
<Password>[password]</Password>
<EffectiveUsername userType="Reuters">[username]</EffectiveUsername>
</CreateImpersonationToken_Request_2>
</Body>
</Envelope>0 -
IBES2 Estimates Measures Data (Using SOAP)
WSDL: http://api.trkd.thomsonreuters.com/schemas/EstimatesIBES2/wsdl/EstimatesIBES2_1_HttpAndRKDToken.wsdl<Envelope xmlns=”http://www.w3.org/2003/05/soap-Envelope”>
<Header>
<To xmlns=”http://www.w3.org/2005/08/addressing”>http://api.trkd.thomsonreuters.com/api/EstimatesIBES2/EstimatesIBES2.svc</To>
<MessageID xmlns=”http://www.w3.org/2005/08/addressing”>[Unique Message ID]</MessageID>
<Action>http://www.reuters.com/ns/2011/12/02/webservices/rkd/EstimatesIBES2_1/GetMeasures_1</Action>
<Authorization xmlns=”http://www.reuters.com/ns/2006/05/01/webservices/rkd/Common_1”>
<ApplicationID>[AppID]</ApplicationID>
<Token>[Impersonation token with 289 characters]</Token>
</Authorization>
</Header>
<Body>
<GetMeasures_Request_1 xmlns="http://www.reuters.com/ns/2016/02/01/webservices/rkd/EstimatesIBES2_1" xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Symbol>
<Value>IBM.N</Value>
</Symbol>
<RequestOptions>
<IncludeSymbolInfo>true</IncludeSymbolInfo>
</RequestOptions>
</GetMeasures_Request_1>
</Body>
</Envelope>0 -
@Gurpreet. Thanks it works.
By the way can you tell me curl command to get Service token and Impersonation token?
curl -X POST \ http://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/TokenManagement_1/CreateServiceToken_1 \ -H 'Action: http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1/CreateServiceToken_1' \ -H 'Authorization: Basic dHJrZC1kZW1vLXdtQHRob21zb25yZXV0ZXJzLmNvbTpsNG82ZzMxbXo=' \ -H 'Content-Type: application/json;charset=utf-8' \ -H 'Host: api.trkd.thomsonreuters.com' \ -H 'MessageID: 1560962043' \ -H 'To: http://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/TokenManagement_1/CreateServiceToken_1' \ -H 'content-length: 174' \ -d '{ "CreateServiceToken_Request_1": { "ApplicationID": "[AppID]", "Username": "[username]", "Password": "[password]" } }'
Above is the curl command I tried for service token. Response is as below
{ "Fault": { "Code": { "Value": "Receiver", "Subcode": { "Value": "a:General_UnhandledException" } }, "Reason": { "Text": { "lang": "en-US", "Value": "The message with Action 'http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1/CreateServiceToken_1' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)." } }, "Detail": { "ClientErrorReference": { "Timestamp": "2019-06-19T16:35:46.5096532Z", "ErrorReference": "50f6c5a58d8445cd9a79c1552355aecf", "ServerReference": "D046D2F28F742103D4E3F226A47FB35F0B7B127121B9875C" } } } }
Where did I get wrong here?
0 -
To get the service token use:
curl -X POST https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1
-H "content-type: application/json;charset=utf-8"
-d '{"CreateServiceToken_Request_1": { "ApplicationID": appid, "Username": username, "Password": password }}'
Response:
{
"CreateServiceToken_Response_1": {
"Expiration": "2019-06-19T21:09:29.8996736Z",
"Token": "****"
}
}0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛