Getting "401 Unauthorized" when trying to call rest API with JWT Token (Connect App)

I am getting “401 Unauthorized” when trying to make REST API Call with JWT Token which was generated using context exchange information during Connect App installation.

Here my code . I tried every possible way but still it seems like i’m missing something.

I am using “atlassian-jwt” package to generate token

function GetToken(){
const now = moment().utc();
const request = jwt.fromMethodAndUrl('GET', '/rest/api/3/issue');
    const tokenData = {
        "iss": 'com.example.myapp',
        "iat": now.unix(),       
        "exp": now.add(3, 'minutes').unix(),  
        "qsh": jwt.createQueryStringHash(request)
    const secret = '{Shared_Secret_From_installation_context}';
    const token = jwt.encodeSymmetric(tokenData, secret);

Can you guys help me out where I’m doing wrong or missing something?

My Connect App Descriptor has Scope [“READ”,“WRITE”,“ACT_AS_USER”]

still no response i need someone helps on this?

Can you elaborate on when/how you are using the GetToken() method? What does res.send(token) do in this context?