Another Salesforce blog!!!

Salesforce, Apex

Call Authenticated – Web API 2


How to call an Authenticated Web Api 2 method

Do a HTTP GET on the this URL

[cc]
http://localhost:15718/api/Account/UserInfo
[/cc]
with the HTTP HEADER

[cc]
Authorization: Bearer zt3Ma_gzOxRi53YgCciMe1H1j6Uss………

[/cc]
The bearer token is from login using http://localhost/token. You can get more information here.

[cc]

You should get a HTTP RESPONSE 200 with following data

[/cc]

[cc]
{
“UserName”:”john”,
“HasRegistered”:true,
“LoginProvider”: null
}

[/cc]

Leave a Reply

Your email address will not be published. Required fields are marked *

*