Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Open PermID /
avatar image
Question by vna · Oct 19, 2016 at 08:07 PM · pythonerrorintelligent-tagging-apipermid-apiopen-permid-apijson

Record Matching API website support gives an error

Hello,

I'm trying to use the website feature through a python script using the REST API, and hitting a snag. It appears that there is a trailing \r after the data that messes up the JSON parsing:

URL='https://api.thomsonreuters.com/permid/match'

header={'Accept': 'application/json', 'Content-Type': 'text/plain', 'x-ag-access-token': 'xxx', 'x-openmatch-dataType': 'Organization', 'x-openmatch-numberOfMatchesPerRecord': 1}

data='LocalID,Standard Identifier,Name,Country,Street,City,PostalCode,State,Website \n ,,Apple,,,,,,http://www.apple.com'

Exception Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/requests/models.py", line 819, in json return json.loads(self.text, **kwargs)

...File "/usr/lib/python2.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Invalid control character u'\r' at: line 1 column 692 (char 691)

Note: i am running python 2.7 and requests 2.7 in cygwin, on windows 10.

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.

5 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Oct 21, 2016 at 03:42 AM

@vna

I found that the problem only happens when the request text contains the website information.


LocalID,Standard Identifier,Name,Country,Street,City,PostalCode,State,Website

,,Apple,,,,,,www.apple.com


The response will contain 0x0D after the "Input_Website" text.

However, if I removed the website information, the response is fine.

LocalID,Standard Identifier,Name,Country,Street,City,PostalCode,State,Website

,,Apple,,,,,,

The response is:

{
  "ignore": "    ",
  "unMatched": 0,
  "matched": {
    "total": 1,
    "excellent": 1
  },
  "numReceivedRecords": 1,
  "numProcessedRecords": 1,
  "numErrorRecords": 0,
  "headersIdentifiedSuccessfully": [
    "localid",
    "standard identifier",
    "name",
    "country",
    "street",
    "city",
    "postalcode",
    "state",
    "website"
  ],
  "headersNotIdentified": [],
  "headersSupportedWereNotSent": [],
  "errorCode": 0,
  "errorCodeMessage": "Success",
  "resolvingTimeInMs": 238,
  "requestTimeInMs": 238,
  "outputContentResponse": [
    {
      "ProcessingStatus": "OK",
      "Match OpenPermID": "https://permid.org/1-4295905573",
      "Match OrgName": "Apple Inc",
      "Match Score": "92%",
      "Match Level": "Excellent",
      "Match Ordinal": "1",
      "Original Row Number": "2",
      "Input_Name": "Apple"
    }
  ]
}

Please confirm if it is the same problem that you found.


hex.png (9.9 KiB)
Comment
vna

People who like this

1 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 vna · Oct 24, 2016 at 05:56 PM

Yes, it is the same issue I have. Did you find any way to counteract that? (that ideally doesn't require me to hack into the requests library for this one special case)

Comment

People who like this

0 Show 2 · 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
Jirapongse ♦♦ · Oct 25, 2016 at 03:35 AM 1
Share

I have contacted the support team to verify this problem.

avatar image
REFINITIV
Jirapongse ♦♦ · Nov 09, 2016 at 01:18 AM 0
Share

@vna

The development team can replicate the issue. They will handle it. I will keep you updated on its progress.

avatar image
Answer by vna · Jan 27, 2017 at 05:22 PM

Hello Jira, any news on this bug? I was hoping to start using websites by next month :)

Comment

People who like this

0 Show 1 · 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
Jirapongse ♦♦ · Jan 30, 2017 at 12:08 AM 0
Share

@vna

There was no response back from the development team. I will contact them again for the update.

avatar image
Answer by vna · Apr 26, 2017 at 05:23 PM

Hello Sunil & Jira,

any response yet? I am blocked trying to use the API if i can't match websites...

best

VnA

Comment

People who like this

0 Show 1 · 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
Jirapongse ♦♦ · Apr 26, 2017 at 11:01 PM 1
Share

@vna

I have tested it. The problem has been fixed. There is no 0x0D after the "Input_Website" text anymore.

avatar image
Answer by vna · May 24, 2017 at 02:15 PM

Thanks! It seems ok now for me too.

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

Related Questions

Trying to use permid file match and receive error Failed to resolve API Key variable request.header.X-AG-Access-Token

Resolution Scores in Intelligent Tagging API

Permid API vs manual search

SSLError: bad handshake

Any bug or caching issue with this RIC: TEPRF.PA

  • 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