function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arjunmarjunm 

Rest api error for invalid_grant Type

 

hi all

 

I Created Remote Access

i got the values as  Consumer Key,Consumer Secret

 

 the Web Server OAuth Authentication Flow

 

 

https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=
xxxxxxxxxxxxx&redirect_uri=https://appliction.com&state=mystate

 

in above url I got the Code value

 

https://appliction.com/?code=xxxxxxxxxxxxxx&state=mystate

 

next i put below url 

https://login.salesforce.com/services/oauth/token?code=xxxxxxxxxxx&grant_type=authorization_code&client_id=xxxxxxx&client_secret=xxxxxx&redirect_uri=https://appliction.com

it show error as

 

<OAuth><error>invalid_grant</error><error_description>expired authorization code</error_description></OAuth>

 

What Is a grant_type

How will get grant_type value

 

i am new to rest webservices in apex ,  please provide detailled information about  how to run simple programm Post For  Rest api

 

 

Thanks&Regards

arjun