Happy Business Starts Here

Highlighted
Zuora Support Moderator

REST API: good session token returns 401 Authorization error

Question/Problem Statement:


In our API code, a recently requested REST session token produces a 401 HTTP response (Authorization error) when used in a REST/AQuA request. We know the token should be good as we just requested it and not expired



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √


1 REPLY 1
Zuora Support Moderator

Re: REST API: good session token returns 401 Authorization error

Solution:


Check your request payload output and API code to ensure you are NOT passing URL encoded characters in the session token. Here is a simplified example

 

Good:

 

Authorization: ZSession ABC123=

 

Bad:

 

Authorization: ZSession ABC123%3D

If your API code integration is passing (percent) URL encoding the session token will be rejected as invalid producing 401 responses randomly when the character is included.



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √