/account
These methods allow you to login, get tokens, register, and change passwords.
Login
POST
https://pm415.com/api/account/login
Retrieves a valid token that can be set as Bearer
in the authorization header. Alternatively, you can use an API key from your user profile.
Request Body
Name | Type | Description |
---|
| | {"email":"mattreider@tmail.com", "password":"reider1"}
|
{
"token": "eyJ4gTkzXw-ayco9GYMxc1r9xDs...etc...",
"success": true,
"user": {
"id": 4,
"email": "mattreider@tmail.com",
"firstName": "Matthew",
"lastName": "Reider",
"organizations": [
{
"id": 6,
"name": "matt-org"
}
]
}
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"Password\" is required",
"success": false
}
{
"statusCode": 404,
"error": "Not Found",
"message": "User with email mattreider344@tmail.com not found.",
"success": false
}
Forgot Password
POST
https://pm415.com/api/account/forgotpassword
Sends a message to user with a password reminder.
Path Parameters
Name | Type | Description |
---|
| | {"email" : "mattreider@tmail.com"}
|
{
"message": "A message was sent to the mattreider@tmail.com",
"success": true,
"userId": 4
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"Email\" is required",
"success": false
}
{
"statusCode": 404,
"error": "Not Found",
"message": "User with email mattreider44@tmail.com not found.",
"success": false
}
Register (new org)
POST
https://pm415.com/api/account/register
Register an account for a new organization.
Path Parameters
Name | Type | Description |
---|
| | {"email" : "mattreider@tmail.com",
"password": "1111",
"confirmation": "1111",
"firstName": "Matt",
"lastName": "Reider",
"tosAccepted": "Y",
"organization": "MyOrg"}
|
{
"userId": 9,
"success": true
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"First Name\" is required",
"success": false
}
Register (existing org)
POST
https://pm415.com/api/account/register
Registers users to an existing org. Requires the invitation token that was sent to them by the user that registered the org and invited them.
Request Body
Name | Type | Description |
---|
| | {"email" : "mattreider@tmail.com", "password": "1111", "confirmation": "1111", "firstName": "Matt", "lastName": "Reider", "tosAccepted": "Y", "token": "934flsdf94rjsdnk92"}
|
{
"userId": 9,
"success": true
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"Token\" is required",
"success": false
}
Verify account
GET
https://pm415.com/api/account/verify?token=eyJiUf3556
Verifies user account using token from verification email.
Query Parameters
Name | Type | Description |
---|
| | Token that was sent in the verification email.
|
{
"userId": 6,
"success": true,
"message": "User registration is completed, lets go login"
}
Change Password
POST
https://pm415.com/api/account/changepassword
Changes password based on forgotten password action, which can only be initiated from a browser. Token must be valid for the request.
Path Parameters
Name | Type | Description |
---|
| | {"password" : "1111",
"confirmation": "1111",
"token" : "eyJhbGciOiJIUzIY45gBT7TkTbQ"}
|
{
"userId": 4,
"success": true,
"message": "New password saved"
}