Profile API offers detailed information of each user who is registered with the company. On entering specific set of input parameters passed in the Profile URL, the security token authenticates and returns all basic profile details of the user along with the access levels, achievement details, course details, curriculum details, the status of the course and curriculum available in the Linchpin application.
Security token and origination url, should be sent as response headers for authentication
URL
The URL structure (path only, no root url) api/v1/Profile or / Profile? Filters={”minrange”:”1”, “maxrange”:”10”,”active”:”true”}
Method
The request type
GET
URL Params
Required:
minrange=[int]
maxrange=[int]
active=[bool]
Input parameter class structure
public class Filters
{
public int MinRange { get; set; } -- starting row number
public int MaxRange { get; set; } -- ending row number
public bool Active { get; set; } – Active/Inactive profiles
}
Input parameter Validation rules
Minimum value expected for MinRange is 1, Max Value should be greater than or equal to MinRange. Active parameter expects either true or false.
Output Response Object
public class ProfileDto
{
public int UserId { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public DateTime? Dob { get; set; }
public string Gender { get; set; }
public string Phone { get; set; }
public string Profileimage { get; set; }
public int Credits { get; set; }
public int UserLevel { get; set; }
public int NextLevelCredits { get; set; }
public string Language { get; set; }
public DateTime? CreatedDate { get; set; }
public int Rank { get; set; }
public string Usage { get; set; }
public string Engagement { get; set; }
public float EngagementPercentage { get; set; }
public List
Success Response
Successful request:
{
“status”:200,
“profile”:[{
"UserId":"UserId",
"Name":"Name",
"Email":"test@email.com",
"Dob":"Dob",
"Gender":"Gender"
"Phone":"+11234567890",
"Profileimage":"Profileimage",
"Credits":"Credits",
"UserLevel":"UserLevel",
"NextLevelCredits":"NextLevelCredits",
"Language":"Language",
"CreatedDate":"CreatedDate",
"Rank":"Rank",
"Usage":"Usage",
"Engagement":"Engagement",
"EngagementPercentage":"EngagementPercentage"
"Roles":[{
"Role":"Role"
},
{
"Role":"Role"
}]
}]
}
HTTP Status Codes
Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc.
Example:
Code: 200 OK
Description: { Success }
Code: 401 UNAUTHORIZED
Description: {error: "Authentication credentials were missing or incorrect.”}
Code: 400 Bad Request
Description: { error : "The request was invalid or cannot be otherwise served" }
Code: 404 Not Found
Description: { error : "Profile details not found" }