• Veera Goriparthi
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi,
I am using REST API call to get SF account details. I am able to get OAuth token, but when I use this token to get Account details it gives below rror.

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]



Here  is the flow

Request:https://ap1.salesforce.com/services/oauth2/token?grant_type=authorization_code&code=aPrxqJ8A8kLOza8Stjpv6sovqPjwgt9wJxzcIaPRsCnGPyxvpLJSOUhmEHkQ7qCNO84np7gXZQ%3D%3D&client_id=3MVG9ZL0ppGP5UrBx8LU.vAPd80ozIo4JMB66N3r1IPzsiMMPzIYm3pklapNDhi24wcd3Ik8JtlQZqr_opatH&client_secret=5390506801126798324&redirect_uri=https://local/user/connector/generic/redirectoauth


Response:
{"id":"https://login.salesforce.com/id/00D28000000KMl1EAG/00528000000MwpQAAS","issued_at":"1428631322872","scope":"id full custom_permissions api web openid visualforce refresh_token chatter_api","instance_url":"https://ap2.salesforce.com","token_type":"Bearer","refresh_token":"5Aep861TSESvWeug_wBae_.NiEYtLVbgA9FW1UDMAq7zqGYpEeyCgRS1jLbqFuSuC2vJd5RyDOmpU.pSPn.Q1zV","id_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjE5NCJ9.eyJleHAiOjE0Mjg2MzE0NDIsInN1YiI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20vaWQvMDBEMjgwMDAwMDBLTWwxRUFHLzAwNTI4MDAwMDAwTXdwUUFBUyIsImF0X2hhc2giOiJlbF9iOXBzSlJCMVFOMGI5cXJib0V3IiwiYXVkIjoiM01WRzlaTDBwcEdQNVVyQng4TFUudkFQZDgwb3pJbzRKTUI2Nk4zcjFJUHpzaU1NUHpJWW0zcHRsYXBORGhpMjR3Y2QzSWs4SnRsUVpxcl9vcGF0SCIsImlzcyI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20iLCJpYXQiOjE0Mjg2MzEzMjJ9.XXfxxvNwQgWrSP-eFoUhFbzDfqxsASntM1slTjhQXN_vgHAp-Wv0rJYBWg6QXcIWwQEsvfCAvGi9JkbRIZ5UYqLPSrnhxsje4StPfvwwHMBMarimqeKKWt24Xb6Hri0DMdp6FjN9y9RneJpVcZeLHbkFnOIUf11cgMk1d3kI9KrgmkoDn8TI1yfPU0NLbJtafnYw2S9cdHrcju31i-9eLjy-yeMrJtinS5TqUdWcalEL1uqZq_KGEnsWkmN8sjEaSgtCio33ZZwDL6IKTgdHeDZedEZfRqhUoyBni14qYdpRX9ANSd1B61HtCVLiAeetc156KB4KYr-oR0Byg7oqAswhU41OQ9RmNp5VDQVVKspgwImauJzhpLs59W64SH5dP
h4xn5SF7fCGK534idYP_HQOey2KxBNrS5ATOATbNHsDt0maztiPK0K8rNjjnARya8QCqPJoumeJddchsmYhMIWPrxtwzNdpPXMuSz3hY3xIALFf0cDW_OwBPWT4P3_KZqfE7w0lPihzwhTwHy4tSu_kq4t4ikMu-xc6TNkZoy4HJP_qNZ7f7CCENHvUHjF_vgjSqNcPVJnpp-g3ImN6eBbstsndoktkdxpSC8N34WyWwKxiC5S5NVtgJBbLI2J9Q8xdBvcArvvoANt6_nhjsDf6417kRstohZio1aOoSW8","signature":"3yrSoEaIoCEtGXZpMHaLnV8B6z/njamvHSPTOHUB9ME=","access_token":"00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd"}

token 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd
Request:https://ap1.salesforce.com/services/data/v31.0/query?q=SELECT+Name+From+User+WHERE+Id='00528000000MwpQAAS'
Authorization:Bearer 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]


Thanks,
Veera.
Hi,
I am using REST API call to get SF account details. I am able to get OAuth token, but when I use this token to get Account details it gives below rror.

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]



Here  is the flow

