Sivakumar

Sivakumar

  • NA
  • 551
  • 218.4k

How to run web api using REST Tool

Sep 7 2015 12:02 AM
Hi,
 
 
This is my web API  :
 
 
[RoutePrefix("api/Members")]
public class MembersController : BaseController
{
private MemberManager _member = new MemberManager();

[HttpPost]
[AllowAnonymous]
[Route("login")]
[ValidateModel]
public Token Login(LoginData login)
{
if (login == null)
throw new InvalidCredentialException();

int memberId = _member.ValidateAndGetMemberID(login.Email, login.Password); //this method will throw exception if the password didn't match
return new JwtHandler().Createtoken(memberId.ToString());
}

/// <summary>
/// This API will return current logged in Member Id, Name, Status.
/// If the expand option has memberteams, then member's team membership details will be included
/// </summary>
/// <param name="expand"></param>
/// <returns></returns>
[Route("")]
//api/members?expand=memberteams
public MemberData GetMemberDetails(string expand)
{
return _member.GetMemberDetail(CurrentMemberID, expand);
}

/// <summary>
/// This API returns current logged in member's team membership details.
/// </summary>
/// <returns></returns>
[Route("teams")]
//api/members/teams
public List<TeamData> GetMemberTeams()
{
return _member.GetMemberTeams(CurrentMemberID);
}
}
}
 
i want to run this web api using rest tool.
i am successfully login but how to get member details please give a uri
 

Answers (1)