question

Upvotes
Accepted
1 0 0 3

Does anyone have an example of calling the api.thomsonreuters.com/permid/match API in Java. I need the format for the text only call. Not documented

javapermid-apiintelligent-tagging-apiopen-permid-api
icon clock
10 |1500

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

Hello @paul.bleeker

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such. Thanks, AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.9k 250 52 74

The code in Java looks like:

        CloseableHttpClient httpclient = HttpClientBuilder.create().disableContentCompression().build();
        String urlHost = "https://api.thomsonreuters.com";
        HttpPost httppost = new HttpPost(urlHost + "/permid/match");
        
        httppost.addHeader("x-ag-access-token", "<token>");
        httppost.addHeader("x-openmatch-dataType","Organization");
        httppost.addHeader("Content-Type","text/plain" );
        String body="LocalID,Standard Identifier,Name,Country,Street,City,PostalCode,State,Website\r\n1,RIC:AAPL.O|Ticker:AAPL,Apple,US,\"Apple Campus, 1 Infinite Loop\",Cupertino,95014,California,";
        try {
        	StringEntity requestBody = new StringEntity(body);
        	httppost.setEntity(requestBody);
        	ResponseHandler<String> responseHandler = new BasicResponseHandler();
        	String response = httpclient.execute(httppost, responseHandler);
			System.out.println(response);
		} catch (ClientProtocolException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        

Set the value of x-ag-access-token to your token. The format of text in the body is available at https://permid.org/match.

The code uses org.apache.httpcomponents for HTTP post request.

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.8</version>
</dependency>
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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