Run .Net Core in mac and windows box.
You have to install below software in order to run this code.
- .Net Core (1.0.0-preview2-1-003177)
Unless if you want to change this version please go to global.json
file and Apply that version. I recommend to use current version.
Run below command at user_management_api\src\hackMT.UserMgmt
lavel
$ dotnet restore
$ dotnet build
$ dotnet run
If you getting any databse related issue. Pleae delete UserMgmt.db
file and run below command.
$ dotnet ef database update
Once above command run successfully, go to postman, choose GET and write http://localhost:5000/users/v1/status
. It should prodive you status of the API.
Request
{
"username": "Luke",
"email": "[email protected]",
"password": "MonkeyLuvr7",
"old_password": "",
"new_password": "",
"avatar_url": "http://imgur.com/w32"
}
Response
{
"user_id": 1,
"username": "Luke",
"email": "[email protected]",
"password": "MonkeyLuvr7",
"old_password": "",
"new_password": "",
"avatar_url": "http://imgur.com/w32",
"api_token": "3196b76f-60f3-45b6-a568-53db426c1d34"
}
On this you must send the user_id. All other fields are optional. Any field sent will be updated.
Request
{
"user_id": "a87sdf87as87fd87saf6sa8",
"username": "newuser",
"old_password": "98dsa798fd9fdsa98kj32kj32",
"new_password": "98dsa798fd9fdsa98kj32kj32",
}
Response
{
"user_id": "97ad9f7a9sd7f9",
"status": "<success | failed>",
"message": "<error message>"
}
Returns a list of user objects.
Response
[{
"user_id": "98dsa7f9sd97f79a8df79s",
"username": "foobar",
"email": "[email protected]",
"password": "98a7dsf98sa7fd98asd89d9a8df",
"avatar_url": "http://imgur.com/9dsa99as9d8f"
},
{
"user_id": "98ds3f3f43f334wqr23wer8dsadf8s",
"username": "barfoo",
"email": "[email protected]",
"password": "98a7adssaddsfadsdsafsd89d9a8df",
"avatar_url": "http://imgur.com/9dsa99as9d8f"
}]
Returns all the details (fields) for a single user.
Response
{
"user_id": "98dsa7f9sd97f79a8df79s",
"username": "foobar",
"email": "[email protected]",
"password": "98a7dsf98sa7fd98asd89d9a8df",
"avatar_url": "http://imgur.com/9dsa99as9d8f",
"api_token": "b7f88e9f-28be-4f50-b4b9-442c9b12ac54"
}
Deletes a user from the database (this marks a user as deleted so other tables/services keep working).
Response
{
"user_id": "97ad9f7a9sd7f9",
"status": "<success | failed>",
"message": "<error message>"
}
This provides a mechanism for monitoring tools to see the health of the api.
Response
{
"status": "online",
"user_count": "73"
}
- Repo owner or admin