Vendor Authentication
Authenticating Vendors
STAGING_URL: https://switch-api-staging.herokuapp.com
LIVE_URL: https://switchapi.azurewebsites.netCreate Vendor
POST https://switch-api-staging.herokuapp.com/vendor/register
This endpoint registers a Vendor and returns a valid token for sessions .
Request Body
Name
Type
Description
category
string
vendor category
name
string
Name of Vendor
string
email of vendor
password
string
preferred password of Vendor
{
"message": "Vendor created successfully",
"data": {
"id": 197,
"email": "example@gmail.com"
}
}{
"message": "Error occurred creating vendor",
"errors": {
"email": [
"can't be blank"
],
"password": [
"can't be blank"
],
"name": [
"can't be blank"
],
"category": [
"can't be blank"
]
}
}Login Vendor
POST https://switch-api-staging.herokuapp.com/vendor/login
This endpoint authenticate the vendor and returns a token used for sessions
Request Body
Name
Type
Description
password
string
Vendor password
string
vendor email
{
"message": "Vendor login successful",
"data": {
"auth_token": "eyJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOjcsImV4cCI6MTU0NzUyMjkyMSwiY29udGV4dCI6InZlbmRvciJ9.arMSfaN1eCcn5G47NBdUAwagKgNzERhUQaGvuhVE-JY",
"vendor": {
"id": 7,
"email": "example@gmail.com"
}
}
}Forgot Password
POST https://switch-api-staging.herokuapp.com/vendor/forgot_password
Request Body
Name
Type
Description
string
{
"message": "Password reset email sent successfully"
}{
"message": "Email is invalid"
}Reset Password
GET https://switch-api-staging.herokuapp.com/vendor/reset_password
Path Parameters
Name
Type
Description
reset_password_token
string
token attached to reset link
Request Body
Name
Type
Description
password
string
new password for vendor
{
"message": "Password changed successfully"
}{
"message": "Password could not be updated",
"errors": {
"reset_password_token": [
"can't be blank"
]
}
}Last updated
Was this helpful?