Another Salesforce blog!!!

Salesforce, Apex

July, 2014

Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)

Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application Favorite

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] […]

HTTP POST to the URL (Login) – Web API 2

How to do User Login into Web Api 2Do a HTTP POST to the URL [cc]http://localhost/token[/cc] with the HTTP HEADER [cc] content-type: application/x-www-form-urlencoded [/cc] HTTP BODY [cc] username=john&password=secret&grant_type=password [/cc] You should get HTTP RESPONSE 200 and return data as [cc] { “access_token”:”zt3Ma_gzOxRi53YgCciMe1H1j6Uss………..”, “token_type”:”bearer”, “expires_in”:1209599, “userName”:”john”, “.issued”:”Tue, 17 Jan 2014 17:58:05 GMT”, “.expires”:”Tue, 31 Jan 2014 17:58:05 […]

HTTP POST to the URL – Web API 2

Registration using Web Api 2 Do a HTTP POST to the URL [cc]http://localhost/api/Account/Register[/cc] with HTTP HEADER [cc]content-type: application/json[/cc] and the [cc]HTTP BODY[/cc] [cc] { “UserName”: “johnsmith”, “Password”: “supersecret”, “ConfirmPassword”: “supersecret” } [/cc] You should get a HTTP RESPONSE 200 (OK) Favorite