How to get the access_token to call the Apex REST service from outside using the Rest Client

How to get the access_token to call the Apex REST service from outside using the Rest Client ?

I have a connected App and that gives me

Consumer Secret : 1180XXXXXXXXXX


enter image description here

When I used below URL, I got the error:"3MVG9d8..z.hDcPJZPIzGJ5UZDuKCOqbHXXXXXXXXXXXXXXXXXXXXX"&

when I used below, I see the error, why ???

enter image description here

Whats wrong I used with username and password ??
Why its saying invalid client id ?

Yes I tried with below as well"3MVG9d8..z.hDcPJZPIzGJ5UZDuKCOqbH8CCGCPnmwQuRbwLZ_2f.thbqWMX82H7JRGx4

Here I put my actual username and password which I used to login into the Production salesforce org. Please guide.

::::::UPDATED POST::::

Now this is final URL:’ Still it says"3MVG9d8..z.hDcPJZPIzGJ5UZDuKCOqbH8CCGCPnmwQuRbwLZ_2f.thbqWM
    X82H7JRGx46VYyEkuwzQ9._ww5"&client_secret="1180508865211885204"&username="<a href="" class="__cf_email__" data-cfemail="32426a6a6a6a6a6a6a6a724a4b1c515d5f">[email protected]</a>"&
    password="<a href="" class="__cf_email__" data-cfemail="2e5a4b5d5a474049434b6e1f1e1e1e74175f785e575a4b43461d7f19457e437b1d5e626b746866">[email protected]</a>"&grant_type=password

enter image description here


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Did you add your username and password with a security token to the url variables that call for them? From your url it looks like you just have “Username” and “Password” where the variables should be.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x