Having trouble accessing App Store Connect API with generated token

I'm trying to access the App Store Connect API and I'm having some issues. When I try to connect to the api with the generated token I get a 401 error code.

I have been following the instructions exactly as in the following documentation links.
https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api

https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests

Could it be an issue with the private key that I'm using? If so is there a way to verify if the private key I have is valid?
Would need to some code to help with this. Just leave out any private stuff.

I can say I had trouble with this for a few days myself but did get it to work eventually. My issue was the signature encoding. Basically the signature needed to be opensslsign encoded (not hashhmac) and once encoded, you need to strip the extra stuff from the ASN-1 sequence.

I’m having the same issue signing the token, do you want to form a team and solve the issue ?

Having trouble accessing App Store Connect API with generated token
 
 
Q