-
Notifications
You must be signed in to change notification settings - Fork 76
License Server API
Furkan Senharputlu edited this page Apr 15, 2020
·
4 revisions
Sample request
POST /admin/licenses HTTP/1.1
Host: localhost:4242
Content-Type: application/json
Authorization: admin123
{
"type": "Trial",
"claims": {
"username": "Furkan",
"address": "Istanbul, Turkey"
},
"active": true
}
Sample response
{
"id": "5e6ec9ce571983fd0e468213",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.bnVsbA.BF4LHTey6WwVbYuKSP_kyfeB2-PZPEJYHmkdp_R92y4"
}
Sample request
POST /license/verify HTTP/1.1
Host: localhost:4242
Content-Type: application/x-www-form-urlencoded
Authorization: admin123
token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.bnVsbA.BF4LHTey6WwVbYuKSP_kyfeB2-PZPEJYHmkdp_R92y4
Sample response
{
"valid": true
}
Sample request
GET /admin/licenses/{id} HTTP/1.1
Host: localhost:4242
Authorization: admin123
Sample response
{
"active": true,
"claims": {
"elma": "Istanbul, Turkey",
"username": "Furkan"
},
"id": "5e9789150ca4cfc86de24afd",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbG1hIjoiSXN0YW5idWwsIFR1cmtleSIsInVzZXJuYW1lIjoiRnVya2FuIn0.nXkNVO4WDPo2n9VT8iuMlYnrGJwipG2O1m1zeAFt1yw",
"type": "Trial"
}
Sample request
PUT /admin/licenses/{id}/activate HTTP/1.1
Host: localhost:4242
Authorization: admin123
Sample response
{
"message": "Activated"
}
Sample request
PUT /admin/licenses/{id}/inactivate HTTP/1.1
Host: localhost:4242
Authorization: admin123
Sample response
{
"message": "Inactivated"
}
Sample request
DELETE /admin/licenses/{id}/delete HTTP/1.1
Host: localhost:4242
Authorization: admin123
Sample response
{
"message": "License successfully deleted"
}