By using POSTMAN,
For all Non-SECURE page, (you can try object with cars, cars2, categories, products, dji)
get hp://download.hkvstore.com/phpdemo2019/api
post hp://download.hkvstore.com/phpdemo2019/api
{
"action": "list",
"object": "cars"
}
the response is
{
"success": true,
"cars": [
{
"ID": "1",
"Trademark": "8",
"Model": "40",
"HP": "302",
"Liter": "4.966",
"Cyl": "8",
"Category": "SPORTS",
"Price": "83800",
"Picture": "h**p://download.hkvstore.com/phpdemo2019/api/index.php?object=cars&action=file&field=Picture&key=1"
},
{
...snip...
}
],
"version": "15.0.0"
}Login and get the jwt token
get hp://download.hkvstore.com/phpdemo2019/api
post hp://download.hkvstore.com/phpdemo2019/api
{
"action": "login",
"username": "admin",
"password": "master",
}
the response is
{
"JWT": "eyJ0eX{header_snip}.eyJpYX{payload_snip}.uAhKK9{singature_snip}",
}copy the JWT as token and pass to SECURE page as token (you can try object with trademarks, models, customers, orders and so on)
get hp://download.hkvstore.com/phpdemo2019/api/?action=list&object=customers
post hp://download.hkvstore.com/phpdemo2019/api/?action=list&object=customers
{
"token": "eyJ0eX{header_snip}.eyJpYX{payload_snip}.uAhKK9{singature_snip}",
"action": "list",
"object": "customers"
}
the response is
{
"success": false,
"failureMessage": "You do not have permission to access /phpdemo2019/api/index.php.",
"version": "15.0.0"
}
Can anybody tell me how to access the SECURE page by using the JWT token?
Regards,