I am trying to run a function using the cognite API. My understanding is that in order to do that I must first create a session to get the nonce. I am running into an error when I try and post to that api:
HTTPError: 401 Client Error: Unauthorized for url: https://az-eastus-1.cognitedata.com/api/v1/projects/pinnacle-dev/sessions
I have confirmed that my group has permission to create sessions, I have confirmed that I am able to do other things with the api such as list assets, and also I am able to create a session in the SDK using client.iam.sessions.create() using the same client_id and client_secret. Any ideas where the authentication error would be coming from?
Here is what my code looks like
url = f"{BASE_URL}/sessions"
print(url)
headers = {
'Autherization': f"Bearer {access_token}",
}
data = {
'items' : [
{
'clientId': CLIENT_ID,
'clientSecret': CLIENT_SECRET,
},
]
}
response = requests.post(url, headers=headers, data=data)
response.raise_for_status()
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support