Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TRKD /
avatar image
Question by kasun · Jun 18, 2019 at 06:20 AM · 400 bad requestibes2

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

People who like this

0 Show 1
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.

avatar image
kasun · Jun 18, 2019 at 06:22 AM 0
Share

To call the IBES2 API I used following WSDL
http://api.trkd.thomsonreuters.com/schemas/EstimatesIBES2/wsdl/EstimatesIBES2_1_HttpAndRKDToken.wsdl

7 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Gurpreet · Jun 19, 2019 at 11:30 AM

@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": ""}}'
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 Gurpreet · Jun 18, 2019 at 09:10 AM

@kasun Are you developing a new application or adding on to an existing one?

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 kasun · Jun 18, 2019 at 10:11 AM

@Gupreet I'm going to develop a new application using python. I just try to learn how to get response from the API

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 Gurpreet · Jun 18, 2019 at 11:03 AM

@kasun You can try to use the REST/JSON interface for TRKD, as it is easy to use within Python.

I tried the EstimatesIBES2_1/GetMeasures_1 API call and am able to get data. You will have to share your code to help you solve the issue.

Comment

People who like this

0 Show 3 · 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
kasun · Jun 19, 2019 at 03:22 AM 0
Share

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>
avatar image
kasun · Jun 19, 2019 at 03:26 AM 0
Share

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>

avatar image
kasun · Jun 19, 2019 at 03:43 AM 0
Share

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>
avatar image
Answer by kasun · Jun 18, 2019 at 10:59 PM

@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
      }
   }
}'
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 kasun · Jun 19, 2019 at 12:23 PM

@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?

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 Gurpreet · Jun 19, 2019 at 03:41 PM

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": "****"
}
}
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 >
8 People are following this question.
  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • 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
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges