question

Upvote
Accepted
16 1 1 3

Entity Lookup 401 Error

The code below used to work perfectly, now it is returing a 401 error. Any help would be appreciated. Note the API key has not expired.


import requests
import json
import csv
import re

# def get_lookup_info(ticker, access_token):
lookup_url = 'https://permid.org/'

headers = {
    'Accept':'application/ld+json'
}

access_token = "FqL8ome1GAvAPv6NQ0lRQ1fNLYbLFipW"
ticker = "1-21548755953"
response = requests.get(url=f'{lookup_url}{ticker}?format=json-ld&access-token={access_token}', headers =headers )

response


Edit: I have even tried the official software using many other keys from our department, all end up in errors. Error is first code block, and execution code third code block.

ERROR:openpermid:<Response [401]>, {'Date': 'Wed, 18 Jan 2023 19:33:16 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'X-Cnection': 'close', 'Access-Control-Allow-Credentials': 'true', 'Vary': 'Origin', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 d7790c7504b110faa52e9641bf06a578.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'DFW56-P3', 'X-Amz-Cf-Id': 'tAP9Yj_NCHREsP1eBikoXjX_AZ5IDAAtClX1eQR6sa7K0XQRgkYyjw==', 'CF-Cache-Status': 'DYNAMIC', 'Server': 'cloudflare', 'CF-RAY': '78b9c2e56b0d29b4-ORD'}, {
  "message":"Invalid authentication credentials"
}
(None, 'Unauthorized: {\n  "message":"Invalid authentication credentials"\n}')


from OpenPermID import OpenPermID

opid = OpenPermID()
opid.set_access_token("FqL8ome1GAvAPv6NQ0lRQ1fNLYbLFipW")
opid.lookup("1-5064690523", format='dataframe', orient='row')

#productpermid-apiopen-permid-apierror-401open-perm-id
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.

Upvote
Accepted
11.1k 22 6 9

@islashires @d.snow So I have checked this service using the Python package and the following is working for me:

from OpenPermID import OpenPermID

opid = OpenPermID()
opid.set_access_token("YOUR TOKEN HERE")
opid.search("Microsoft",format='dataframe')

1674560618074.png


Can you both check this to see if this works for you- I also updated the python library using "pip install OpenPermID --upgrade". I cannot seem to get the opid.lookup service to work - I am getting the same invalid credentials message as you are. I am speaking with the product team and will report back.


1674560618074.png (375.7 KiB)
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.

Upvote
11.1k 22 6 9

@islashires Thanks for your question and apologies for your issue, I have also tried this on the OpenPermID site itself and I am getting an error as well - so I believe there is some problem with the service itself: 1674114519043.png

I have escalated this to the Service Owners who are now investigating and I will get back to you as soon as I hear anything. Please bear with us. I hope this can help.



1674114519043.png (193.9 KiB)
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.

Hi, We have tried this with both registered and un-registered users and we are not able to replicate this issue from our end. Can you please send us the detailed steps to replicate this?

Hi the thread is full of examples of it not working.

I will add a google colab notebook for replication too.

from OpenPermID import OpenPermID
 
opid = OpenPermID()
opid.set_access_token("FqL8ome1GAvAPv6NQ0lRQ1fNLYbLFipW") # tested my creds and other users
opid.lookup("1-5064690523", format='dataframe', orient='row')


Upvotes
31 0 0 4

Hi @jason.ramchandani01, I am struggling with the same as I realized my program failed and stopped updating. Has the team been able to check this out? Cheers Derek.

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.

Hi @d.snow Sorry to hear you are facing the same issue - the issue is being investigated by the Development Team and I have requested an urgent update from them ASAP. I will post on here as soon as I hear anything. Please bear with us. I hope this can help.
Upvotes
31 0 0 4

Thanks @jason.ramchandani01 we are able to run your function too. And you are right, the look-up seems to be the problem. We currently use it in a microservice for daily updates and have switched it off. I will add a google colab notebook for replication too.

from OpenPermID import OpenPermID
 
opid = OpenPermID()
opid.set_access_token("FqL8ome1GAvAPv6NQ0lRQ1fNLYbLFipW") # tested my creds and other users
opid.lookup("1-5064690523", format='dataframe', orient='row')

It's good to know that the product team is working on it. Please let me know if there is any updates.


Cheers :)


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.

Upvotes
1 1 1 1

This is still an issue, does anyone know when this will be resolved?

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.

Upvotes
266 1 0 2

@islashires @d.snow @dharvey

On behalf of the product team, I need to apologize for the trouble you've been having with Lookup API. My team and I are doing everything we can to resolve this as fast as possible. We will update you further on the progress in this thread. I apologize again for any inconvenience.

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.

Thanks @aleksandra..wawrzyniak we are looking forward to the solution! Please keep us up to date.
Upvotes
266 1 0 2

@islashires @d.snow @dharvey

We have made the changes in the Lookup API and your code should be working now. No changes are needed from your side.

Aleksandra

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.