I'm getting StatusCode: 401, ReasonPhrase: 'Unauthorized' Error

I’m getting following response when I access “/api/v1/users/{$UserID}/groups” GET API. But I could not trace out the issue. Any hint would be helpful. I have developed my code 6 months back, that time OKTA integration was working fine, however now I’m getting the issue.

{StatusCode: 401, ReasonPhrase: ‘Unauthorized’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
Transfer-Encoding: chunked
Connection: keep-alive
Public-Key-Pins-Report-Only: pin-sha256=“r5EfzZxQVvQpKo3AgYRaT7X2bDO/kj3ACwmxfdT2zt8=”; pin-sha256=“MaqlcUgk2mvY/RFSGeSwBRkI+rZ6/dxe/DuQfBT/vnQ=”; pin-sha256=“72G5IEvDEWn+EThf3qjR7/bQSWaS2ZSLqolhnO6iyJI=”; pin-sha256=“rrV6CLCCvqnk89gWibYT0JO6fNQ8cCit7GGoiVTjCOg=”; max-age=60; report-uri=“Report URI: Welcome to report-uri.com
x-okta-request-id: YW7MwznL04J2HLEyKM0X0AAABW4
x-xss-protection: 0
x-content-type-options: nosniff
Strict-Transport-Security: max-age=315360000; includeSubDomains
Date: Tue, 19 Oct 2021 13:48:51 GMT
Set-Cookie: sid=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Server: nginx
WWW-Authenticate: SSWS
Content-Type: application/json

I found out the issue. This issue is basically because of API Token expire. I have created new API token under, Security → API → Tokens → Create Token. then I have used same token in my code and it resolved my issue.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.