Welcome to Portkey Forum

Updated 3 weeks ago

The Unexpected Malfunction

All of a sudden, this stopped working
V
P
v
7 comments
Hey @Pavan checking this. What's the error you're getting, and at which stage?
I wonder if it is an authentication / access management error, where the permissions on the API key changed
Plain Text
url = f"https://api.portkey.ai/v1/configs/{config_id}"
headers = {"x-portkey-api-key": portkey_api_key, "content-type": "application/json"}
response = requests.get(url, headers=headers)
if response.status_code == 200:
    config = response.json().get("data").get("config")


I see the response is 200. But AttributeError: 'NoneType' object has no attribute 'get'
What's the Config ID that you are fetching?
Hey! We have updated our configs CRUD API response structure. The object will no longer be nested inside the data field. Can you please remove .get("data") and then try making the request.
Yes, it is working now. Thanks for the quick reply
Updated the code example in the doc as well!
Add a reply
Sign up and join the conversation on Discord