Request:https://ap1.salesforce.com/services/oauth2/token?grant_type=authorization_code&code=aPrxqJ8A8kLOza8Stjpv6sovqPjwgt9wJxzcIaPRsCnGPyxvpLJSOUhmEHkQ7qCNO84np7gXZQ%3D%3D&client_id=3MVG9ZL0ppGP5UrBx8LU.vAPd80ozIo4JMB66N3r1IPzsiMMPzIYm3pklapNDhi24wcd3Ik8JtlQZqr_opatH&client_secret=5390506801126798324&redirect_uri=https://local/user/connector/generic/redirectoauth


Response:
{"id":"https://login.salesforce.com/id/00D28000000KMl1EAG/00528000000MwpQAAS","issued_at":"1428631322872","scope":"id full custom_permissions api web openid visualforce refresh_token chatter_api","instance_url":"https://ap2.salesforce.com","token_type":"Bearer","refresh_token":"5Aep861TSESvWeug_wBae_.NiEYtLVbgA9FW1UDMAq7zqGYpEeyCgRS1jLbqFuSuC2vJd5RyDOmpU.pSPn.Q1zV","id_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjE5NCJ9.eyJleHAiOjE0Mjg2MzE0NDIsInN1YiI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20vaWQvMDBEMjgwMDAwMDBLTWwxRUFHLzAwNTI4MDAwMDAwTXdwUUFBUyIsImF0X2hhc2giOiJlbF9iOXBzSlJCMVFOMGI5cXJib0V3IiwiYXVkIjoiM01WRzlaTDBwcEdQNVVyQng4TFUudkFQZDgwb3pJbzRKTUI2Nk4zcjFJUHpzaU1NUHpJ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
Request:https://ap1.salesforce.com/services/data/v31.0/query?q=SELECT+Name+From+User+WHERE+Id='00528000000MwpQAAS'
Authorization:Bearer 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]


Thanks,
Veera.
Hi,
I am using REST API call to get SF account details. I am able to get OAuth token, but when I use this token to get Account details it gives below rror.

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]



Here  is the flow

Request:https://ap1.salesforce.com/services/oauth2/token?grant_type=authorization_code&code=aPrxqJ8A8kLOza8Stjpv6sovqPjwgt9wJxzcIaPRsCnGPyxvpLJSOUhmEHkQ7qCNO84np7gXZQ%3D%3D&client_id=3MVG9ZL0ppGP5UrBx8LU.vAPd80ozIo4JMB66N3r1IPzsiMMPzIYm3pklapNDhi24wcd3Ik8JtlQZqr_opatH&client_secret=5390506801126798324&redirect_uri=https://local/user/connector/generic/redirectoauth


Response:
{"id":"https://login.salesforce.com/id/00D28000000KMl1EAG/00528000000MwpQAAS","issued_at":"1428631322872","scope":"id full custom_permissions api web openid visualforce refresh_token chatter_api","instance_url":"https://ap2.salesforce.com","token_type":"Bearer","refresh_token":"5Aep861TSESvWeug_wBae_.NiEYtLVbgA9FW1UDMAq7zqGYpEeyCgRS1jLbqFuSuC2vJd5RyDOmpU.pSPn.Q1zV","id_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjE5NCJ9.eyJleHAiOjE0Mjg2MzE0NDIsInN1YiI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20vaWQvMDBEMjgwMDAwMDBLTWwxRUFHLzAwNTI4MDAwMDAwTXdwUUFBUyIsImF0X2hhc2giOiJlbF9iOXBzSlJCMVFOMGI5cXJib0V3IiwiY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iF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd
Request:https://ap1.salesforce.com/services/data/v31.0/query?q=SELECT+Name+From+User+WHERE+Id='00528000000MwpQAAS'
Authorization:Bearer 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]


Thanks,
Veera.
 
Hi,
I am using REST API to access my SF account, while login usinf OAuth I am getting Access TOken, but when I use it to get account details I am getting below error all the time, if I get refresh token that time also same issue.

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]

Thanks,
Veera
Hi,
I am using REST API to access my SF account, while login usinf OAuth I am getting Access TOken, but when I use it to get account details I am getting below error all the time, if I get refresh token that time also same issue.

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]

Thanks,
Veera
Hi,
I am using REST API call to get SF account details. I am able to get OAuth token, but when I use this token to get Account details it gives below rror.

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]



Here  is the flow

Request:https://ap1.salesforce.com/services/oauth2/token?grant_type=authorization_code&code=aPrxqJ8A8kLOza8Stjpv6sovqPjwgt9wJxzcIaPRsCnGPyxvpLJSOUhmEHkQ7qCNO84np7gXZQ%3D%3D&client_id=3MVG9ZL0ppGP5UrBx8LU.vAPd80ozIo4JMB66N3r1IPzsiMMPzIYm3pklapNDhi24wcd3Ik8JtlQZqr_opatH&client_secret=5390506801126798324&redirect_uri=https://local/user/connector/generic/redirectoauth


Response:
{"id":"https://login.salesforce.com/id/00D28000000KMl1EAG/00528000000MwpQAAS","issued_at":"1428631322872","scope":"id full custom_permissions api web openid visualforce refresh_token chatter_api","instance_url":"https://ap2.salesforce.com","token_type":"Bearer","refresh_token":"5Aep861TSESvWeug_wBae_.NiEYtLVbgA9FW1UDMAq7zqGYpEeyCgRS1jLbqFuSuC2vJd5RyDOmpU.pSPn.Q1zV","id_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjE5NCJ9.eyJleHAiOjE0Mjg2MzE0NDIsInN1YiI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20vaWQvMDBEMjgwMDAwMDBLTWwxRUFHLzAwNTI4MDAwMDAwTXdwUUFBUyIsImF0X2hhc2giOiJlbF9iOXBzSlJCMVFOMGI5cXJib0V3IiwiYXVkIjoiM01WRzlaTDBwcEdQNVVyQng4TFUudkFQZDgwb3pJbzRKTUI2Nk4zcjFJUHpzaU1NUHpJWW0zcHRsYXBORGhpMjR3Y2QzSWs4SnRsUVpxcl9vcGF0SCIsImlzcyI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20iLCJpYXQiOjE0Mjg2MzEzMjJ9.XXfxxvNwQgWrSP-eFoUhFbzDfqxsASntM1slTjhQXN_vgHAp-Wv0rJYBWg6QXcIWwQEsvfCAvGi9JkbRIZ5UYqLPSrnhxsje4StPfvwwHMBMarimqeKKWt24Xb6Hri0DMdp6FjN9y9RneJpVcZeLHbkFnOIUf11cgMk1d3kI9KrgmkoDn8TI1yfPU0NLbJtafnYw2S9cdHrcju31i-9eLjy-yeMrJtinS5TqUdWcalEL1uqZq_KGEnsWkmN8sjEaSgtCio33ZZwDL6IKTgdHeDZedEZfRqhUoyBni14qYdpRX9ANSd1B61HtCVLiAeetc156KB4KYr-oR0Byg7oqAswhU41OQ9RmNp5VDQVVKspgwImauJzhpLs59W64SH5dP
h4xn5SF7fCGK534idYP_HQOey2KxBNrS5ATOATbNHsDt0maztiPK0K8rNjjnARya8QCqPJoumeJddchsmYhMIWPrxtwzNdpPXMuSz3hY3xIALFf0cDW_OwBPWT4P3_KZqfE7w0lPihzwhTwHy4tSu_kq4t4ikMu-xc6TNkZoy4HJP_qNZ7f7CCENHvUHjF_vgjSqNcPVJnpp-g3ImN6eBbstsndoktkdxpSC8N34WyWwKxiC5S5NVtgJBbLI2J9Q8xdBvcArvvoANt6_nhjsDf6417kRstohZio1aOoSW8","signature":"3yrSoEaIoCEtGXZpMHaLnV8B6z/njamvHSPTOHUB9ME=","access_token":"00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd"}

token 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd
Request:https://ap1.salesforce.com/services/data/v31.0/query?q=SELECT+Name+From+User+WHERE+Id='00528000000MwpQAAS'
Authorization:Bearer 00D28000000KMl1!ARAAQPLIuaRCKyXQPB1LDjuiF4Bg1QAVfzXNFpq7C4zYRVurh3JxqYpcu5IIf98P1XOB7oEwLkbSJwdq4Mc0pxkmaQCbjbgd

Error while sending Salesforce request {}HTTP_401 : [{"message":"Session expired
 or invalid","errorCode":"INVALID_SESSION_ID"}]


Thanks,
Veera.